77 lines
1.7 KiB
PHP
77 lines
1.7 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @package MokoSuiteOpenGraph
|
||
|
|
* @subpackage com_mokoog
|
||
|
|
* @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\MokoOG\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;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Dashboard view — OG tag coverage metrics.
|
||
|
|
*/
|
||
|
|
class HtmlView extends BaseHtmlView
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Overall coverage stats.
|
||
|
|
*
|
||
|
|
* @var array
|
||
|
|
*/
|
||
|
|
protected $stats = [];
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Coverage broken down by content_type.
|
||
|
|
*
|
||
|
|
* @var array
|
||
|
|
*/
|
||
|
|
protected $byType = [];
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Published articles missing an OG tag.
|
||
|
|
*
|
||
|
|
* @var array
|
||
|
|
*/
|
||
|
|
protected $missing = [];
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Display the view.
|
||
|
|
*
|
||
|
|
* @param string $tpl Template name
|
||
|
|
*
|
||
|
|
* @return void
|
||
|
|
*/
|
||
|
|
public function display($tpl = null): void
|
||
|
|
{
|
||
|
|
/** @var \Joomla\Component\MokoOG\Administrator\Model\DashboardModel $model */
|
||
|
|
$model = $this->getModel();
|
||
|
|
|
||
|
|
$this->stats = $model->getStats();
|
||
|
|
$this->byType = $model->getCoverageByType();
|
||
|
|
$this->missing = $model->getMissingArticles(20);
|
||
|
|
|
||
|
|
$this->addToolbar();
|
||
|
|
|
||
|
|
parent::display($tpl);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Add the toolbar.
|
||
|
|
*
|
||
|
|
* @return void
|
||
|
|
*/
|
||
|
|
protected function addToolbar(): void
|
||
|
|
{
|
||
|
|
ToolbarHelper::title(Text::_('COM_MOKOOG_DASHBOARD_TITLE'), 'bookmark');
|
||
|
|
ToolbarHelper::preferences('com_mokoog');
|
||
|
|
}
|
||
|
|
}
|