setupLocale(); } /** * return some info */ function getInfo() { return array( 'author' => 'Etienne M.', 'email' => 'emauvaisfr@yahoo.fr', 'date' => @file_get_contents(DOKU_PLUGIN.'message/VERSION'), 'name' => 'message Plugin', 'desc' => 'Gestion des messages / Messages administration', 'url' => 'http://www.dokuwiki.org/plugin:message', ); } /** * 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 5000; } /** * handle user request */ function handle() { } /** * output appropriate html */ function html() { global $lang; global $conf; print "

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

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

"; if (isset($_POST['sauver']) && $_POST['sauver']==1) { $ok=true; $ok = $ok & $this->ecritFichier($conf['cachedir'].'/message_error.txt', $_POST['err']); $ok = $ok & $this->ecritFichier($conf['cachedir'].'/message_info.txt', $_POST['info']); $ok = $ok & $this->ecritFichier($conf['cachedir'].'/message_valid.txt', $_POST['valid']); $ok = $ok & $this->ecritFichier($conf['cachedir'].'/message_remind.txt', $_POST['rappel']); if ($ok) { print "
"; print ""; } else { msg("".$this->getLang('mess_erreurs')."",-1); print "
"; } } print "
"; print ""; msg($this->getLang('mess_err'),-1); $file=$conf['cachedir'].'/message_error.txt'; print ""; print "

"; msg($this->getLang('mess_info'),0); $file=$conf['cachedir'].'/message_info.txt'; print ""; print "

"; msg($this->getLang('mess_ok'),1); $file=$conf['cachedir'].'/message_valid.txt'; print ""; print "

"; msg($this->getLang('mess_rappel'),2); $file=$conf['cachedir'].'/message_remind.txt'; print ""; print "

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