diff --git a/main.php b/main.php index 36a5ce2..e46b9fc 100644 --- a/main.php +++ b/main.php @@ -63,19 +63,23 @@ $showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');

@@ -85,11 +89,11 @@ $showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');

@@ -145,15 +149,15 @@ $showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');

diff --git a/tpl_functions.php b/tpl_functions.php index a698def..3b13aa5 100644 --- a/tpl_functions.php +++ b/tpl_functions.php @@ -62,30 +62,6 @@ function _tpl_userpage($userPage, $title, $link=0, $wrapper=0) { if ($wrapper) echo ""; } -/** - * Create link/button to register page - * @deprecated DW versions > 2011-02-20 can use the core function tpl_action('register') - * - * @author Anika Henke - */ -function _tpl_register($link=0, $wrapper=0) { - global $conf; - global $lang; - global $ID; - $lang_register = !empty($lang['btn_register']) ? $lang['btn_register'] : $lang['register']; - - if (!empty($_SERVER['REMOTE_USER']) || !$conf['useacl'] || !actionOK('register')) return; - - if ($wrapper) echo "<$wrapper>"; - - if ($link) - tpl_link(wl($ID, 'do=register'), $lang_register, 'class="action register" rel="nofollow"'); - else - echo html_btn('register', $ID, '', array('do'=>'register'), 'get', 0, $lang_register); - - if ($wrapper) echo ""; -} - /** * Wrapper around custom template actions * @@ -109,6 +85,24 @@ function _tpl_action($type, $link=0, $wrapper=0) { } } +/** + * Create event for tools menues + * + * @author Anika Henke + */ +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(); +} /* fallbacks for things missing in older DokuWiki versions @@ -282,3 +276,27 @@ if (!function_exists('tpl_classes')) { return join(' ', $classes); } } + +/** + * Create link/button to register page + * @deprecated DW versions > 2011-02-20 can use the core function tpl_action('register') + * + * @author Anika Henke + */ +function _tpl_register($link=0, $wrapper=0) { + global $conf; + global $lang; + global $ID; + $lang_register = !empty($lang['btn_register']) ? $lang['btn_register'] : $lang['register']; + + if (!empty($_SERVER['REMOTE_USER']) || !$conf['useacl'] || !actionOK('register')) return; + + if ($wrapper) echo "<$wrapper>"; + + if ($link) + tpl_link(wl($ID, 'do=register'), $lang_register, 'class="action register" rel="nofollow"'); + else + echo html_btn('register', $ID, '', array('do'=>'register'), 'get', 0, $lang_register); + + if ($wrapper) echo ""; +}