1<?php
2/**
3 * Template Functions
4 *
5 * This file provides template specific custom functions that are
6 * not provided by the DokuWiki core.
7 * It is common practice to start each function with an underscore
8 * to make sure it won't interfere with future core functions.
9 */
10
11// must be run from within DokuWiki
12if (!defined('DOKU_INC')) die();
13
14/**
15 * copied to core (available since Detritus)
16 */
17if (!function_exists('tpl_toolsevent')) {
18    function tpl_toolsevent($toolsname, $items, $view='main') {
19        $data = array(
20            'view'  => $view,
21            'items' => $items
22        );
23
24        $hook = 'TEMPLATE_'.strtoupper($toolsname).'_DISPLAY';
25        $evt = new Doku_Event($hook, $data);
26        if($evt->advise_before()){
27            foreach($evt->data['items'] as $k => $html) echo $html;
28        }
29        $evt->advise_after();
30    }
31}
32