فهرست منبع

Some variables are needed by all templates to make creation easier. Make sure they are passed as variables to the template.

stevetruckstuff 19 سال پیش
والد
کامیت
143ca2440c
1فایلهای تغییر یافته به همراه11 افزوده شده و 0 حذف شده
  1. 11 0
      class/template/template.class.php

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

@@ -203,6 +203,17 @@ class Template
    */
    */
   function display($file)
   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
     // Pull in our config file
     $t = &$this->values; // place values array directly in scope
     $t = &$this->values; // place values array directly in scope