Skip to content

Commit

Permalink
Improvement - stale label is more clear and is now a website action
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardnico committed Aug 30, 2021
1 parent 0f59432 commit 0bb9055
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
5 changes: 3 additions & 2 deletions Menuitem.php
Expand Up @@ -11,7 +11,7 @@
* Implements the stale button
* https://www.dokuwiki.org/devel:menus:example
*/
class MenuItem extends AbstractItem
class StaleMenuItem extends AbstractItem
{


Expand Down Expand Up @@ -59,7 +59,8 @@ public function getTitle()

public function getLabel()
{
return ucfirst(helper_plugin_stale::PLUGIN_NAME);
$stale = plugin_load('helper', helper_plugin_stale::PLUGIN_NAME);
return $stale->getLang("menuItemLabel");
}


Expand Down
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -33,3 +33,10 @@ Based on the [dead plugin toucher](https://github.com/anandr/dokuwiki-plugin-tou

By adding `?do=check` to a page, you can also do a configuration check.

## Release

* 2021-08-30:
* The stale menu item is now a website item
* The action label is more clear and was added as language reference
* 2021-08-04:
* First release
2 changes: 1 addition & 1 deletion _test/baseTest.php
Expand Up @@ -146,7 +146,7 @@ public function test_plugin_default()

public function testMenuItem()
{
$menuItem = new \dokuwiki\plugin\stale\MenuItem();
$menuItem = new \dokuwiki\plugin\stale\StaleMenuItem();
$linkAttributes = $menuItem->getLinkAttributes();

}
Expand Down
4 changes: 2 additions & 2 deletions action.php
@@ -1,7 +1,7 @@
<?php

// must be run within Dokuwiki
use dokuwiki\plugin\stale\MenuItem;
use dokuwiki\plugin\stale\StaleMenuItem;

if (!defined('DOKU_INC')) die();

Expand Down Expand Up @@ -74,7 +74,7 @@ public function add_menu_item(Doku_Event $event, $param)
$stale = plugin_load('helper', 'stale');
if ($stale->canTouch()===true){

array_splice($event->data['items'], -1, 0, array(new MenuItem()));
array_splice($event->data['items'], -1, 0, array(new StaleMenuItem()));

}

Expand Down
3 changes: 2 additions & 1 deletion lang/en/lang.php
@@ -1,5 +1,6 @@
<?php

$lang['menu'] = 'Stale - make the cache stale';
$lang['menuItemLinkTitle'] = 'Stale - make the cache stale';
$lang['menuItemLabel'] = 'Stale the cache';
$lang['inprogress'] = '(touch pending)';

2 changes: 1 addition & 1 deletion lang/ja/lang.php
@@ -1,3 +1,3 @@
<?php

$lang['menu'] = '設定ファイルのタイムスタンプ更新';
$lang['menuItemLinkTitle'] = '設定ファイルのタイムスタンプ更新';
2 changes: 1 addition & 1 deletion plugin.info.txt
@@ -1,7 +1,7 @@
base stale
author ComboStrap
email support@combostrap.com
date 2021-08-04
date 2021-08-30
name Stale plugin
desc Make the cache stale by by touching configuration files
url https://www.dokuwiki.org/plugin:stale

0 comments on commit 0bb9055

Please sign in to comment.