mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-09 21:04:28 +02:00
- added setter/getter methodes
- added $foo@first and $foo@last properties at {for} tag - added $set_timezone (true/false) property to setup optionally the default time zone
This commit is contained in:
@@ -1,7 +1,12 @@
|
|||||||
|
04/02/2009
|
||||||
|
- added setter/getter methodes
|
||||||
|
- added $foo@first and $foo@last properties at {for} tag
|
||||||
|
- added $set_timezone (true/false) property to setup optionally the default time zone
|
||||||
|
|
||||||
03/31/2009
|
03/31/2009
|
||||||
- bugfix smarty.class and internal.security_handler
|
- bugfix smarty.class and internal.security_handler
|
||||||
- added compile_check configuration
|
- added compile_check configuration
|
||||||
- added all setter/getter methodes
|
- added setter/getter methodes
|
||||||
|
|
||||||
03/30/2009
|
03/30/2009
|
||||||
- added all major setter/getter methodes
|
- added all major setter/getter methodes
|
||||||
|
@@ -102,7 +102,7 @@ class Smarty extends Smarty_Internal_TemplateBase {
|
|||||||
// config var settings
|
// config var settings
|
||||||
public $config_overwrite = true; //Controls whether variables with the same name overwrite each other.
|
public $config_overwrite = true; //Controls whether variables with the same name overwrite each other.
|
||||||
public $config_booleanize = true; //Controls whether config values of on/true/yes and off/false/no get converted to boolean
|
public $config_booleanize = true; //Controls whether config values of on/true/yes and off/false/no get converted to boolean
|
||||||
public $config_read_hidden = true; //Controls whether hidden config sections/vars are read from the file.
|
public $config_read_hidden = true; //Controls whether hidden config sections/vars are read from the file.
|
||||||
// config vars
|
// config vars
|
||||||
public $config_vars = array();
|
public $config_vars = array();
|
||||||
// assigned tpl vars
|
// assigned tpl vars
|
||||||
@@ -153,13 +153,17 @@ class Smarty extends Smarty_Internal_TemplateBase {
|
|||||||
public $_smarty_vars = array();
|
public $_smarty_vars = array();
|
||||||
// start time for execution time calculation
|
// start time for execution time calculation
|
||||||
public $start_time = 0;
|
public $start_time = 0;
|
||||||
|
// set default time zone
|
||||||
|
public $set_timezone = true;
|
||||||
/**
|
/**
|
||||||
* Class constructor, initializes basic smarty properties
|
* Class constructor, initializes basic smarty properties
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
mb_internal_encoding($this->resource_char_set);
|
mb_internal_encoding($this->resource_char_set);
|
||||||
|
if ($this->set_timezone and function_exists("date_default_timezone_set") and function_exists("date_default_timezone_get")) {
|
||||||
|
date_default_timezone_set(date_default_timezone_get());
|
||||||
|
}
|
||||||
$this->start_time = $this->_get_time();
|
$this->start_time = $this->_get_time();
|
||||||
// set exception handler
|
// set exception handler
|
||||||
if (!empty($this->exception_handler))
|
if (!empty($this->exception_handler))
|
||||||
|
@@ -52,8 +52,10 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase {
|
|||||||
$output .= " \$_smarty_tpl->tpl_vars[$item]->index=-1;\n";
|
$output .= " \$_smarty_tpl->tpl_vars[$item]->index=-1;\n";
|
||||||
$output .= "if (\$_smarty_tpl->tpl_vars[$item]->total > 0){\n";
|
$output .= "if (\$_smarty_tpl->tpl_vars[$item]->total > 0){\n";
|
||||||
$output .= " foreach (\$_from as \$_smarty_tpl->tpl_vars[$item]->key => \$_smarty_tpl->tpl_vars[$item]->value){\n";
|
$output .= " foreach (\$_from as \$_smarty_tpl->tpl_vars[$item]->key => \$_smarty_tpl->tpl_vars[$item]->value){\n";
|
||||||
|
$output .= " \$_smarty_tpl->tpl_vars[$item]->first = \$_smarty_tpl->tpl_vars[$item]->iteration === 0;\n";
|
||||||
$output .= " \$_smarty_tpl->tpl_vars[$item]->iteration++;\n";
|
$output .= " \$_smarty_tpl->tpl_vars[$item]->iteration++;\n";
|
||||||
$output .= " \$_smarty_tpl->tpl_vars[$item]->index++;\n";
|
$output .= " \$_smarty_tpl->tpl_vars[$item]->index++;\n";
|
||||||
|
$output .= " \$_smarty_tpl->tpl_vars[$item]->last = \$_smarty_tpl->tpl_vars[$item]->iteration === \$_smarty_tpl->tpl_vars[$item]->total;\n";
|
||||||
$output .= "?>";
|
$output .= "?>";
|
||||||
// return compiled code
|
// return compiled code
|
||||||
return $output;
|
return $output;
|
||||||
|
25
libs/sysplugins/method.disablecachemodifycheck.php
Normal file
25
libs/sysplugins/method.disablecachemodifycheck.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty method disableCacheModifyCheck
|
||||||
|
*
|
||||||
|
* Disable cache modify check
|
||||||
|
*
|
||||||
|
* @package Smarty
|
||||||
|
* @subpackage SmartyMethod
|
||||||
|
* @author Uwe Tews
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty class disableCacheModifyCheck
|
||||||
|
*
|
||||||
|
* Disable cache modify check
|
||||||
|
*/
|
||||||
|
class Smarty_Method_disableCacheModifyCheck extends Smarty_Internal_Base {
|
||||||
|
public function execute()
|
||||||
|
{
|
||||||
|
return $this->smarty->cache_modified_check = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
25
libs/sysplugins/method.disableconfigbooleanize.php
Normal file
25
libs/sysplugins/method.disableconfigbooleanize.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty method disableConfigBooleanize
|
||||||
|
*
|
||||||
|
* Disable config booleanize mode
|
||||||
|
*
|
||||||
|
* @package Smarty
|
||||||
|
* @subpackage SmartyMethod
|
||||||
|
* @author Uwe Tews
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty class disableConfigBooleanize
|
||||||
|
*
|
||||||
|
* Disable config booleanize mode
|
||||||
|
*/
|
||||||
|
class Smarty_Method_disableConfigBooleanize extends Smarty_Internal_Base {
|
||||||
|
public function execute()
|
||||||
|
{
|
||||||
|
return $this->smarty->config_booleanize = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
25
libs/sysplugins/method.disableconfigoverwrite.php
Normal file
25
libs/sysplugins/method.disableconfigoverwrite.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty method disableConfigOverwrite
|
||||||
|
*
|
||||||
|
* Disable config overwrite mode
|
||||||
|
*
|
||||||
|
* @package Smarty
|
||||||
|
* @subpackage SmartyMethod
|
||||||
|
* @author Uwe Tews
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty class disableConfigOverwrite
|
||||||
|
*
|
||||||
|
* Disable config overwrite mode
|
||||||
|
*/
|
||||||
|
class Smarty_Method_disableConfigOverwrite extends Smarty_Internal_Base {
|
||||||
|
public function execute()
|
||||||
|
{
|
||||||
|
return $this->smarty->config_overwrite = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
25
libs/sysplugins/method.disableconfigreadhidden.php
Normal file
25
libs/sysplugins/method.disableconfigreadhidden.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty method disableConfigReadHidden
|
||||||
|
*
|
||||||
|
* Disable config read hidden mode
|
||||||
|
*
|
||||||
|
* @package Smarty
|
||||||
|
* @subpackage SmartyMethod
|
||||||
|
* @author Uwe Tews
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty class disableConfigReadHidden
|
||||||
|
*
|
||||||
|
* Disable config read hidden mode
|
||||||
|
*/
|
||||||
|
class Smarty_Method_disableConfigReadHidden extends Smarty_Internal_Base {
|
||||||
|
public function execute()
|
||||||
|
{
|
||||||
|
return $this->smarty->config_read_hidden = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
25
libs/sysplugins/method.disabledefaulttimezone.php
Normal file
25
libs/sysplugins/method.disabledefaulttimezone.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty method disableDefaultTimezone
|
||||||
|
*
|
||||||
|
* Disable setting of default timezone
|
||||||
|
*
|
||||||
|
* @package Smarty
|
||||||
|
* @subpackage SmartyMethod
|
||||||
|
* @author Uwe Tews
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty class disableDefaultTimezone
|
||||||
|
*
|
||||||
|
* Disable setting of default timezone
|
||||||
|
*/
|
||||||
|
class Smarty_Method_disableDefaultTimezone extends Smarty_Internal_Base {
|
||||||
|
public function execute()
|
||||||
|
{
|
||||||
|
return $this->smarty->set_timezone = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
25
libs/sysplugins/method.enablecachemodifycheck.php
Normal file
25
libs/sysplugins/method.enablecachemodifycheck.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty method enableCacheModifyCheck
|
||||||
|
*
|
||||||
|
* Enable cache modify check
|
||||||
|
*
|
||||||
|
* @package Smarty
|
||||||
|
* @subpackage SmartyMethod
|
||||||
|
* @author Uwe Tews
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty class enableCacheModifyCheck
|
||||||
|
*
|
||||||
|
* Enable cache modify check
|
||||||
|
*/
|
||||||
|
class Smarty_Method_enableCacheModifyCheck extends Smarty_Internal_Base {
|
||||||
|
public function execute()
|
||||||
|
{
|
||||||
|
return $this->smarty->cache_modified_check = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
25
libs/sysplugins/method.enableconfigbooleanize.php
Normal file
25
libs/sysplugins/method.enableconfigbooleanize.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty method enableConfigBooleanize
|
||||||
|
*
|
||||||
|
* Enable config booleanize mode
|
||||||
|
*
|
||||||
|
* @package Smarty
|
||||||
|
* @subpackage SmartyMethod
|
||||||
|
* @author Uwe Tews
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty class enableConfigBooleanize
|
||||||
|
*
|
||||||
|
* Enable config booleanize mode
|
||||||
|
*/
|
||||||
|
class Smarty_Method_enableConfigBooleanize extends Smarty_Internal_Base {
|
||||||
|
public function execute()
|
||||||
|
{
|
||||||
|
return $this->smarty->config_booleanize = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
25
libs/sysplugins/method.enableconfigoverwrite.php
Normal file
25
libs/sysplugins/method.enableconfigoverwrite.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty method enableConfigOverwrite
|
||||||
|
*
|
||||||
|
* Enable config overwrite mode
|
||||||
|
*
|
||||||
|
* @package Smarty
|
||||||
|
* @subpackage SmartyMethod
|
||||||
|
* @author Uwe Tews
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty class enableConfigOverwrite
|
||||||
|
*
|
||||||
|
* Enable config overwrite mode
|
||||||
|
*/
|
||||||
|
class Smarty_Method_enableConfigOverwrite extends Smarty_Internal_Base {
|
||||||
|
public function execute()
|
||||||
|
{
|
||||||
|
return $this->smarty->config_overwrite = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
25
libs/sysplugins/method.enableconfigreadhidden.php
Normal file
25
libs/sysplugins/method.enableconfigreadhidden.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty method enableConfigReadHidden
|
||||||
|
*
|
||||||
|
* Enable config read hidden mode
|
||||||
|
*
|
||||||
|
* @package Smarty
|
||||||
|
* @subpackage SmartyMethod
|
||||||
|
* @author Uwe Tews
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty class enableConfigReadHidden
|
||||||
|
*
|
||||||
|
* Enable config read hidden mode
|
||||||
|
*/
|
||||||
|
class Smarty_Method_enableConfigReadHidden extends Smarty_Internal_Base {
|
||||||
|
public function execute()
|
||||||
|
{
|
||||||
|
return $this->smarty->config_read_hidden = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
25
libs/sysplugins/method.enabledefaulttimezone.php
Normal file
25
libs/sysplugins/method.enabledefaulttimezone.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty method enableDefaultTimezone
|
||||||
|
*
|
||||||
|
* Enable setting of default timezone
|
||||||
|
*
|
||||||
|
* @package Smarty
|
||||||
|
* @subpackage SmartyMethod
|
||||||
|
* @author Uwe Tews
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Smarty class enableDefaultTimezone
|
||||||
|
*
|
||||||
|
* Enable setting of default timezone
|
||||||
|
*/
|
||||||
|
class Smarty_Method_enableDefaultTimezone extends Smarty_Internal_Base {
|
||||||
|
public function execute()
|
||||||
|
{
|
||||||
|
return $this->smarty->set_timezone = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
Reference in New Issue
Block a user