Files
MokoSuiteBackup/source/packages/com_mokosuitebackup/src/View/Profile/HtmlView.php
T
jmiller 07fb4dcc24
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 10s
fix: remove run/backup buttons, move actions to detail view, custom restore script name, version bump 01.43.11-dev
- Remove Run Backup / Backup Now buttons from profiles list, profile edit toolbar, and backup records view
- Move download, browse archive, and view log from backup list rows into individual backup record detail view
- Add download button to backup detail toolbar
- Link profile column in backup records list to profile edit
- Complete restore script filename customization across BackupEngine, SteppedBackupEngine, and MokoRestore
- Remove ordering field from profiles, default sort by ID ascending
- Fix untranslated JFIELD language keys
- Bump all manifests to 01.43.11-dev
2026-06-25 10:54:35 -05:00

68 lines
1.8 KiB
PHP

<?php
/**
* @package MokoSuiteBackup
* @subpackage com_mokosuitebackup
* @author Moko Consulting <hello@mokoconsulting.tech>
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE
*/
namespace Joomla\Component\MokoSuiteBackup\Administrator\View\Profile;
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Toolbar\Toolbar;
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_MOKOJOOMBACKUP_PROFILE_NEW' : 'COM_MOKOJOOMBACKUP_PROFILE_EDIT';
$user = Factory::getApplication()->getIdentity();
$canSave = $isNew
? $user->authorise('core.create', 'com_mokosuitebackup')
: $user->authorise('core.edit', 'com_mokosuitebackup');
ToolbarHelper::title(Text::_($title), 'cog');
if ($canSave) {
ToolbarHelper::apply('profile.apply');
ToolbarHelper::save('profile.save');
}
if (!$isNew) {
$toolbar = Toolbar::getInstance();
$profileId = (int) $this->item->id;
$backupsUrl = Route::_('index.php?option=com_mokosuitebackup&view=backups&filter[PROFILE_ID]=' . $profileId);
$toolbar->linkButton('view-backups', 'COM_MOKOJOOMBACKUP_VIEW_BACKUPS')
->url($backupsUrl)
->icon('icon-database')
->buttonClass('btn btn-info');
}
ToolbarHelper::cancel('profile.cancel', $isNew ? 'JTOOLBAR_CANCEL' : 'JTOOLBAR_CLOSE');
}
}