Browse Source

Move always included vars to init.php because it is confusing when not logged in.

stevetruckstuff 19 years ago
parent
commit
dd7175b447
2 changed files with 6 additions and 11 deletions
  1. 0 11
      class/template/template.class.php
  2. 6 0
      include/init.php

+ 0 - 11
class/template/template.class.php

@@ -203,17 +203,6 @@ class Template
    */
   function display($file)
   {
-    /**
-     * We want to make sure that certain variables are always passed to the
-     * templates b/c they are critical to certain template functions.
-     */
-    $always_include = array('icon_theme_path', 'sTplDir');
-    foreach ($always_include as $var) {
-        if (!isset($this->values[$var]) && isset($GLOBALS[$var])) {
-            $this->assign($var, $GLOBALS[$var]);
-        }
-    }
-    
     // Pull in our config file
     $t = &$this->values; // place values array directly in scope
 

+ 6 - 0
include/init.php

@@ -509,6 +509,12 @@ if (!isset($sTplDir)) {
 }
 $oTemplate = new Template($sTplDir);
 
+// We want some variables to always be available to the template
+$always_include = array('sTplDir', 'icon_theme_path');
+foreach ($always_include as $var) {
+    $oTemplate->assign($var, (isset($$var) ? $$var : NULL));
+}
+
 /**
  * Initialize our custom error handler object
  */