4b9a675d0f
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 1s
Generic: Project CI / Lint & Validate (push) Successful in 36s
Platform: moko-platform CI / Gate 1: Code Quality (push) Failing after 40s
Generic: Project CI / Tests (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (push) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (push) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (push) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (push) Has been cancelled
Platform: moko-platform CI / CI Summary (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Generic: Repo Health / Report Issues (push) Has been cancelled
All Joomla element names, PHP classes, language files, folder structure, and manifest references renamed from mokosuite to mokosuiteclient. This repo is now the client-facing tracker for the MokoSuite platform.
78 lines
2.3 KiB
PHP
78 lines
2.3 KiB
PHP
<?php
|
|
/**
|
|
* @package MokoSuiteClient
|
|
* @subpackage com_mokosuiteclient
|
|
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
|
* @license GNU General Public License version 3 or later; see LICENSE
|
|
*/
|
|
|
|
namespace Moko\Component\MokoSuiteClient\Administrator\View\Dashboard;
|
|
|
|
defined('_JEXEC') or die;
|
|
|
|
use Joomla\CMS\Factory;
|
|
use Joomla\CMS\Language\Text;
|
|
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
|
use Joomla\CMS\Toolbar\ToolbarHelper;
|
|
|
|
class HtmlView extends BaseHtmlView
|
|
{
|
|
protected $plugins = [];
|
|
protected $siteInfo;
|
|
protected $recentLogins = [];
|
|
protected $pendingUpdates = [];
|
|
protected $checkedOutItems = [];
|
|
protected $wafBlocks = [];
|
|
protected $wafChartData = [];
|
|
protected $loginChartData = [];
|
|
protected $mokoExtensions = [];
|
|
|
|
public function display($tpl = null)
|
|
{
|
|
$model = $this->getModel();
|
|
|
|
$this->plugins = $model->getFeaturePlugins();
|
|
$this->siteInfo = $model->getSiteInfo();
|
|
$this->recentLogins = $model->getRecentLogins(5);
|
|
$this->pendingUpdates = $model->getPendingUpdates();
|
|
$this->checkedOutItems = $model->getCheckedOutItems();
|
|
$this->wafBlocks = $model->getRecentWafBlocks(5);
|
|
$this->wafChartData = $model->getWafBlocksByDay(14);
|
|
$this->loginChartData = $model->getLoginsByDay(14);
|
|
$this->mokoExtensions = $model->getMokoExtensions();
|
|
|
|
// Check for importable Akeeba data
|
|
try
|
|
{
|
|
$importModel = new \Moko\Component\MokoSuiteClient\Administrator\Model\ImportModel();
|
|
$this->adminToolsAvailable = $importModel->checkAdminToolsAvailable();
|
|
$this->atsAvailable = $importModel->checkAtsAvailable();
|
|
}
|
|
catch (\Throwable $e)
|
|
{
|
|
$this->adminToolsAvailable = null;
|
|
$this->atsAvailable = null;
|
|
}
|
|
|
|
$this->addToolbar();
|
|
|
|
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
|
|
$wa->registerAndUseStyle('com_mokosuiteclient.dashboard', 'com_mokosuiteclient/dashboard.css');
|
|
$wa->registerAndUseScript('com_mokosuiteclient.dashboard', 'com_mokosuiteclient/dashboard.js', [], ['defer' => true]);
|
|
|
|
parent::display($tpl);
|
|
}
|
|
|
|
protected function addToolbar(): void
|
|
{
|
|
ToolbarHelper::title(Text::_('COM_MOKOSUITECLIENT_DASHBOARD_TITLE'), 'cogs');
|
|
|
|
$user = Factory::getApplication()->getIdentity();
|
|
|
|
if ($user->authorise('core.admin', 'com_mokosuiteclient'))
|
|
{
|
|
ToolbarHelper::preferences('com_mokosuiteclient');
|
|
}
|
|
}
|
|
}
|