Add cache inclalidation for Chronological
This commit is contained in:
43
src/MenuItem/InvalidateCache.php
Normal file
43
src/MenuItem/InvalidateCache.php
Normal 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';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user