fix: production readiness improvements for admin panel and installer
Joomla: Repo Health / Access control (push) Successful in 2s
Universal: Cascade Main → Dev / Cascade main → branches (push) Successful in 4s
Joomla: Repo Health / Release configuration (push) Has been cancelled
Joomla: Repo Health / Scripts governance (push) Has been cancelled
Joomla: Repo Health / Repository health (push) Has been cancelled
Joomla: Repo Health / Access control (push) Successful in 2s
Universal: Cascade Main → Dev / Cascade main → branches (push) Successful in 4s
Joomla: Repo Health / Release configuration (push) Has been cancelled
Joomla: Repo Health / Scripts governance (push) Has been cancelled
Joomla: Repo Health / Repository health (push) Has been cancelled
Add search/filter tools to tags list view, fix API content type naming, build proper frontend URLs for social debugger links, and auto-enable the content plugin on package install. Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -22,7 +22,7 @@ class TagsController extends ApiController
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $contentType = 'mokoogtags';
|
||||
protected $contentType = 'tags';
|
||||
|
||||
/**
|
||||
* The default view for the API.
|
||||
|
||||
@@ -39,6 +39,20 @@ class HtmlView extends BaseHtmlView
|
||||
*/
|
||||
protected $state;
|
||||
|
||||
/**
|
||||
* The filter form.
|
||||
*
|
||||
* @var \Joomla\CMS\Form\Form|null
|
||||
*/
|
||||
public $filterForm;
|
||||
|
||||
/**
|
||||
* The active filters.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $activeFilters = [];
|
||||
|
||||
/**
|
||||
* Display the view.
|
||||
*
|
||||
@@ -48,9 +62,11 @@ class HtmlView extends BaseHtmlView
|
||||
*/
|
||||
public function display($tpl = null): void
|
||||
{
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->items = $this->get('Items');
|
||||
$this->pagination = $this->get('Pagination');
|
||||
$this->state = $this->get('State');
|
||||
$this->filterForm = $this->get('FilterForm');
|
||||
$this->activeFilters = $this->get('ActiveFilters');
|
||||
|
||||
$this->addToolbar();
|
||||
|
||||
@@ -66,6 +82,7 @@ class HtmlView extends BaseHtmlView
|
||||
{
|
||||
ToolbarHelper::title(Text::_('COM_MOKOOG_TAGS_TITLE'), 'bookmark');
|
||||
ToolbarHelper::custom('batch.generate', 'refresh', '', 'COM_MOKOOG_TOOLBAR_BATCH_GENERATE', false);
|
||||
ToolbarHelper::custom('importexport.export', 'download', '', 'COM_MOKOOG_TOOLBAR_EXPORT', false);
|
||||
ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', 'tags.delete');
|
||||
ToolbarHelper::preferences('com_mokoog');
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ $token = Session::getFormToken();
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="j-main-container" class="j-main-container">
|
||||
<?php echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this]); ?>
|
||||
|
||||
<?php if (empty($this->items)) : ?>
|
||||
<div class="alert alert-info">
|
||||
@@ -121,8 +122,16 @@ $token = Session::getFormToken();
|
||||
</td>
|
||||
<td class="mokoog-debug-links">
|
||||
<?php
|
||||
// Build a placeholder URL for debugger links
|
||||
$debugUrl = Uri::root();
|
||||
// Build frontend URL for this content item
|
||||
if ($item->content_type === 'com_content') {
|
||||
$debugUrl = Uri::root() . 'index.php?option=com_content&view=article&id=' . (int) $item->content_id;
|
||||
} elseif ($item->content_type === 'menu') {
|
||||
$debugUrl = Uri::root() . 'index.php?Itemid=' . (int) $item->content_id;
|
||||
} elseif ($item->content_type === 'com_content.category') {
|
||||
$debugUrl = Uri::root() . 'index.php?option=com_content&view=category&id=' . (int) $item->content_id;
|
||||
} else {
|
||||
$debugUrl = Uri::root();
|
||||
}
|
||||
?>
|
||||
<a href="https://developers.facebook.com/tools/debug/?q=<?php echo urlencode($debugUrl); ?>" target="_blank" rel="noopener" title="Facebook Debugger" class="btn btn-sm btn-outline-primary">FB</a>
|
||||
<a href="https://www.linkedin.com/post-inspector/inspect/<?php echo urlencode($debugUrl); ?>" target="_blank" rel="noopener" title="LinkedIn Inspector" class="btn btn-sm btn-outline-info">LI</a>
|
||||
|
||||
@@ -74,6 +74,17 @@ class Pkg_MokoOGInstallerScript
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
|
||||
// Enable the content plugin automatically
|
||||
$query = $db->getQuery(true)
|
||||
->update($db->quoteName('#__extensions'))
|
||||
->set($db->quoteName('enabled') . ' = 1')
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
|
||||
->where($db->quoteName('folder') . ' = ' . $db->quote('content'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mokoog'));
|
||||
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
|
||||
// Enable the webservices plugin automatically
|
||||
$query = $db->getQuery(true)
|
||||
->update($db->quoteName('#__extensions'))
|
||||
|
||||
Reference in New Issue
Block a user