From 49dd4a833a88fe4b5045b1081ffb78369be2ff06 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Fri, 4 Feb 2011 02:02:57 +0000 Subject: [PATCH] added register link --- css/design.css | 2 ++ main.php | 1 + tpl_functions.php | 25 +++++++++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/css/design.css b/css/design.css index 37a5625..cfed4f0 100644 --- a/css/design.css +++ b/css/design.css @@ -87,6 +87,8 @@ /* highlight selected tool */ .mode_admin a.action.admin, +.mode_login a.action.login, +.mode_register a.action.register, .mode_profile a.action.profile, .mode_recent a.action.recent, .mode_index a.action.index, diff --git a/main.php b/main.php index 09eb125..1fe7749 100644 --- a/main.php +++ b/main.php @@ -68,6 +68,7 @@ $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER tpl_action('admin', 1, 'li'); _tpl_action('userpage', 1, 'li'); tpl_action('profile', 1, 'li'); + _tpl_action('register', 1, 'li'); tpl_action('login', 1, 'li'); ?> diff --git a/tpl_functions.php b/tpl_functions.php index cadf400..1fc2309 100644 --- a/tpl_functions.php +++ b/tpl_functions.php @@ -62,6 +62,28 @@ function _tpl_userpage($userPage,$title,$link=0,$wrapper=0) { if ($wrapper) echo ""; } +/** + * Create link/button to register page + * + * @author Anika Henke + */ +function _tpl_register($link=0,$wrapper=0) { + global $conf; + global $lang; + global $ID; + + if ($_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 * @@ -79,6 +101,9 @@ function _tpl_action($type,$link=0,$wrapper=0) { _tpl_userpage(tpl_getConf('userPage'),tpl_getLang('userpage'),$link,$wrapper); } break; + case 'register': + _tpl_register($link,$wrapper); + break; } }