a808789acb
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 23s
- Add COM_MOKOJOOMBACKUP_SHORT="Backup" to the component .ini and .sys.ini (en-GB + en-US) so both view titles and the admin sidebar menu resolve it. - Prefix every admin view's toolbar title with the short brand via the constant (e.g. "Backup: Dashboard", "Backup: Records"), and tighten the view title strings that redundantly led with "Backup"/"MokoSuiteBackup". - Admin sidebar top-level menu now shows the short name. Hardcoded as "Backup" in the manifest per the package-xml convention (no language strings in package XML).
59 lines
1.9 KiB
PHP
59 lines
1.9 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\Dashboard;
|
|
|
|
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
|
|
{
|
|
public ?object $lastBackup = null;
|
|
public ?object $nextScheduled = null;
|
|
public object $stats;
|
|
public array $systemHealth = [];
|
|
public array $profiles = [];
|
|
public bool $defaultDirWarning = false;
|
|
public ?object $latestSnapshot = null;
|
|
public int $snapshotCount = 0;
|
|
public array $backupTrend = [];
|
|
public array $storageByProfile = [];
|
|
|
|
public function display($tpl = null): void
|
|
{
|
|
/** @var \Joomla\Component\MokoSuiteBackup\Administrator\Model\DashboardModel $model */
|
|
$model = $this->getModel();
|
|
|
|
$this->lastBackup = $model->getLastBackup();
|
|
$this->nextScheduled = $model->getNextScheduled();
|
|
$this->stats = $model->getStats();
|
|
$this->systemHealth = $model->getSystemHealth();
|
|
$this->profiles = $model->getProfiles();
|
|
$this->defaultDirWarning = $model->isUsingDefaultBackupDir();
|
|
$this->latestSnapshot = $model->getLatestSnapshot();
|
|
$this->snapshotCount = $model->getSnapshotCount();
|
|
$this->backupTrend = $model->getBackupTrend();
|
|
$this->storageByProfile = $model->getStorageByProfile();
|
|
|
|
$this->addToolbar();
|
|
|
|
parent::display($tpl);
|
|
}
|
|
|
|
protected function addToolbar(): void
|
|
{
|
|
ToolbarHelper::title(Text::_('COM_MOKOJOOMBACKUP_SHORT') . ': ' . Text::_('COM_MOKOJOOMBACKUP_DASHBOARD_TITLE'), 'archive');
|
|
ToolbarHelper::preferences('com_mokosuitebackup');
|
|
}
|
|
}
|