* @author Frank Schiebel */ // must be run within Dokuwiki if(!defined('DOKU_INC')) die(); if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once(DOKU_PLUGIN.'admin.php'); /** * All DokuWiki plugins to extend the admin function * need to inherit from this class */ class admin_plugin_shorturl extends DokuWiki_Admin_Plugin { /** * Access for managers allowed */ function forAdminOnly(){ return false; } /** * return sort order for position in admin menu */ function getMenuSort() { return 140; } /** * return prompt for admin menu */ function getMenuText($language) { return $this->getLang('name'); } /** * handle user request */ function handle() { if($_POST['redirdata']){ if(io_saveFile($this->getsavedir().'/shorturl.conf',$_POST['redirdata'])){ msg($this->getLang('saved'),1); } } } /** * output appropriate html */ function html() { global $lang; echo $this->locale_xhtml('intro'); echo '
'; echo ''; echo ''; echo '
'; echo ''; echo '
'; } /** * get savedir */ function getsavedir() { global $conf; if ( $this->getConf('saveconftocachedir') ) { return rtrim($conf['savedir'],"/") . "/cache"; } else { return dirname(__FILE__); } } } //Setup VIM: ex: et ts=4 enc=utf-8 :