summaryrefslogtreecommitdiff
path: root/tpl_functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'tpl_functions.php')
-rw-r--r--tpl_functions.php25
1 files changed, 25 insertions, 0 deletions
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;
}
}