Ich wollte das Price Update Modul in der product_info_v1.html -> Product Sidebar. Sorry hab mir dies gar nicht überlegt.
<?php/**
* Project: Smarty: the PHP compiling template engine
* File: Smarty.class.php
*
* 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/
* @copyright 2001-2005 New Digital Group, Inc.
* @author Monte Ohrt <monte at ohrt dot com>
* @author Andrei Zmievski <andrei@php.net>
* @package Smarty
* @version 2.6.26
* Modiied for xt:Commerce v3.0.4 SP2.1 (c)2009 by Hetfield - www.MerZ-IT-SerVice.de
*//* $Id: Smarty.class.php 3163 2009-06-17 14:39:24Z monte.ohrt $ *//**
* DIR_SEP isn't used anymore, but third party apps might
*/if(!defined('DIR_SEP')) { define('DIR_SEP', DIRECTORY_SEPARATOR);}/**
* set SMARTY_DIR to absolute path to Smarty library files.
* if not defined, include_path will be used. Sets SMARTY_DIR only if user
* application has not already defined it.
*/if (!defined('SMARTY_DIR')) { define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);}if (!defined('SMARTY_CORE_DIR')) { define('SMARTY_CORE_DIR', SMARTY_DIR
. 'internals' . DIRECTORY_SEPARATOR);}define('SMARTY_PHP_PASSTHRU', 0);define('SMARTY_PHP_QUOTE', 1);define('SMARTY_PHP_REMOVE', 2);define('SMARTY_PHP_ALLOW', 3);define('tplPlugins', DIR_FS_CATALOG
.'/templates/'.CURRENT_TEMPLATE
.'/squidio/lib/plugins/');/**
* @package Smarty
*/class Smarty
{ /**#@+
* Smarty Configuration Section
*/ /**
* The name of the directory where templates are located.
*
* @var string
*/ var $template_dir = 'templates'; /**
* The directory where compiled templates are located.
*
* @var string
*/ var $compile_dir = 'templates_c'; /**
* The directory where config files are located.
*
* @var string
*/// BOF - Tomcraft - 2009-05-26 - change path to "lang"// var $config_dir = 'configs'; var $config_dir = 'lang'; // Modified for xt:Commerce v3.0.4 SP2.1 (c)2009 by Hetfield - www.MerZ-IT-SerVice.de// EOF - Tomcraft - 2009-05-26 - change path to "lang" /**
* An array of directories searched for plugins.
*
* @var array
*/ var $plugins_dir = array('plugins', tplPlugins
); /**
* If debugging is enabled, a debug console window will display
* when the page loads (make sure your browser allows unrequested
* popup windows)
*
* @var boolean
*/ var $debugging = false; /**
* When set, smarty does uses this value as error_reporting-level.
*
* @var integer
*/ var $error_reporting = null; /**
* This is the path to the debug console template. If not set,
* the default one will be used.
*
* @var string
*/ var $debug_tpl = ''; /**
* This determines if debugging is enable-able from the browser.
* <ul>
* <li>NONE => no debugging control allowed</li>
* <li>URL => enable debugging when SMARTY_DEBUG is found in the URL.</li>
* </ul>
* @link http://www.foo.dom/index.php?SMARTY_DEBUG
* @var string
*/ var $debugging_ctrl = 'NONE'; /**
* This tells Smarty whether to check for recompiling or not. Recompiling
* does not need to happen unless a template or config file is changed.
* Typically you enable this during development, and disable for
* production.
*
* @var boolean
*/ var $compile_check = true; /**
* This forces templates to compile every time. Useful for development
* or debugging.
*
* @var boolean
*/ var $force_compile = false; /**
* This enables template caching.
* <ul>
* <li>0 = no caching</li>
* <li>1 = use class cache_lifetime value</li>
* <li>2 = use cache_lifetime in cache file</li>
* </ul>
* @var integer
*/ var $caching = 0; /**
* The name of the directory for cache files.
*
* @var string
*/ var $cache_dir = 'cache'; /**
* This is the number of seconds cached content will persist.
* <ul>
* <li>0 = always regenerate cache</li>
* <li>-1 = never expires</li>
* </ul>
*
* @var integer
*/ var $cache_lifetime = 3600; /**
* Only used when $caching is enabled. If true, then If-Modified-Since headers
* are respected with cached content, and appropriate HTTP headers are sent.
* This way repeated hits to a cached page do not send the entire page to the
* client every time.
*
* @var boolean
*/ var $cache_modified_check = false; /**
* This determines how Smarty handles "<?php ... ?>" tags in templates.
* possible values:
* <ul>
* <li>SMARTY_PHP_PASSTHRU -> print tags as plain text</li>
* <li>SMARTY_PHP_QUOTE -> escape tags as entities</li>
* <li>SMARTY_PHP_REMOVE -> remove php tags</li>
* <li>SMARTY_PHP_ALLOW -> execute php tags</li>
* </ul>
*
* @var integer
*/
var $php_handling = SMARTY_PHP_PASSTHRU;
/**
* This enables template security. When enabled, many things are restricted
* in the templates that normally would go unchecked. This is useful when
* untrusted parties are editing templates and you want a reasonable level
* of security. (no direct execution of PHP in templates for example)
*
* @var boolean
*/
var $security = false;
/**
* This is the list of template directories that are considered secure. This
* is used only if {@link $security} is enabled. One directory per array
* element. {@link $template_dir} is in this list implicitly.
*
* @var array
*/
var $secure_dir = array();
/**
* These are the security settings for Smarty. They are used only when
* {@link $security} is enabled.
*
* @var array
*/
var $security_settings = array(
'PHP_HANDLING' => false,
'IF_FUNCS' => array('array', 'list',
'isset', 'empty',
'count', 'sizeof',
'in_array', 'is_array',
'true', 'false', 'null'),
'INCLUDE_ANY' => false,
'PHP_TAGS' => false,
'MODIFIER_FUNCS' => array('count'),
'ALLOW_CONSTANTS' => false,
'ALLOW_SUPER_GLOBALS' => true
);
/**
* This is an array of directories where trusted php scripts reside.
* {@link $security} is disabled during their inclusion/execution.
*
* @var array
*/
var $trusted_dir = array();
/**
* The left delimiter used for the template tags.
*
* @var string
*/
var $left_delimiter = '{';
/**
* The right delimiter used for the template tags.
*
* @var string
*/
var $right_delimiter = '}';
/**
* The order in which request variables are registered, similar to
* variables_order in php.ini E = Environment, G = GET, P = POST,
* C = Cookies, S = Server
*
* @var string
*/
var $request_vars_order = 'EGPCS';
/**
* Indicates wether $HTTP_*_VARS[] (request_use_auto_globals=false)
* are uses as request-vars or $_*[]-vars. note: if
* request_use_auto_globals is true, then $request_vars_order has
* no effect, but the php-ini-value "gpc_order"
*
* @var boolean
*/
var $request_use_auto_globals = true;
/**
* Set this if you want different sets of compiled files for the same
* templates. This is useful for things like different languages.
* Instead of creating separate sets of templates per language, you
* set different compile_ids like 'en' and 'de'.
*
* @var string
*/
var $compile_id = null;
/**
* This tells Smarty whether or not to use sub dirs in the cache/ and
* templates_c/ directories. sub directories better organized, but
* may not work well with PHP safe mode enabled.
*
* @var boolean
*
*/
var $use_sub_dirs = false;
/**
* This is a list of the modifiers to apply to all template variables.
* Put each modifier in a separate array element in the order you want
* them applied. example: <code>array('escape:"htmlall"');</code>
*
* @var array
*/
var $default_modifiers = array();
/**
* This is the resource type to be used when not specified
* at the beginning of the resource path. examples:
* $smarty->display('file:index.tpl');
* $smarty->display('db:index.tpl');
* $smarty->display('index.tpl'); // will use default resource type
* {include file="file:index.tpl"}
* {include file="db:index.tpl"}
* {include file="index.tpl"} {* will use default resource type *}
*
* @var array
*/
var $default_resource_type = 'file';
/**
* The function used for cache file handling. If not set, built-in caching is used.
*
* @var null|string function name
*/
var $cache_handler_func = null;
/**
* This indicates which filters are automatically loaded into Smarty.
*
* @var array array of filter names
*/
var $autoload_filters = array();
/**#@+
* @var boolean
*/
/**
* This tells if config file vars of the same name overwrite each other or not.
* if disabled, same name variables are accumulated in an array.
*/
var $config_overwrite = true;
/**
* This tells whether or not to automatically booleanize config file variables.
* If enabled, then the strings "on", "true", and "yes" are treated as boolean
* true, and "off", "false" and "no" are treated as boolean false.
*/
var $config_booleanize = true;
/**
* This tells whether hidden sections [.foobar] are readable from the
* tempalates or not. Normally you would never allow this since that is
* the point behind hidden sections: the application can access them, but
* the templates cannot.
*/
var $config_read_hidden = false;
/**
* This tells whether or not automatically fix newlines in config files.
* It basically converts \r (mac) or \r\n (dos) to \n
*/
var $config_fix_newlines = true;
/**#@-*/
/**
* If a template cannot be found, this PHP function will be executed.
* Useful for creating templates on-the-fly or other special action.
*
* @var string function name
*/
var $default_template_handler_func = '';
/**
* The file that contains the compiler class. This can a full
* pathname, or relative to the php_include path.
*
* @var string
*/
var $compiler_file = 'Smarty_Compiler.class.php';
/**
* The class used for compiling templates.
*
* @var string
*/
var $compiler_class = 'Smarty_Compiler';
/**
* The class used to load config vars.
*
* @var string
*/
var $config_class = 'Config_File';
/**#@+
* END Smarty Configuration Section
* There should be no need to touch anything below this line.
* @access private
*/
/**
* where assigned template vars are kept
*
* @var array
*/
var $_tpl_vars = array();
/**
* stores run-time $smarty.* vars
*
* @var null|array
*/
var $_smarty_vars = null;
/**
* keeps track of sections
*
* @var array
*/
var $_sections = array();
/**
* keeps track of foreach blocks
*
* @var array
*/
var $_foreach = array();
/**
* keeps track of tag hierarchy
*
* @var array
*/
var $_tag_stack = array();
/**
* configuration object
*
* @var Config_file
*/
var $_conf_obj = null;
/**
* loaded configuration settings
*
* @var array
*/
var $_config = array(array('vars' => array(), 'files' => array()));
/**
* md5 checksum of the string 'Smarty'
*
* @var string
*/
var $_smarty_md5 = 'f8d698aea36fcbead2b9d5359ffca76f';
/**
* Smarty version number
*
* @var string
*/
var $_version = '2.6.26';
/**
* current template inclusion depth
*
* @var integer
*/
var $_inclusion_depth = 0;
/**
* for different compiled templates
*
* @var string
*/
var $_compile_id = null;
/**
* text in URL to enable debug mode
*
* @var string
*/
var $_smarty_debug_id = 'SMARTY_DEBUG';
/**
* debugging information for debug console
*
* @var array
*/
var $_smarty_debug_info = array();
/**
* info that makes up a cache file
*
* @var array
*/
var $_cache_info = array();
/**
* default file permissions
*
* @var integer
*/
var $_file_perms = 0644;
/**
* default dir permissions
*
* @var integer
*/
var $_dir_perms = 0771;
/**
* registered objects
*
* @var array
*/
var $_reg_objects = array();
/**
* table keeping track of plugins
*
* @var array
*/
var $_plugins = array(
'modifier' => array(),
'function' => array(),
'block' => array(),
'compiler' => array(),
'prefilter' => array(),
'postfilter' => array(),
'outputfilter' => array(),
'resource' => array(),
'insert' => array());
/**
* cache serials
*
* @var array
*/
var $_cache_serials = array();
/**
* name of optional cache include file
*
* @var string
*/
var $_cache_include = null;
/**
* indicate if the current code is used in a compiled
* include
*
* @var string
*/
var $_cache_including = false;
/**#@-*/
/**
* The class constructor.
*/
function Smarty()
{
$this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME']
: @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']);
}
/**
* assigns values to template variables
*
* @param array|string $tpl_var the template variable name(s)
* @param mixed $value the value to assign
*/
function assign($tpl_var, $value = null)
{
if (is_array($tpl_var)){
foreach ($tpl_var as $key => $val) {
if ($key != '') {
$this->_tpl_vars[$key] = $val;
}
}
} else {
if ($tpl_var != '')
$this->_tpl_vars[$tpl_var] = $value;
}
}
/**
* assigns values to template variables by reference
*
* @param string $tpl_var the template variable name
* @param mixed $value the referenced value to assign
*/
function assign_by_ref($tpl_var, &$value)
{
if ($tpl_var != '')
$this->_tpl_vars[$tpl_var] = &$value;
}
/**
* appends values to template variables
*
* @param array|string $tpl_var the template variable name(s)
* @param mixed $value the value to append
*/
function append($tpl_var, $value=null, $merge=false)
{
if (is_array($tpl_var)) {
// $tpl_var is an array, ignore $value
foreach ($tpl_var as $_key => $_val) {
if ($_key != '') {
if(!@is_array($this->_tpl_vars[$_key])) {
settype($this->_tpl_vars[$_key],'array');
}
if($merge && is_array($_val)) {
foreach($_val as $_mkey => $_mval) {
$this->_tpl_vars[$_key][$_mkey] = $_mval;
}
} else {
$this->_tpl_vars[$_key][] = $_val;
}
}
}
} else {
if ($tpl_var != '' && isset($value)) {
if(!@is_array($this->_tpl_vars[$tpl_var])) {
settype($this->_tpl_vars[$tpl_var],'array');
}
if($merge && is_array($value)) {
foreach($value as $_mkey => $_mval) {
$this->_tpl_vars[$tpl_var][$_mkey] = $_mval;
}
} else {
$this->_tpl_vars[$tpl_var][] = $value;
}
}
}
}
/**
* appends values to template variables by reference
*
* @param string $tpl_var the template variable name
* @param mixed $value the referenced value to append
*/
function append_by_ref($tpl_var, &$value, $merge=false)
{
if ($tpl_var != '' && isset($value)) {
if(!@is_array($this->_tpl_vars[$tpl_var])) {
settype($this->_tpl_vars[$tpl_var],'array');
}
if ($merge && is_array($value)) {
foreach($value as $_key => $_val) {
$this->_tpl_vars[$tpl_var][$_key] = &$value[$_key];
}
} else {
$this->_tpl_vars[$tpl_var][] = &$value;
}
}
}
/**
* clear the given assigned template variable.
*
* @param string $tpl_var the template variable to clear
*/
function clear_assign($tpl_var)
{
if (is_array($tpl_var))
foreach ($tpl_var as $curr_var)
unset($this->_tpl_vars[$curr_var]);
else
unset($this->_tpl_vars[$tpl_var]);
}
/**
* Registers custom function to be used in templates
*
* @param string $function the name of the template function
* @param string $function_impl the name of the PHP function to register
*/
function register_function($function, $function_impl, $cacheable=true, $cache_attrs=null)
{
$this->_plugins['function'][$function] =
array($function_impl, null, null, false, $cacheable, $cache_attrs);
}
/**
* Unregisters custom function
*
* @param string $function name of template function
*/
function unregister_function($function)
{
unset($this->_plugins['function'][$function]);
}
/**
* 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 null|array $allowed list of allowed methods (empty = all)
* @param boolean $smarty_args smarty argument format, else traditional
* @param null|array $block_functs list of methods that are block format
*/
function register_object($object, &$object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
{
settype($allowed, 'array');
settype($smarty_args, 'boolean');
$this->_reg_objects[$object] =
array(&$object_impl, $allowed, $smarty_args, $block_methods);
}
/**
* Unregisters object
*
* @param string $object name of template object
*/
function unregister_object($object)
{
unset($this->_reg_objects[$object]);
}
/**
* Registers block function to be used in templates
*
* @param string $block name of template block
* @param string $block_impl PHP function to register
*/
function register_block($block, $block_impl, $cacheable=true, $cache_attrs=null)
{
$this->_plugins['block'][$block] =
array($block_impl, null, null, false, $cacheable, $cache_attrs);
}
/**
* Unregisters block function
*
* @param string $block name of template function
*/
function unregister_block($block)
{
unset($this->_plugins['block'][$block]);
}
/**
* Registers compiler function
*
* @param string $function name of template function
* @param string $function_impl name of PHP function to register
*/
function register_compiler_function($function, $function_impl, $cacheable=true)
{
$this->_plugins['compiler'][$function] =
array($function_impl, null, null, false, $cacheable);
}
/**
* Unregisters compiler function
*
* @param string $function name of template function
*/
function unregister_compiler_function($function)
{
unset($this->_plugins['compiler'][$function]);
}
/**
* Registers modifier to be used in templates
*
* @param string $modifier name of template modifier
* @param string $modifier_impl name of PHP function to register
*/
function register_modifier($modifier, $modifier_impl)
{
$this->_plugins['modifier'][$modifier] =
array($modifier_impl, null, null, false);
}
/**
* Unregisters modifier
*
* @param string $modifier name of template modifier
*/
function unregister_modifier($modifier)
{
unset($this->_plugins['modifier'][$modifier]);
}
/**
* Registers a resource to fetch a template
*
* @param string $type name of resource
* @param array $functions array of functions to handle resource
*/
function register_resource($type, $functions)
{
if (count($functions)==4) {
$this->_plugins['resource'][$type] =
array($functions, false);
} elseif (count($functions)==5) {
$this->_plugins['resource'][$type] =
array(array(array(&$functions[0], $functions[1])
,array(&$functions[0], $functions[2])
,array(&$functions[0], $functions[3])
,array(&$functions[0], $functions[4]))
,false);
} else {
$this->trigger_error("malformed function-list for '$type' in register_resource");
}
}
/**
* Unregisters a resource
*
* @param string $type name of resource
*/
function unregister_resource($type)
{
unset($this->_plugins['resource'][$type]);
}
/**
* Registers a prefilter function to apply
* to a template before compiling
*
* @param callback $function
*/
function register_prefilter($function)
{
$this->_plugins['prefilter'][$this->_get_filter_name($function)]
= array($function, null, null, false);
}
/**
* Unregisters a prefilter function
*
* @param callback $function
*/
function unregister_prefilter($function)
{
unset($this->_plugins['prefilter'][$this->_get_filter_name($function)]);
}
/**
* Registers a postfilter function to apply
* to a compiled template after compilation
*
* @param callback $function
*/
function register_postfilter($function)
{
$this->_plugins['postfilter'][$this->_get_filter_name($function)]
= array($function, null, null, false);
}
/**
* Unregisters a postfilter function
*
* @param callback $function
*/
function unregister_postfilter($function)
{
unset($this->_plugins['postfilter'][$this->_get_filter_name($function)]);
}
/**
* Registers an output filter function to apply
* to a template output
*
* @param callback $function
*/
function register_outputfilter($function)
{
$this->_plugins['outputfilter'][$this->_get_filter_name($function)]
= array($function, null, null, false);
}
/**
* Unregisters an outputfilter function
*
* @param callback $function
*/
function unregister_outputfilter($function)
{
unset($this->_plugins['outputfilter'][$this->_get_filter_name($function)]);
}
/**
* load a filter of specified type and name
*
* @param string $type filter type
* @param string $name filter name
*/
function load_filter($type, $name)
{
switch ($type) {
case 'output':
$_params = array('plugins' => array(array($type . 'filter', $name, null, null, false)));
require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins($_params, $this);
break;
case 'pre':
case 'post':
if (!isset($this->_plugins[$type . 'filter'][$name]))
$this->_plugins[$type . 'filter'][$name] = false;
break;
}
}
/**
* 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
* @return boolean
*/
function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)
{
if (!isset($compile_id))
$compile_id = $this->compile_id;
if (!isset($tpl_file))
$compile_id = null;
$_auto_id = $this->_get_auto_id($cache_id, $compile_id);
if (!empty($this->cache_handler_func)) {
return call_user_func_array($this->cache_handler_func,
array('clear', &$this, &$dummy, $tpl_file, $cache_id, $compile_id, $exp_time));
} else {
$_params = array('auto_base' => $this->cache_dir,
'auto_source' => $tpl_file,
'auto_id' => $_auto_id,
'exp_time' => $exp_time);
require_once(SMARTY_CORE_DIR . 'core.rm_auto.php');
return smarty_core_rm_auto($_params, $this);
}
}
/**
* clear the entire contents of cache (all templates)
*
* @param string $exp_time expire time
* @return boolean results of {@link smarty_core_rm_auto()}
*/
function clear_all_cache($exp_time = null)
{
return $this->clear_cache(null, null, null, $exp_time);
}
/**
* 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
* @return string|false results of {@link _read_cache_file()}
*/
function is_cached($tpl_file, $cache_id = null, $compile_id = null)
{
if (!$this->caching)
return false;
if (!isset($compile_id))
$compile_id = $this->compile_id;
$_params = array(
'tpl_file' => $tpl_file,
'cache_id' => $cache_id,
'compile_id' => $compile_id
);
require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
return smarty_core_read_cache_file($_params, $this);
}
/**
* clear all the assigned template variables.
*
*/
function clear_all_assign()
{
$this->_tpl_vars = array();
}
/**
* clears compiled version of specified template resource,
* or all compiled template file
...
...
...