diff options
author | chris <chris@jalakai.co.uk> | 2007-01-25 15:41:03 +0100 |
---|---|---|
committer | chris <chris@jalakai.co.uk> | 2007-01-25 15:41:03 +0100 |
commit | 04ebd2145bc2b2c00d7912b1ab0fc6b8808c6bf1 (patch) | |
tree | 422029f499a43a5b2ba2958ad1bdc2cd831f44da /inc/parser | |
parent | 26b657a1a40c6eb68443bac86ef032a3c4b05fc5 (diff) | |
download | rpg-04ebd2145bc2b2c00d7912b1ab0fc6b8808c6bf1.tar.gz rpg-04ebd2145bc2b2c00d7912b1ab0fc6b8808c6bf1.tar.bz2 |
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
Diffstat (limited to 'inc/parser')
-rw-r--r-- | inc/parser/handler.php | 7 |
1 files changed, 6 insertions, 1 deletions
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; } |