diff options
author | chris <chris@jalakai.co.uk> | 2006-04-25 00:01:52 +0200 |
---|---|---|
committer | chris <chris@jalakai.co.uk> | 2006-04-25 00:01:52 +0200 |
commit | 24bb549beb18a9d800b50cd5f4c305a15806fd0d (patch) | |
tree | e812352e3704b61b26d98209aa9776f7c9331d20 /inc/template.php | |
parent | 8a2d2176a45800e273168a511ca44f2b04b594a1 (diff) | |
download | rpg-24bb549beb18a9d800b50cd5f4c305a15806fd0d.tar.gz rpg-24bb549beb18a9d800b50cd5f4c305a15806fd0d.tar.bz2 |
event system revision
This is a major revision of DokuWiki's event system. There are changes to class names,
function names, function parameters and their order and event names.
For action plugin writers the following changes are important:
- <event_name> is no longer signalled, only <event_name>_BEFORE and <event_name>_AFTER.
- note the case change for _BEFORE and _AFTER
- calling stopPropagation while processing a _BEFORE signal no longer prevents an
_AFTER signal. The events _continue value is reset before the _AFTER signal is made.
- events have a new readonly property, canPreventDefault. This lets the event handling
hook know whether or not the event honours preventDefault calls.
- parameters have changed for the register_hook method, parameters are now
$event_name,
$advise (can be 'BEFORE' or 'AFTER')
$object
$method
$param (this parameter is now optional)
- parameter order has changed for the hook event handler callback functions
&$event
$param (can now be left off)
Event names have changed, they are now structured
<dokuwiki name>_<event data name>_<action_name or state if no action>
DOKUWIKI_START
darcs-hash:20060424220152-9b6ab-00e366288f7ec8a85b85dc83694a5f43a07aa082.gz
Diffstat (limited to 'inc/template.php')
-rw-r--r-- | inc/template.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/inc/template.php b/inc/template.php index 12e4969f0..68d506fdd 100644 --- a/inc/template.php +++ b/inc/template.php @@ -41,14 +41,11 @@ function tpl_content() { ob_start(); - $evt = new event('TPL_ACTION_HTML',$ACT,tpl_content_core); - $evt->trigger(); + trigger_event('TPL_ACT_RENDER',$ACT,tpl_content_core); $html_output = ob_get_clean(); - $evt = new event('TPL_DISPLAY_HTML',$html_output,ptln); - $evt->trigger(); - + trigger_event('TPL_CONTENT_DISPLAY',$html_output,ptln); } function tpl_content_core(){ @@ -124,9 +121,11 @@ function tpl_content_core(){ tpl_admin(); break; default: - $evt = new event('ACTION_TEMPLATE',$ACT); - if ($evt->advise()) + $evt = new Doku_Event('TPL_ACT_UNKNOWN',$ACT); + if ($evt->advise_before()) msg("Failed to handle command: ".hsc($ACT),-1); + $evt->advise_after(); + unset($evt); } } |