setupLocale(); } /** * return some info */ function getInfo() { $parts = explode('_',get_class($this)); $file = DOKU_PLUGIN.'/'.$parts[2].'/plugin.info.txt'; $info = array(); if(!@file_exists($file)) { trigger_error('getInfo() not implemented in '.get_class($this).' and '.$info.' not found', E_USER_WARNING); } else { $info= confToHash($file); $lang= explode(',', $info['lang']); if (in_array('desc', $lang) && ''!==$this->getLang('plugininfo_desc')) $info['desc']= $this->getLang('plugininfo_desc'); } return $info; } /** * return prompt for admin menu */ function getMenuText($language) { if (!$this->disabled) return parent::getMenuText($language); return ''; } /** * return sort order for position in admin menu */ function getMenuSort() { return 4129; } /** * handle user request */ function handle() { } /** * output appropriate html */ function html() { global $lang; global $conf; print "

".$this->getLang('abbr_title')."

"; print $this->getLang('abbr_text'); print "

"; if (isset($_POST['saver']) && $_POST['saver']==1) { $ok=true; $ok = $ok & $this->writeFile(ABBR_CONF, $_POST['abbr']); if ($ok) { print "
"; print ""; } else { msg("".$this->getLang('abbr_error')."",-1); print "
"; } } print "
"; print ""; print "

".$this->getLang('abbr_list')."

"; print ""; print "

"; print "getLang('abbr_save')."\" title=\"".$this->getLang('abbr_save')." [S]\" accesskey=\"s\" />"; print "
"; } function writeFile($filename,$chaine) { //if (is_writable($filename)) { if (is_writable( $filename ) || (is_writable(dirname( $filename ).'/.') && !file_exists( $filename ))) { if (!$handle = fopen($filename, 'w')) { msg($this->getLang('abbr_err_open')." ($filename).",-1); return false; } if (fwrite($handle, $chaine) === FALSE) { msg($this->getLang('abbr_err_write')." ($filename).",-1); return false; } fclose($handle); return true; } else { msg($this->getLang('abbr_err_secure')." ($filename).",-1); return false; } } } // vim:ts=4:sw=4:et:enc=utf-8: