6a717342db
Five new admin views with models, templates, and list UI:
- Conditions: condition sets with group/rule counts and inline publish
- Snippets: reusable text blocks with {snippet alias} syntax
- Replacements: search/replace rules with regex and area badges
- Templates: content templates with category and description
- Modules: advanced module manager with position and client badges
Also adds togglePublished endpoint to DisplayController.
Claude-Session: https://claude.ai/code/session_01Jo2JpjCwfHAh2HHRSjczKq
56 lines
1.5 KiB
PHP
56 lines
1.5 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
|
|
*
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
|
|
namespace Moko\Component\MokoSuiteClient\Administrator\View\Templates;
|
|
|
|
defined('_JEXEC') or die;
|
|
|
|
use Joomla\CMS\Factory;
|
|
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
|
|
use Joomla\CMS\Toolbar\ToolbarHelper;
|
|
|
|
class HtmlView extends BaseHtmlView
|
|
{
|
|
protected $items = [];
|
|
protected $total = 0;
|
|
protected $filters = [];
|
|
|
|
public function display($tpl = null)
|
|
{
|
|
$model = new \Moko\Component\MokoSuiteClient\Administrator\Model\TemplatesModel();
|
|
$input = Factory::getApplication()->getInput();
|
|
|
|
$this->filters = [
|
|
'search' => $input->getString('filter_search', ''),
|
|
'published' => $input->get('filter_published', ''),
|
|
];
|
|
|
|
$page = max(1, $input->getInt('page', 1));
|
|
$limit = 50;
|
|
$offset = ($page - 1) * $limit;
|
|
|
|
$this->items = $model->getItems($this->filters, $limit, $offset);
|
|
$this->total = $model->getTotal($this->filters);
|
|
|
|
$this->addToolbar();
|
|
|
|
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
|
|
$wa->registerAndUseStyle('com_mokosuiteclient.dashboard', 'com_mokosuiteclient/dashboard.css');
|
|
|
|
parent::display($tpl);
|
|
}
|
|
|
|
protected function addToolbar(): void
|
|
{
|
|
ToolbarHelper::title('Content Templates', 'file-lines');
|
|
ToolbarHelper::back('JTOOLBAR_BACK', 'index.php?option=com_mokosuiteclient');
|
|
}
|
|
}
|