remove $global_assign property from Smarty and $global_assign-handling

from the constructor. the only visible change is, that $SCRIPT_NAME is
not available in the tempates anymore. $smarty.server.SCRIPT_NAME has
to be used from now.
This commit is contained in:
messju
2003-12-03 09:29:13 +00:00
parent f50919c711
commit 64d755a37f
2 changed files with 2 additions and 31 deletions

2
NEWS
View File

@@ -1,3 +1,5 @@
- remove {$SCRIPT_NAME}. use {$smarty.server.SCRIPT_NAME} instead (messju)
- remove $global_assign. assign global variables explicitly instead (messju)
- remove warning in debug_print_var on php-resources (messju) - remove warning in debug_print_var on php-resources (messju)
- move function.assign.php to compiler.assign.php (messju) - move function.assign.php to compiler.assign.php (messju)
- add property $tpl_error_reporting (messju) - add property $tpl_error_reporting (messju)

View File

@@ -339,16 +339,6 @@ class Smarty
*/ */
var $cache_handler_func = null; var $cache_handler_func = null;
/**
* These are the variables from the globals array that are
* assigned to all templates automatically. This isn't really
* necessary any more, you can use the $smarty var to access them
* directly.
*
* @var array
*/
var $global_assign = array('HTTP_SERVER_VARS' => array('SCRIPT_NAME'));
/** /**
* This indicates which filters are automatically loaded into Smarty. * This indicates which filters are automatically loaded into Smarty.
* *
@@ -590,32 +580,11 @@ class Smarty
/**#@-*/ /**#@-*/
/** /**
* The class constructor. * The class constructor.
*
* @uses $global_assign uses {@link assign()} to assign each corresponding
* value from $GLOBALS to the template vars
*/ */
function Smarty() function Smarty()
{ {
foreach ($this->global_assign as $key => $var_name) {
if (is_array($var_name)) {
foreach ($var_name as $var) {
if (isset($GLOBALS[$key][$var])) {
$this->assign($var, $GLOBALS[$key][$var]);
} else {
$this->assign($var, null);
}
}
} else {
if (isset($GLOBALS[$var_name])) {
$this->assign($var_name, $GLOBALS[$var_name]);
} else {
$this->assign($var_name, null);
}
}
}
} }
/** /**
* assigns values to template variables * assigns values to template variables
* *