summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/tpl/default/main.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/tpl/default/main.php b/lib/tpl/default/main.php
index a63831ae4..b0034c7e3 100644
--- a/lib/tpl/default/main.php
+++ b/lib/tpl/default/main.php
@@ -13,6 +13,26 @@
* @link http://wiki.splitbrain.org/wiki:tpl:templates
* @author Andreas Gohr <andi@splitbrain.org>
*/
+
+/* event testing ...*/
+
+function hello($data) { print $data; return strrev($data); };
+function hook($param, &$event) {
+ print('this is a hook ['.$param.']');
+ switch ($param) {
+ case 'param1' : $event->preventDefault(); break;
+ case 'param2' : $event->stopPropagation(); break;
+ case 'param3' : print('action results['.$event->result.']');
+ }
+}
+
+global $EVENT_HANDLER;
+$EVENT_HANDLER->register_hook('TEMPLATE','BEFORE',$tmp=NULL,hook,'param2');
+$EVENT_HANDLER->register_hook('TEMPLATE','AFTER',$tmp=NULL,hook,'param3');
+
+trigger_event('TEMPLATE',$tmp2='hello!',hello);
+#*/
+
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang']?>"
lang="<?php echo $conf['lang']?>" dir="<?php echo $lang['direction']?>">