*/ // must be run within Dokuwiki if (!defined('DOKU_INC')) die(); if (!defined('DOKU_LF')) define('DOKU_LF', "\n"); if (!defined('DOKU_TAB')) define('DOKU_TAB', "\t"); if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once DOKU_PLUGIN.'admin.php'; class admin_plugin_codebutton2 extends DokuWiki_Admin_Plugin { function getInfo(){ return array( 'author' => 'Reshetnikov Anton', 'email' => 'resheto@gmail.com', 'date' => '2010-12-11', 'name' => 'CodeButton2', 'desc' => 'A plugin for adding code buttons', 'url' => 'http://www.dokuwiki.org/plugin:codebutton2', ); } function forAdminOnly() { return true; } function handle() { global $config_cascade; if (isset($_REQUEST['config'])) { $fh = fopen(DOKU_PLUGIN."codebutton2/config.ini", 'w'); if($fh) { fwrite($fh, $_REQUEST["config"]); } fclose($fh); @touch(reset($config_cascade['main']['local'])); } } function html() { global $ID; ptln('

CodeButtons2 Configurations

'); ptln('
Add your code buttons in CODE block of your edit toolbar the following format:
<button name> = <geshi code name>
Example:
.bat=winbatch
'); ptln('It will produce button with name ".bat". Push on this button surround your selected text with <code winbatch> </code>
'); ptln('
'); ptln(''); ptln(''); ptln(''); ptln(''); ptln('
'); } } // vim:ts=4:sw=4:et:enc=utf-8: