*/ // must be run within Dokuwiki if(!defined('DOKU_INC')) die(); /** * All DokuWiki plugins to extend the admin function * need to inherit from this class */ class DokuWiki_Admin_Plugin extends DokuWiki_Plugin { /** * Return the text that is displayed at the main admin menu * (Default localized language string 'menu' is returned, override this function for setting another name) * * @param string $language language code * @return string menu string */ public function getMenuText($language) { $menutext = $this->getLang('menu'); if (!$menutext) { $info = $this->getInfo(); $menutext = $info['name'].' ...'; } return $menutext; } /** * Return the path to the icon being displayed in the main admin menu. * Default means, there won't be any icon. * (Override this function for setting another image) * * CAUTION: * Only svg-files are allowed * */ public function getMenuIcon(){ return ''; } /** * Return the path to the icon being displayed in the main admin menu. * In case of file mime-type not being SVG, an empty string will be returned. * @return string menu icon url or empty */ public function getMenuIconSvgOnly(){ $returnValue = ''; if(strlen($this->getMenuIcon()) != '' && is_file(DOKU_INC.substr($this->getMenuIcon(), strlen(DOKU_BASE)))){ $calculated = mimetype(DOKU_INC.substr($this->getMenuIcon(), strlen(DOKU_BASE)), false); if(is_array($calculated) && $calculated[0] == 'svg') { $returnValue = $this->getMenuIcon(); } } return $returnValue; } /** * Determine position in list in admin window * Lower values are sorted up * * @return int */ public function getMenuSort() { return 1000; } /** * Carry out required processing */ public function handle() { trigger_error('handle() not implemented in '.get_class($this), E_USER_WARNING); } /** * Output html of the admin page */ public function html() { trigger_error('html() not implemented in '.get_class($this), E_USER_WARNING); } /** * Return true for access only by admins (config:superuser) or false if managers are allowed as well * * @return bool */ public function forAdminOnly() { return true; } /** * Return array with ToC items. Items can be created with the html_mktocitem() * * @see html_mktocitem() * @see tpl_toc() * * @return array */ public function getTOC(){ return array(); } } //Setup VIM: ex: et ts=4 :