Skip to content
Snippets Groups Projects
Commit 7ea0913c authored by chris's avatar chris
Browse files

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
parent f63a2007
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment