summaryrefslogtreecommitdiff
path: root/inc/parser
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-07-30 23:51:56 +0200
committerAndreas Gohr <andi@splitbrain.org>2005-07-30 23:51:56 +0200
commita46d0d658b98649869f6c9660e168af3940d7c30 (patch)
tree31bd3d6bd347602ae1e632be3c03b50b284a562d /inc/parser
parent1e694c4cf2863c5f7211a2e888f79249c9383696 (diff)
downloadrpg-a46d0d658b98649869f6c9660e168af3940d7c30.tar.gz
rpg-a46d0d658b98649869f6c9660e168af3940d7c30.tar.bz2
Changed pluginloading to use references
This patch allows the use of $this in syntax plugins to set internal variables and let them remain between handle and render calls. Even when it is possible now to use this method you should exchange data betwenn handler and render calls by using the $data array only. darcs-hash:20050730215156-7ad00-69ea79859360d9902533633395de3e1b677f6e46.gz
Diffstat (limited to 'inc/parser')
-rw-r--r--inc/parser/handler.php4
-rw-r--r--inc/parser/xhtml.php4
2 files changed, 4 insertions, 4 deletions
diff --git a/inc/parser/handler.php b/inc/parser/handler.php
index ded291356..55cbcf342 100644
--- a/inc/parser/handler.php
+++ b/inc/parser/handler.php
@@ -66,8 +66,8 @@ class Doku_Handler {
*/
function plugin($match, $state, $pos, $pluginname){
$data = array($match);
- $plugin = null;
- if(plugin_load('syntax',$pluginname,$plugin)){
+ $plugin =& plugin_load('syntax',$pluginname);
+ if($plugin != null){
$data = $plugin->handle($match, $state, $pos, $this);
}
$this->_addCall('plugin',array($pluginname,$data,$pos),$pos);
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index 2fd5844d0..7dd1b8034 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -86,8 +86,8 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
//handles plugin rendering
function plugin($name,$data){
- $plugin = null;
- if(plugin_load('syntax',$name,$plugin)){
+ $plugin =& plugin_load('syntax',$name);
+ if($plugin != null){
$plugin->render('xhtml',$this,$data);
}
}