From 7aae649daa9b008561069d9f9d1911cc7343717c Mon Sep 17 00:00:00 2001 From: stevetruckstuff Date: Fri, 18 Aug 2006 21:27:51 +0000 Subject: [PATCH] Move always included vars to init.php because it is confusing when not logged in. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11614 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- class/template/template.class.php | 11 ----------- include/init.php | 6 ++++++ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/class/template/template.class.php b/class/template/template.class.php index 238d0d13..238b8ac1 100755 --- a/class/template/template.class.php +++ b/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 diff --git a/include/init.php b/include/init.php index 0e00ac24..9ec05a31 100644 --- a/include/init.php +++ b/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 */ -- 2.25.1