*/ // 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_bez_nav extends DokuWiki_Syntax_Plugin { function getPType() { return 'block'; } function getType() { return 'substition'; } function getSort() { return 99; } function connectTo($mode) { $this->Lexer->addSpecialPattern('~~BEZNAV~~',$mode,'plugin_bez_nav'); } function handle($match, $state, $pos, &$handler) { return true; } function render($mode, &$R, $pass) { global $INFO; $helper = $this->loadHelper('bez'); if ($mode != 'xhtml' || !$helper->user_viewer()) return false; $R->info['cache'] = false; $data = array( 'bez:start' => array('id' => 'bez:start', 'type' => 'd', 'level' => 1, 'title' => 'bez'), 'bez:issues' => array('id' => 'bez:issues', 'type' => 'f', 'level' => 2, 'title' => 'bds_issues'), ); if ($helper->user_editor()) $data['bez:issue_report'] = array('id' => 'bez:issue_report', 'type' => 'f', 'level' => 2, 'title' => 'bds_issue_report'); if ($helper->user_admin()) $data['bez:entity'] = array('id' => 'bez:entity', 'type' => 'f', 'level' => 2, 'title' => 'entity_manage'); $id = $INFO['id']; $ex = explode(':', $id); $root = $ex[0]; if ($root == 'bez') { $data['bez:start']['open'] = true; } else { $data['bez:start']['open'] = false; array_splice($data, 1); } $R->doc .= '