xref: /plugin/tagging/admin.php (revision f6568bcb2c284d456e3affc634a0c2d7155c6f8d)
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*f6568bcbSAnna Dabrowska        if (!$this->hlp->getParams()) {
30*f6568bcbSAnna Dabrowska            $this->hlp->setDefaultSort();
31ca455b8eSMichael Große            return false;
32ca455b8eSMichael Große        }
33*f6568bcbSAnna Dabrowska
34*f6568bcbSAnna Dabrowska        $this->hlp->setDefaultSort();
35*f6568bcbSAnna Dabrowska
36ca455b8eSMichael Große        if (!checkSecurityToken()) {
37ca455b8eSMichael Große            return false;
38ca455b8eSMichael Große        }
39872edc7cSRené Corinth    }
40872edc7cSRené Corinth
418a1a3846SAndreas Gohr    /**
428a1a3846SAndreas Gohr     * Draw the interface
438a1a3846SAndreas Gohr     */
4489ed97adSAnna Dabrowska    public function html() {
458a1a3846SAndreas Gohr        echo $this->locale_xhtml('intro');
4689ed97adSAnna Dabrowska        echo $this->hlp->html_table();
478f630140SSzymon Olewniczak    }
48872edc7cSRené Corinth}
49