summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--css/design.css2
-rw-r--r--main.php1
-rw-r--r--tpl_functions.php25
3 files changed, 28 insertions, 0 deletions
diff --git a/css/design.css b/css/design.css
index 37a5625d6..cfed4f078 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 09eb125c4..1fe7749e9 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');
?>
</ul>
diff --git a/tpl_functions.php b/tpl_functions.php
index cadf400e4..1fc23099d 100644
--- a/tpl_functions.php
+++ b/tpl_functions.php
@@ -63,6 +63,28 @@ function _tpl_userpage($userPage,$title,$link=0,$wrapper=0) {
}
/**
+ * 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
*
* @author Anika Henke <anika@selfthinker.org>
@@ -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;
}
}