fix: cache module uses split button layout "Clear: Cache | Temp"

Single header item with two clickable halves instead of two separate
status bar entries.

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Miller
2026-06-06 07:32:19 -05:00
parent 8d4a5b7a04
commit 1fe19fe5f1
@@ -1,38 +1,38 @@
<?php
/**
* MokoWaaS Cache & Temp Cleaner — status bar module
* MokoWaaS Cache & Temp Cleaner — status bar split button
*
* One-click buttons in the admin status bar for clearing cache and temp.
* Uses native Atum header-item markup.
* Displays "Clear: Cache | Temp" as a single header item with two
* clickable halves. Uses native Atum header-item markup.
*/
defined('_JEXEC') or die;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Language\Text;
$token = Session::getFormToken();
$cacheUrl = 'index.php?option=com_mokowaas&task=clearCache&format=json';
$tempUrl = 'index.php?option=com_mokowaas&task=clearTemp&format=json';
?>
<a href="#" class="header-item-content" title="<?php echo Text::_('MOD_MOKOWAAS_CACHE_CLEAR_ALL'); ?>" id="mokowaas-clear-cache">
<div class="header-item-icon">
<span class="icon-bolt" aria-hidden="true" id="mokowaas-cache-icon"></span>
</div>
<div class="header-item-text">
<?php echo Text::_('MOD_MOKOWAAS_CACHE'); ?>
</div>
</a>
<style>
.mokowaas-cleaner { display:flex; align-items:center; gap:0; padding:0 0.25rem; }
.mokowaas-cleaner-label { font-size:0.8rem; color:var(--template-text-dark,#495057); white-space:nowrap; padding-inline-end:0.35rem; }
.mokowaas-cleaner-btn { cursor:pointer; padding:0.2rem 0.5rem; font-size:0.8rem; border-radius:3px; text-decoration:none; color:var(--template-text-dark,#495057); transition:background 0.15s; white-space:nowrap; }
.mokowaas-cleaner-btn:hover { background:rgba(0,0,0,0.08); color:var(--template-text-dark,#212529); text-decoration:none; }
.mokowaas-cleaner-sep { color:var(--template-text-dark,#adb5bd); padding:0 0.1rem; font-size:0.8rem; }
</style>
<a href="#" class="header-item-content" title="<?php echo Text::_('MOD_MOKOWAAS_CACHE_CLEAR_TEMP'); ?>" id="mokowaas-clear-temp">
<div class="header-item-icon">
<span class="icon-trash" aria-hidden="true" id="mokowaas-temp-icon"></span>
</div>
<div class="header-item-text">
<?php echo Text::_('MOD_MOKOWAAS_CACHE_CLEAR_TEMP'); ?>
</div>
</a>
<div class="header-item-content mokowaas-cleaner">
<span class="mokowaas-cleaner-label">Clear:</span>
<a href="#" class="mokowaas-cleaner-btn" id="mokowaas-clear-cache" title="Clear all Joomla cache">
<span class="icon-bolt" aria-hidden="true" id="mokowaas-cache-icon"></span> Cache
</a>
<span class="mokowaas-cleaner-sep">|</span>
<a href="#" class="mokowaas-cleaner-btn" id="mokowaas-clear-temp" title="Clear temp directory">
<span class="icon-trash" aria-hidden="true" id="mokowaas-temp-icon"></span> Temp
</a>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {