Hide the "Create an account" button if registration is disabled (Enanium only, but there is a template boolean called "registration_disabled" so other themes can use it too)
authorDan Fuhry <dan@enanocms.org>
Sun, 19 Sep 2010 04:04:28 -0400
changeset 1302 b48d2de63007
parent 1301 bd9e124f5904
child 1304 0470b3176781
Hide the "Create an account" button if registration is disabled (Enanium only, but there is a template boolean called "registration_disabled" so other themes can use it too)
includes/template.php
themes/enanium/header.tpl
--- a/includes/template.php	Sun Sep 05 16:05:33 2010 -0400
+++ b/includes/template.php	Sun Sep 19 04:04:28 2010 -0400
@@ -501,7 +501,8 @@
 				'auth_admin' => $session->user_level >= USER_LEVEL_ADMIN ? true : false,
 				'user_logged_in' => $session->user_logged_in,
 				'opera' => $is_opera,
-				'msie' => $is_msie
+				'msie' => $is_msie,
+				'registration_disabled' => getConfig('account_activation', 'none') === 'disable'
 			));
 		
 		if ( $session->sid_super )
--- a/themes/enanium/header.tpl	Sun Sep 05 16:05:33 2010 -0400
+++ b/themes/enanium/header.tpl	Sun Sep 19 04:04:28 2010 -0400
@@ -55,7 +55,9 @@
 			<li class="logout"><a href="{url:Special:Logout/{CSRF_TOKEN}/{PAGE_URLNAME}}" onclick="mb_logout(); return false;">{lang:sidebar_btn_logout}</a></li>
 			<!-- BEGINELSE user_logged_in -->
 			<li class="em"><a href="{url:Special:Login}" onclick="ajaxStartLogin(); return false;">{lang:sidebar_btn_login}</a></li>
+			<!-- BEGINNOT registration_disabled -->
 			<li><a href="{url:Special:Register}">{lang:sidebar_btn_register}</a></li>
+			<!-- END registration_disabled -->
 			<!-- END user_logged_in -->
 		</ul>
 		<!-- END stupid_mode -->