*/
if(!defined('DOKU_INC')) die();
if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
require_once(DOKU_PLUGIN.'action.php');
/**
* All DokuWiki plugins to extend the parser/rendering mechanism
* need to inherit from this class
*/
class action_plugin_dwqstat extends DokuWiki_Action_Plugin {
/**
* Get an associative array with plugin info.
*
*
* The returned array holds the following fields:
*
* - author
- Author of the plugin
* - email
- Email address to contact the author
* - date
- Last modified date of the plugin in
* YYYY-MM-DD format
* - name
- Name of the plugin
* - desc
- Short description of the plugin (Text only)
* - url
- Website with more information on the plugin
* (eg. syntax description)
*
* @param none
* @return Array Information about this plugin class.
* @public
* @static
*/
function getInfo(){
return array(
'author' => 'Mathieu',
'email' => 'mathieu@guim.info',
'date' => rtrim(io_readFile(DOKU_PLUGIN.'dwqstat/VERSION.txt')),
'name' => 'DWQstat Plugin for openarena.tuxfamily.org',
'desc' => 'Provide informations about a Quake3 (or compatible) server',
'url' => 'http://www.guim.info/dokuwiki/dev:qstat',
);
}
/*
* plugin should use this method to register its handlers with the dokuwiki's event controller
*/
function register(&$controller) {
$controller->register_hook('PARSER_CACHE_USE', 'BEFORE', $this, '_purgecache');
}
/**
* Check for pages changes and eventually purge cache.
*/
function _purgecache(&$event, $param) {
global $ID;
$str = rawWiki($ID);
if (strpos($str, '{{qstat') !== false) {
$event->preventDefault();
$event->stopPropagation();
$event->result = false;
}
}
}
?>