*/ // based on http://wiki.splitbrain.org/plugin:tutorial // 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.'syntax.php'); /** * All DokuWiki plugins to extend the parser/rendering mechanism * need to inherit from this class */ class syntax_plugin_lhd extends DokuWiki_Syntax_Plugin { const lhd_path = '/foo/bar/'; const lhd_url = 'http://www.foo.com/'; function getInfo() { return array( 'author' => 'Carlo Perassi', 'email' => 'carlo@NOSPAM.perassi.org', 'date' => '2007-05-10', 'name' => 'lhd (List Hardwired Directory) Plugin', 'desc' => 'It lists the directories of a hardwired directory - 0.1', 'url' => 'http://perassi.org/2007/05/10/a-dokuwiki-directory-lister-plugin/' ); } private function _listhd() { $lhdout = "\n"; return $lhdout; } function connectTo($mode) { $this->Lexer->addSpecialPattern('\[LHD\]', $mode, 'plugin_lhd'); } function getType() { return 'substition'; } function getSort() { return 667; } function handle($match, $state, $pos, &$handler) { return array($match, $state, $pos); } function render($mode, &$renderer, $data) { if ($mode == 'xhtml') { $renderer->doc .= $this->_listhd(); return true; } return false; } } ?>