1872edc7cSRené Corinth<?php 2872edc7cSRené Corinth// must be run within Dokuwiki 30cfde7e9SMichael Großeif (!defined('DOKU_INC')) { 40cfde7e9SMichael Große die(); 50cfde7e9SMichael Große} 6872edc7cSRené Corinth 7872edc7cSRené Corinthclass admin_plugin_tagging extends DokuWiki_Admin_Plugin { 8872edc7cSRené Corinth 98a1a3846SAndreas Gohr /** @var helper_plugin_tagging */ 10872edc7cSRené Corinth private $hlp; 11872edc7cSRené Corinth 128a1a3846SAndreas Gohr public function __construct() { 13872edc7cSRené Corinth $this->hlp = plugin_load('helper', 'tagging'); 148a1a3846SAndreas Gohr } 15872edc7cSRené Corinth 168a1a3846SAndreas Gohr /** 178a1a3846SAndreas Gohr * We allow use by managers 188a1a3846SAndreas Gohr * 198a1a3846SAndreas Gohr * @return bool always false 208a1a3846SAndreas Gohr */ 218a1a3846SAndreas Gohr function forAdminOnly() { 228a1a3846SAndreas Gohr return false; 238a1a3846SAndreas Gohr } 248a1a3846SAndreas Gohr 258a1a3846SAndreas Gohr /** 2631396860SSzymon Olewniczak * Handle tag actions 278a1a3846SAndreas Gohr */ 288a1a3846SAndreas Gohr function handle() { 29*ec4796e4SAnna Dabrowska 30*ec4796e4SAnna Dabrowska if (!empty($_REQUEST['cmd']['clean'])) { 31*ec4796e4SAnna Dabrowska $this->hlp->deleteInvalidTaggings(); 32*ec4796e4SAnna Dabrowska } 33*ec4796e4SAnna Dabrowska 34f6568bcbSAnna Dabrowska if (!$this->hlp->getParams()) { 35f6568bcbSAnna Dabrowska $this->hlp->setDefaultSort(); 36ca455b8eSMichael Große return false; 37ca455b8eSMichael Große } 38f6568bcbSAnna Dabrowska 39f6568bcbSAnna Dabrowska $this->hlp->setDefaultSort(); 40f6568bcbSAnna Dabrowska 41ca455b8eSMichael Große if (!checkSecurityToken()) { 42ca455b8eSMichael Große return false; 43ca455b8eSMichael Große } 44872edc7cSRené Corinth } 45872edc7cSRené Corinth 468a1a3846SAndreas Gohr /** 478a1a3846SAndreas Gohr * Draw the interface 488a1a3846SAndreas Gohr */ 4989ed97adSAnna Dabrowska public function html() { 508a1a3846SAndreas Gohr echo $this->locale_xhtml('intro'); 5189ed97adSAnna Dabrowska echo $this->hlp->html_table(); 52*ec4796e4SAnna Dabrowska echo $this->locale_xhtml('clean'); 53*ec4796e4SAnna Dabrowska echo $this->hlp->html_clean(); 548f630140SSzymon Olewniczak } 55872edc7cSRené Corinth} 56