aboutsummaryrefslogtreecommitdiffstats
path: root/include/smarty/libs/SmartyBC.class.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2015-12-10 14:02:22 +0100
committerplegall <plg@piwigo.org>2015-12-10 14:02:22 +0100
commitfa10e0945ecd45bfe78a2c8fb015a43092b4944b (patch)
tree19cf59c08877e43325efbe9a2584114011a25522 /include/smarty/libs/SmartyBC.class.php
parent16f6a54fa719cc79ff942e4bb8139d7ca09ed997 (diff)
bug #385 update to smarty-3.1.28-dev (from Github)
Diffstat (limited to 'include/smarty/libs/SmartyBC.class.php')
-rw-r--r--include/smarty/libs/SmartyBC.class.php115
1 files changed, 55 insertions, 60 deletions
diff --git a/include/smarty/libs/SmartyBC.class.php b/include/smarty/libs/SmartyBC.class.php
index 589dcca27..1dd529c9c 100644
--- a/include/smarty/libs/SmartyBC.class.php
+++ b/include/smarty/libs/SmartyBC.class.php
@@ -3,60 +3,62 @@
* Project: Smarty: the PHP compiling template engine
* File: SmartyBC.class.php
* SVN: $Id: $
- *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
- *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
* For questions, help, comments, discussion, etc., please join the
* Smarty mailing list. Send a blank e-mail to
* smarty-discussion-subscribe@googlegroups.com
*
- * @link http://www.smarty.net/
+ * @link http://www.smarty.net/
* @copyright 2008 New Digital Group, Inc.
- * @author Monte Ohrt <monte at ohrt dot com>
- * @author Uwe Tews
- * @author Rodney Rehm
- * @package Smarty
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author Uwe Tews
+ * @author Rodney Rehm
+ * @package Smarty
*/
/**
* @ignore
*/
-require(dirname(__FILE__) . '/Smarty.class.php');
+require_once(dirname(__FILE__) . '/Smarty.class.php');
/**
* Smarty Backward Compatability Wrapper Class
*
* @package Smarty
*/
-class SmartyBC extends Smarty {
-
+class SmartyBC extends Smarty
+{
/**
* Smarty 2 BC
+ *
* @var string
*/
public $_version = self::SMARTY_VERSION;
/**
+ * This is an array of directories where trusted php scripts reside.
+ *
+ * @var array
+ */
+ public $trusted_dir = array();
+
+ /**
* Initialize new SmartyBC object
*
* @param array $options options to set during initialization, e.g. array( 'forceCompile' => false )
*/
- public function __construct(array $options=array())
+ public function __construct(array $options = array())
{
parent::__construct($options);
- // register {php} tag
- $this->registerPlugin('block', 'php', 'smarty_php_tag');
}
/**
@@ -100,7 +102,7 @@ class SmartyBC extends Smarty {
* @param bool $cacheable
* @param mixed $cache_attrs
*/
- public function register_function($function, $function_impl, $cacheable=true, $cache_attrs=null)
+ public function register_function($function, $function_impl, $cacheable = true, $cache_attrs = null)
{
$this->registerPlugin('function', $function, $function_impl, $cacheable, $cache_attrs);
}
@@ -118,11 +120,14 @@ class SmartyBC extends Smarty {
/**
* Registers object to be used in templates
*
- * @param string $object name of template object
- * @param object $object_impl the referenced PHP object to register
- * @param array $allowed list of allowed methods (empty = all)
- * @param boolean $smarty_args smarty argument format, else traditional
- * @param array $block_functs list of methods that are block format
+ * @param string $object name of template object
+ * @param object $object_impl the referenced PHP object to register
+ * @param array $allowed list of allowed methods (empty = all)
+ * @param boolean $smarty_args smarty argument format, else traditional
+ * @param array $block_methods list of methods that are block format
+ *
+ * @throws SmartyException
+ * @internal param array $block_functs list of methods that are block format
*/
public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
{
@@ -149,7 +154,7 @@ class SmartyBC extends Smarty {
* @param bool $cacheable
* @param mixed $cache_attrs
*/
- public function register_block($block, $block_impl, $cacheable=true, $cache_attrs=null)
+ public function register_block($block, $block_impl, $cacheable = true, $cache_attrs = null)
{
$this->registerPlugin('block', $block, $block_impl, $cacheable, $cache_attrs);
}
@@ -171,7 +176,7 @@ class SmartyBC extends Smarty {
* @param string $function_impl name of PHP function to register
* @param bool $cacheable
*/
- public function register_compiler_function($function, $function_impl, $cacheable=true)
+ public function register_compiler_function($function, $function_impl, $cacheable = true)
{
$this->registerPlugin('compiler', $function, $function_impl, $cacheable);
}
@@ -189,7 +194,7 @@ class SmartyBC extends Smarty {
/**
* Registers modifier to be used in templates
*
- * @param string $modifier name of template modifier
+ * @param string $modifier name of template modifier
* @param string $modifier_impl name of PHP function to register
*/
public function register_modifier($modifier, $modifier_impl)
@@ -305,10 +310,11 @@ class SmartyBC extends Smarty {
/**
* clear cached content for the given template and cache id
*
- * @param string $tpl_file name of template file
- * @param string $cache_id name of cache_id
- * @param string $compile_id name of compile_id
- * @param string $exp_time expiration time
+ * @param string $tpl_file name of template file
+ * @param string $cache_id name of cache_id
+ * @param string $compile_id name of compile_id
+ * @param string $exp_time expiration time
+ *
* @return boolean
*/
public function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)
@@ -319,7 +325,8 @@ class SmartyBC extends Smarty {
/**
* clear the entire contents of cache (all templates)
*
- * @param string $exp_time expire time
+ * @param string $exp_time expire time
+ *
* @return boolean
*/
public function clear_all_cache($exp_time = null)
@@ -330,9 +337,10 @@ class SmartyBC extends Smarty {
/**
* test to see if valid cache exists for this template
*
- * @param string $tpl_file name of template file
- * @param string $cache_id
- * @param string $compile_id
+ * @param string $tpl_file name of template file
+ * @param string $cache_id
+ * @param string $compile_id
+ *
* @return boolean
*/
public function is_cached($tpl_file, $cache_id = null, $compile_id = null)
@@ -353,9 +361,10 @@ class SmartyBC extends Smarty {
* or all compiled template files if one is not specified.
* This function is for advanced use only, not normally needed.
*
- * @param string $tpl_file
- * @param string $compile_id
- * @param string $exp_time
+ * @param string $tpl_file
+ * @param string $compile_id
+ * @param string $exp_time
+ *
* @return boolean results of {@link smarty_core_rm_auto()}
*/
public function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)
@@ -366,7 +375,8 @@ class SmartyBC extends Smarty {
/**
* Checks whether requested template exists.
*
- * @param string $tpl_file
+ * @param string $tpl_file
+ *
* @return boolean
*/
public function template_exists($tpl_file)
@@ -377,10 +387,11 @@ class SmartyBC extends Smarty {
/**
* Returns an array containing template variables
*
- * @param string $name
+ * @param string $name
+ *
* @return array
*/
- public function get_template_vars($name=null)
+ public function get_template_vars($name = null)
{
return $this->getTemplateVars($name);
}
@@ -388,10 +399,11 @@ class SmartyBC extends Smarty {
/**
* Returns an array containing config variables
*
- * @param string $name
+ * @param string $name
+ *
* @return array
*/
- public function get_config_vars($name=null)
+ public function get_config_vars($name = null)
{
return $this->getConfigVars($name);
}
@@ -411,7 +423,8 @@ class SmartyBC extends Smarty {
/**
* return a reference to a registered object
*
- * @param string $name
+ * @param string $name
+ *
* @return object
*/
public function get_registered_object($name)
@@ -432,29 +445,11 @@ class SmartyBC extends Smarty {
/**
* trigger Smarty error
*
- * @param string $error_msg
+ * @param string $error_msg
* @param integer $error_type
*/
public function trigger_error($error_msg, $error_type = E_USER_WARNING)
{
trigger_error("Smarty error: $error_msg", $error_type);
}
-
}
-
-/**
- * Smarty {php}{/php} block function
- *
- * @param array $params parameter list
- * @param string $content contents of the block
- * @param object $template template object
- * @param boolean &$repeat repeat flag
- * @return string content re-formatted
- */
-function smarty_php_tag($params, $content, $template, &$repeat)
-{
- eval($content);
- return '';
-}
-
-?> \ No newline at end of file