diff options
Diffstat (limited to 'inc/template.php')
-rw-r--r-- | inc/template.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/inc/template.php b/inc/template.php index f918d1a04..70d93669d 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1982,5 +1982,27 @@ function tpl_classes() { return join(' ', $classes); } +/** + * Create event for tools menues + * + * @author Anika Henke <anika@selfthinker.org> + * @param string $toolsname name of menu + * @param array $items + * @param string $view e.g. 'main', 'detail', ... + */ +function tpl_toolsevent($toolsname, $items, $view = 'main') { + $data = array( + 'view' => $view, + 'items' => $items + ); + + $hook = 'TEMPLATE_' . strtoupper($toolsname) . '_DISPLAY'; + $evt = new Doku_Event($hook, $data); + if($evt->advise_before()) { + foreach($evt->data['items'] as $k => $html) echo $html; + } + $evt->advise_after(); +} + //Setup VIM: ex: et ts=4 : |