1<?php 2 3require_once __DIR__.'/lightmenu.class.php'; 4 5use dokuwiki\Extension\AdminPlugin; 6 7class admin_plugin_lightmenu extends AdminPlugin 8{ 9 public function getMenuText($language) 10 { 11 return 'Lightmenu'; 12 } 13 14 public function getMenuSort() 15 { 16 return 2048; 17 } 18 19 public function handle() 20 { 21 global $INPUT; 22 23 if (! $INPUT->has('rescan')) 24 return; 25 $this->output = 'invalid'; 26 if (! checkSecurityToken()) 27 return; 28 if (! is_string($INPUT->param('rescan'))) 29 return; 30 lightmenu::rescan(); 31 } 32 33 public function html() 34 { 35 global $ID; 36 37 printf('<h1>%s</h1>',$this->getLang('admin-title')); 38 printf('<form action="%s" method="post">'.PHP_EOL,wl($ID)); 39 echo '<input type="hidden" name="do" value="admin" />'.PHP_EOL; 40 printf('<input type="hidden" name="page" value="%s" />'.PHP_EOL,$this->getPluginName()); 41 formSecurityToken(); 42 printf('<p><button type="submit" name="rescan" value="true" />%s</button>'.PHP_EOL,$this->getLang('rescan')); 43 printf(' %s</p>'.PHP_EOL,$this->getLang('rescan-help')); 44 echo '</form>'.PHP_EOL; 45 } 46 47} 48 49