diff options
author | chris <chris@jalakai.co.uk> | 2006-04-15 18:08:47 +0200 |
---|---|---|
committer | chris <chris@jalakai.co.uk> | 2006-04-15 18:08:47 +0200 |
commit | 7ea0913c940324ef33e9b89d2468bde5d84da2e4 (patch) | |
tree | e00384cc3468dfb7c86a50076ef2fa026d205bcf | |
parent | f63a2007b99e30879164f7e1f40859a4a06f1471 (diff) | |
download | rpg-7ea0913c940324ef33e9b89d2468bde5d84da2e4.tar.gz rpg-7ea0913c940324ef33e9b89d2468bde5d84da2e4.tar.bz2 |
events TPL_ACTION_HTML & TPL_DISPLAY_HTML
event TPL_ACTION_HTML
data $ACT
action tpl_content_core (formerly tpl_content)
This event is a wrapper for tpl_content() (now tpl_content_core()) and as such is a
full trigger, meaning it issues three advises:
- TPL_ACTION_HTML_before
- TPL_ACTION_HTML
- TPL_ACTION_HTML_after
Event handlers can output HTML before and/or after the main Dokuwiki page output and
can prevent the default dokuwiki page generation taking place.
Example uses could include:
- replacements for dokuwiki command handlers like index.
- appending a discussion section to the page by handling TPL_ACTION_HTML_after
event TPL_DISPLAY_HTML
data html output produced by tpl_content_core[1]
action send output to browser
Event handlers can post process the HTML output before it is sent to the client
browser. This is a full trigger, meaning it issues three advises
- TPL_DISPLAY_HTML_before
- TPL_DISPLAY_HTML
- TPL_DISPLAY_HTML_after
darcs-hash:20060415160847-9b6ab-d7affcb1aaf49aecfaf9bc1e78a82ceb8ae409f7.gz
-rw-r--r-- | inc/template.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/inc/template.php b/inc/template.php index 4383c7a6b..5e98526ff 100644 --- a/inc/template.php +++ b/inc/template.php @@ -36,7 +36,22 @@ function template($tpl){ * * @author Andreas Gohr <andi@splitbrain.org> */ -function tpl_content(){ +function tpl_content() { + global $ACT; + + ob_start(); + + $evt = new event('TPL_ACTION_HTML',$ACT,tpl_content_core); + $evt->trigger(); + + $html_output = ob_get_clean(); + + $evt = new event('TPL_DISPLAY_HTML',$html_output,ptln); + $evt->trigger(); + +} + +function tpl_content_core(){ global $ACT; global $TEXT; global $PRE; |