From 04ebd2145bc2b2c00d7912b1ab0fc6b8808c6bf1 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 25 Jan 2007 15:41:03 +0100 Subject: create an addPluginCall() method for the handler refactor plugin() method to use new function this provides an interface for plugins to write their own instructions directly when returning a single instruction is not sufficient and saves plugin authors from hacking the handler's calls stack darcs-hash:20070125144103-9b6ab-3df781ec7fd1c4e75ac198139581cd2759c91052.gz --- inc/parser/handler.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/parser/handler.php b/inc/parser/handler.php index 01abf5876..d8e6c79ea 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -27,6 +27,11 @@ class Doku_Handler { $this->CallWriter->writeCall($call); } + function addPluginCall($plugin, $args, $state, $pos) { + $call = array('plugin',array($plugin, $args, $state), $pos); + $this->CallWriter->writeCall($call); + } + function _finalize(){ $this->CallWriter->finalise(); @@ -75,7 +80,7 @@ class Doku_Handler { if($plugin != null){ $data = $plugin->handle($match, $state, $pos, $this); } - $this->_addCall('plugin',array($pluginname,$data,$state),$pos); + $this->addPluginCall($pluginname,$data,$state,$pos); return true; } -- cgit v1.2.3