-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadmin.php
62 lines (45 loc) · 1.28 KB
/
admin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
// must be run within Dokuwiki
if (!defined('DOKU_INC')) die();
if (!defined('DOKU_LF')) define('DOKU_LF', "\n");
if (!defined('DOKU_TAB')) define('DOKU_TAB', "\t");
if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
require_once DOKU_PLUGIN . 'admin.php';
class admin_plugin_stale extends DokuWiki_Admin_Plugin
{
/**
* @var string
*/
private $msg;
public function getMenuSort()
{
return 13;
}
public function forAdminOnly()
{
return $this->getConf(helper_plugin_stale::CONF_ADMIN_ONLY);
}
public function getMenuIcon()
{
/** @var helper_plugin_stale $stale */
$stale = plugin_load('helper', 'stale');
return $stale->getIcon();
}
public function handle()
{
/** @var helper_plugin_stale $stale */
$stale = plugin_load('helper', 'stale');
$reason = $stale->canTouch();
if ($reason !== true) {
msg('Plugin stale: You can\'t touch the file for the following reason: ' . $reason, -1);
return false;
}
$this->msg = $stale->stale();
return true;
}
public function html()
{
ptln('<h1>' . $this->getLang('h1') . '</h1>');
ptln("<p>$this->msg</p>");
}
}