* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved. * @license GNU General Public License version 3 or later; see LICENSE */ namespace Joomla\Component\MokoBackup\Administrator\View\Profile; defined('_JEXEC') or die; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Toolbar\ToolbarHelper; class HtmlView extends BaseHtmlView { protected $item; protected $form; public function display($tpl = null): void { $this->item = $this->get('Item'); $this->form = $this->get('Form'); $this->addToolbar(); parent::display($tpl); } protected function addToolbar(): void { $isNew = empty($this->item->id); $title = $isNew ? 'COM_MOKOBACKUP_PROFILE_NEW' : 'COM_MOKOBACKUP_PROFILE_EDIT'; ToolbarHelper::title(Text::_($title), 'cog'); ToolbarHelper::apply('profile.apply'); ToolbarHelper::save('profile.save'); ToolbarHelper::cancel('profile.cancel', $isNew ? 'JTOOLBAR_CANCEL' : 'JTOOLBAR_CLOSE'); } }