diff options
author | chris <chris@jalakai.co.uk> | 2006-04-15 18:02:10 +0200 |
---|---|---|
committer | chris <chris@jalakai.co.uk> | 2006-04-15 18:02:10 +0200 |
commit | f63a2007b99e30879164f7e1f40859a4a06f1471 (patch) | |
tree | f5ea966c4d7ca8429d188deda4f14a20f460dc79 | |
parent | a4b5ae12aa2904f2bb8db8e78649acb4c382ba8a (diff) | |
download | rpg-f63a2007b99e30879164f7e1f40859a4a06f1471.tar.gz rpg-f63a2007b99e30879164f7e1f40859a4a06f1471.tar.bz2 |
event SEND_HEADERS
Event data an array of headers dokuwiki will send[1].
The default action is to output all the headers in order using the header() function.
This event is a full trigger, meaning there are three advises:
- SEND_HEADERS_before
- SEND_HEADERS
- SEND_HEADERS_after
Handlers of this event can add/modify/delete the headers in the event data. The event
data must remain an array, even if emptied.
[1] There is one dokuwiki header 'Content-Type: text/html; charset
darcs-hash:20060415160210-9b6ab-841bd034b797c7f1b8d4bbc66f90185a16e5a043.gz
-rw-r--r-- | inc/actions.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/inc/actions.php b/inc/actions.php index d585ccace..8218dd8a6 100644 --- a/inc/actions.php +++ b/inc/actions.php @@ -107,12 +107,19 @@ function act_dispatch(){ } //call template FIXME: all needed vars available? - header('Content-Type: text/html; charset=utf-8'); + $headers[] = 'Content-Type: text/html; charset=utf-8'; + $evt = new event('SEND_HEADERS',$headers,act_sendheaders); + $evt->trigger(); + include(template('main.php')); // output for the commands is now handled in inc/templates.php // in function tpl_content() } +function act_sendheaders($headers) { + foreach ($headers as $hdr) header($hdr); +} + /** * Sanitize the action command * |