[geeklog-hg] geeklog: Added new default template variable for all templates c...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Thu Oct 10 18:15:15 EDT 2013


changeset 9319:6b3108687b67
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/6b3108687b67
user: Tom <websitemaster at cogeco.net>
date: Thu Oct 10 18:00:39 2013 -0400
description:
Added new default template variable for all templates called "anonymous_user" that is set to true if visitor is not logged in {feature request #0001710)

diffstat:

 public_html/lib-common.php        |  1 +
 system/classes/template.class.php |  2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diffs (23 lines):

diff -r 0300e7cb89b4 -r 6b3108687b67 public_html/lib-common.php
--- a/public_html/lib-common.php	Thu Oct 10 17:46:30 2013 -0400
+++ b/public_html/lib-common.php	Thu Oct 10 18:00:39 2013 -0400
@@ -327,6 +327,7 @@
 }
 // Set template class default template variables option
 $TEMPLATE_OPTIONS['default_vars']['layout_url'] = $_CONF['layout_url'];
+$TEMPLATE_OPTIONS['default_vars']['anonymous_user'] = COM_isAnonUser();
 
 /**
 * Include the Scripts class
diff -r 0300e7cb89b4 -r 6b3108687b67 system/classes/template.class.php
--- a/system/classes/template.class.php	Thu Oct 10 17:46:30 2013 -0400
+++ b/system/classes/template.class.php	Thu Oct 10 18:00:39 2013 -0400
@@ -74,6 +74,8 @@
                         'site_url' => $_CONF['site_url'],
                         'site_admin_url' => $_CONF['site_admin_url'],
                         'layout_url' => $_CONF['layout_url'], // Can be set by lib-common on theme change
+                        'anonymous_user' => true, // Set to false in lib-common if current visitor is logged in
+                        
                       ),
     'hook' => array(),
 );



More information about the geeklog-cvs mailing list