From 61faf4466526c4037ec61bf094880c8fe660eb3c Mon Sep 17 00:00:00 2001 From: chris Date: Sat, 13 Aug 2005 20:22:13 +0200 Subject: renderer update, move plugin() method from xhtml to renderer darcs-hash:20050813182213-50fdc-e1d2529944785b0e39bbd58a184c12d120ff1149.gz --- inc/parser/renderer.php | 21 +++++++++++++++++++++ inc/parser/xhtml.php | 9 --------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php index 89b28f248..43f071b32 100644 --- a/inc/parser/renderer.php +++ b/inc/parser/renderer.php @@ -1,4 +1,15 @@ + * @author Andreas Gohr + */ +if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); + +require_once DOKU_INC . 'inc/parser/renderer.php'; +require_once DOKU_INC . 'inc/pluginutils.php'; + class Doku_Renderer { var $info = array( 'cache' => TRUE, // may the rendered result cached? @@ -9,6 +20,16 @@ class Doku_Renderer { $this->info['cache'] = FALSE; } + //handle plugin rendering + function plugin($name,$data){ + $plugin =& plugin_load('syntax',$name); + if($plugin != null){ + // determine mode from renderer class name - format = "Doku_Renderer_" + $mode = substr(get_class($this), 14); + $plugin->render($mode,$this,$data); + } + } + function document_start() {} function document_end() {} diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 7dd1b8034..181562b2a 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -19,7 +19,6 @@ if ( !defined('DOKU_TAB') ) { } require_once DOKU_INC . 'inc/parser/renderer.php'; -require_once DOKU_INC . 'inc/pluginutils.php'; /** * The Renderer @@ -84,14 +83,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } } - //handles plugin rendering - function plugin($name,$data){ - $plugin =& plugin_load('syntax',$name); - if($plugin != null){ - $plugin->render('xhtml',$this,$data); - } - } - function toc_open() { global $lang; $this->doc .= '
'.DOKU_LF; -- cgit v1.2.3