Add cache inclalidation for Chronological

This commit is contained in:
2026-02-17 10:57:50 +01:00
parent 6ff7f2b45b
commit b2600485c4
8 changed files with 254 additions and 16 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace dokuwiki\plugin\luxtools\MenuItem;
use dokuwiki\Menu\Item\AbstractItem;
class InvalidateCache extends AbstractItem
{
/**
* @param string $label
* @param string $title
*/
public function __construct(string $label, string $title)
{
global $ID;
$this->id = is_string($ID) ? $ID : '';
$this->type = 'show';
$this->method = 'get';
$this->params = [
'do' => 'show',
'luxtools_invalidate_cache' => 1,
];
$this->nofollow = true;
$this->label = $label;
$this->title = $title;
$this->svg = DOKU_INC . 'lib/images/menu/calendar-clock.svg';
if (function_exists('getSecurityToken')) {
$this->params['sectok'] = getSecurityToken();
}
}
/**
* Keep a distinct class hook for template styling.
*
* @return string
*/
public function getType()
{
return 'luxtools-invalidate-cache';
}
}