xref: /plugin/tagging/admin.php (revision 872edc7c1b32bb32232f134b139fef365b1e3ad1)
1<?php
2// must be run within Dokuwiki
3if (!defined('DOKU_INC')) die();
4
5class admin_plugin_tagging extends DokuWiki_Admin_Plugin {
6
7    private $hlp;
8    var $message;
9
10    function forAdminOnly() { return false; }
11
12    function handle() {
13        $this->hlp = plugin_load('helper', 'tagging');
14
15        if ($_SERVER['REQUEST_METHOD'] === 'POST') {
16            if (checkSecurityToken()) {
17                if (isset($_POST['action']['rename'])) {
18                    $this->message = $this->hlp->renameTag($_POST['action']['formerTagName'], $_POST['action']['newTagName']);
19                }
20            }
21        }
22    }
23
24    function html() {
25        global $ID;
26        $tags = $this->hlp->getAllTags();
27        include dirname(__FILE__) . '/admin_tpl.php';
28    }
29
30}