xref: /dokuwiki/lib/plugins/admin.php (revision 7c3df9b4f9d2f084b649907bf1f6c3a71454cf9d)
1<?php
2/**
3 * Admin Plugin Prototype
4 *
5 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author     Christopher Smith <chris@jalakai.co.uk>
7 */
8// must be run within Dokuwiki
9if(!defined('DOKU_INC')) die();
10
11/**
12 * All DokuWiki plugins to extend the admin function
13 * need to inherit from this class
14 */
15class DokuWiki_Admin_Plugin extends DokuWiki_Plugin {
16
17    /**
18     * @param string $language language code
19     * @return string
20     */
21    function getMenuText($language) {
22        $menutext = $this->getLang('menu');
23        if (!$menutext) {
24            $info = $this->getInfo();
25            $menutext = $info['name'].' ...';
26        }
27        return $menutext;
28    }
29
30    /**
31     * @return int
32     */
33    function getMenuSort() {
34        return 1000;
35    }
36
37
38    function handle() {
39        trigger_error('handle() not implemented in '.get_class($this), E_USER_WARNING);
40    }
41
42    function html() {
43        trigger_error('html() not implemented in '.get_class($this), E_USER_WARNING);
44    }
45
46    /**
47     * @return bool
48     */
49    function forAdminOnly() {
50        return true;
51    }
52
53    /**
54     * @return array
55     */
56    function getTOC(){
57        return array();
58    }
59}
60//Setup VIM: ex: et ts=4 :
61