A few safety changes to tolerate no $session when it's not available
authorDan
Thu, 14 May 2009 11:34:24 -0400
changeset 978 ed84b24b8e07
parent 977 322a9bf1e280
child 979 aafb9f6806c9
A few safety changes to tolerate no $session when it's not available
includes/functions.php
includes/template.php
themes/enanium/header.tpl
--- a/includes/functions.php	Wed May 13 09:49:36 2009 -0400
+++ b/includes/functions.php	Thu May 14 11:34:24 2009 -0400
@@ -111,7 +111,7 @@
       $sep = '&';
     }
   
-    $url = $session->append_sid(contentPath.$t.$flags);
+    $url = is_object($session) ? $session->append_sid(contentPath.$t.$flags) : contentPath . $t . $flags;
     if($query)
     {
       $sep = strstr($url, '?') ? '&' : '?';
--- a/includes/template.php	Wed May 13 09:49:36 2009 -0400
+++ b/includes/template.php	Thu May 14 11:34:24 2009 -0400
@@ -2925,8 +2925,9 @@
     $tb = '';
     // Get the "article" button text (depends on namespace)
     if(defined('IN_ENANO_INSTALL') && is_object($lang)) $ns = $lang->get('meta_btn_article');
+    else if ( isset($GLOBALS['article_btn']) ) $ns = $GLOBALS['article_btn'];
     else $ns = 'system error page';
-    $t = str_replace('{FLAGS}', 'onclick="return false;" title="Hey! A button that doesn\'t do anything. Clever..." accesskey="a"', $tplvars['toolbar_button']);
+    $t = str_replace('{FLAGS}', 'onclick="return false;" class="current" title="Hey! A button that doesn\'t do anything. Clever..." accesskey="a"', $tplvars['toolbar_button']);
     $t = str_replace('{HREF}', '#', $t);
     $t = str_replace('{TEXT}', $ns, $t);
     $tb .= $t;
--- a/themes/enanium/header.tpl	Wed May 13 09:49:36 2009 -0400
+++ b/themes/enanium/header.tpl	Thu May 14 11:34:24 2009 -0400
@@ -17,6 +17,8 @@
   <body>
     <div id="header">
       <?php
+      global $session;
+      
       if ( is_object($paths) && $head = $paths->sysMsg('SiteHeader') )
       {
         echo $head;