summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchris <chris@teacherscpd.co.uk>2005-08-13 20:22:13 +0200
committerchris <chris@teacherscpd.co.uk>2005-08-13 20:22:13 +0200
commit61faf4466526c4037ec61bf094880c8fe660eb3c (patch)
treec385f14789c334d640b4353ed1298768afc5f99a
parent936c8c1b954e799bccdfc3ff23a931dab7c6d50b (diff)
downloadrpg-61faf4466526c4037ec61bf094880c8fe660eb3c.tar.gz
rpg-61faf4466526c4037ec61bf094880c8fe660eb3c.tar.bz2
renderer update, move plugin() method from xhtml to renderer
darcs-hash:20050813182213-50fdc-e1d2529944785b0e39bbd58a184c12d120ff1149.gz
-rw-r--r--inc/parser/renderer.php21
-rw-r--r--inc/parser/xhtml.php9
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 @@
<?php
+/**
+ * Renderer for XHTML output
+ *
+ * @author Harry Fuecks <hfuecks@gmail.com>
+ * @author Andreas Gohr <andi@splitbrain.org>
+ */
+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>"
+ $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 .= '<div class="toc">'.DOKU_LF;