Browse Source

added register link

master
Anika Henke 14 years ago
parent
commit
49dd4a833a
  1. 2
      css/design.css
  2. 1
      main.php
  3. 25
      tpl_functions.php

2
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,

1
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');
?>
</ul>

25
tpl_functions.php

@ -62,6 +62,28 @@ function _tpl_userpage($userPage,$title,$link=0,$wrapper=0) {
if ($wrapper) echo "</$wrapper>";
}
/**
* Create link/button to register page
*
* @author Anika Henke <anika@selfthinker.org>
*/
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>";
}
/**
* 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;
}
}

Loading…
Cancel
Save