Page MenuHomeCode

No OneTemporary

This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/includes/Smarty/Smarty.class.php b/includes/Smarty/Smarty.class.php
deleted file mode 100644
index e5b857d..0000000
--- a/includes/Smarty/Smarty.class.php
+++ /dev/null
@@ -1,540 +0,0 @@
-<?php
-
-/**
-* Project: Smarty: the PHP compiling template engine
-* File: Smarty.class.php
-* SVN: $Id: Smarty.class.php 3351 2009-11-18 17:25:18Z Uwe.Tews $
-*
-* 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 2008 New Digital Group, Inc.
-* @author Monte Ohrt <monte at ohrt dot com>
-* @author Uwe Tews
-* @package Smarty
-* @version 3-SVN$Rev: 3286 $
-*/
-
-/**
-* define shorthand directory separator constant
-*/
-if (!defined('DS')) {
- define('DS', DIRECTORY_SEPARATOR);
-}
-
-/**
-* set SMARTY_DIR to absolute path to Smarty library files.
-* Sets SMARTY_DIR only if user application has not already defined it.
-*/
-if (!defined('SMARTY_DIR')) {
- define('SMARTY_DIR', dirname(__FILE__) . DS);
-}
-
-/**
-* set SMARTY_SYSPLUGINS_DIR to absolute path to Smarty internal plugins.
-* Sets SMARTY_SYSPLUGINS_DIR only if user application has not already defined it.
-*/
-if (!defined('SMARTY_SYSPLUGINS_DIR')) {
- define('SMARTY_SYSPLUGINS_DIR', SMARTY_DIR . 'sysplugins' . DS);
-}
-if (!defined('SMARTY_PLUGINS_DIR')) {
- define('SMARTY_PLUGINS_DIR', SMARTY_DIR . 'plugins' . DS);
-}
-if (!defined('SMARTY_RESOURCE_CHAR_SET')) {
- define('SMARTY_RESOURCE_CHAR_SET', 'UTF-8');
-}
-if (!defined('SMARTY_RESOURCE_DATE_FORMAT')) {
- define('SMARTY_RESOURCE_DATE_FORMAT', '%b %e, %Y');
-}
-
-/**
-* define variable scopes
-*/
-define('SMARTY_LOCAL_SCOPE', 0);
-define('SMARTY_PARENT_SCOPE', 1);
-define('SMARTY_ROOT_SCOPE', 2);
-define('SMARTY_GLOBAL_SCOPE', 3);
-
-/**
-* define caching modes
-*/
-define('SMARTY_CACHING_OFF', 0);
-define('SMARTY_CACHING_LIFETIME_CURRENT', 1);
-define('SMARTY_CACHING_LIFETIME_SAVED', 2);
-
-/**
-* This determines how Smarty handles "<?php ... ?>" tags in templates.
-* possible values:
-*/
-define('SMARTY_PHP_PASSTHRU', 0); //-> print tags as plain text
-define('SMARTY_PHP_QUOTE', 1); //-> escape tags as entities
-define('SMARTY_PHP_REMOVE', 2); //-> escape tags as entities
-define('SMARTY_PHP_ALLOW', 3); //-> escape tags as entities
-
-/**
-* register the class autoloader
-*/
-if (!defined('SMARTY_SPL_AUTOLOAD')) {
- define('SMARTY_SPL_AUTOLOAD', 0);
-}
-
-if (SMARTY_SPL_AUTOLOAD && set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false) {
- $registeredAutoLoadFunctions = spl_autoload_functions();
- if (!isset($registeredAutoLoadFunctions['spl_autoload'])) {
- spl_autoload_register();
- }
-} else {
- spl_autoload_register('smartyAutoload');
-}
-
-/**
-* This is the main Smarty class
-*/
-class Smarty extends Smarty_Internal_TemplateBase {
- // smarty version
- public static $_version = 'Smarty3-b5';
- // auto literal on delimiters with whitspace
- public $auto_literal = true;
- // display error on not assigned variables
- public $error_unassigned = false;
- // template directory
- public $template_dir = null;
- // default template handler
- public $default_template_handler_func = null;
- // compile directory
- public $compile_dir = null;
- // plugins directory
- public $plugins_dir = null;
- // cache directory
- public $cache_dir = null;
- // config directory
- public $config_dir = null;
- // force template compiling?
- public $force_compile = false;
- // check template for modifications?
- public $compile_check = true;
- // use sub dirs for compiled/cached files?
- public $use_sub_dirs = false;
- // compile_error?
- public $compile_error = false;
- // caching enabled
- public $caching = false;
- // merge compiled includea
- public $merge_compiled_includes = false;
- // cache lifetime
- public $cache_lifetime = 0;
- // force cache file creation
- public $force_cache = false;
- // cache_id
- public $cache_id = null;
- // compile_id
- public $compile_id = null;
- // template delimiters
- public $left_delimiter = "{";
- public $right_delimiter = "}";
- // security
- public $security_class = 'Smarty_Security';
- public $php_handling = SMARTY_PHP_PASSTHRU;
- public $allow_php_tag = false;
- public $allow_php_templates = false;
- public $security = false;
- public $security_policy = null;
- public $security_handler = null;
- public $direct_access_security = true;
- // debug mode
- public $debugging = false;
- public $debugging_ctrl = 'URL';
- public $smarty_debug_id = 'SMARTY_DEBUG';
- public $debug_tpl = null;
- // When set, smarty does uses this value as error_reporting-level.
- public $error_reporting = null;
- // config var settings
- 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_read_hidden = true; //Controls whether hidden config sections/vars are read from the file.
- // config vars
- public $config_vars = array();
- // assigned tpl vars
- public $tpl_vars = array();
- // assigned global tpl vars
- public $global_tpl_vars = array();
- // dummy parent object
- public $parent = null;
- // global template functions
- public $template_functions = null;
- // resource type used if none given
- public $default_resource_type = 'file';
- // caching type
- public $default_caching_type = 'file';
- // internal cache resource types
- public $cache_resorce_types = array('file');
- // config type
- public $default_config_type = 'file';
- // class used for cacher
- public $cacher_class = 'Smarty_Internal_Cacher_InlineCode';
- // exception handler: array('ExceptionClass','ExceptionMethod');
- public $exception_handler = null;
- // cached template objects
- public $template_objects = null;
- // check If-Modified-Since headers
- public $cache_modified_check = false;
- // cached objects
- public $resource_objects = array();
- // registered plugins
- public $registered_plugins = array();
- // plugin search order
- public $plugin_search_order = array('function', 'block', 'compiler', 'class');
- // plugin handler object
- public $plugin_handler = null;
- // default plugin handler
- public $default_plugin_handler_func = null;
- // registered objects
- public $registered_objects = array();
- // registered filters
- public $registered_filters = array();
- // filter handler
- public $filter_handler = null;
- // autoload filter
- public $autoload_filters = array();
- // status of filter on variable output
- public $variable_filter = true;
- // global internal smarty vars
- public $_smarty_vars = array();
- // start time for execution time calculation
- public $start_time = 0;
- // default file permissions
- public $_file_perms = 0644;
- // default dir permissions
- public $_dir_perms = 0771;
- // smarty object reference
- public $smarty = null;
-
- /**
- * Class constructor, initializes basic smarty properties
- */
- public function __construct()
- {
- // self reference needed by other classes methods
- $this->smarty = $this;
-
- if (is_callable('mb_internal_encoding')) {
- mb_internal_encoding(SMARTY_RESOURCE_CHAR_SET);
- }
- $this->start_time = $this->_get_time();
- // set exception handler
- if (!empty($this->exception_handler))
- set_exception_handler($this->exception_handler);
- // set default dirs
- $this->template_dir = array('.' . DS . 'templates' . DS);
- $this->compile_dir = '.' . DS . 'templates_c' . DS;
- $this->plugins_dir = array(SMARTY_PLUGINS_DIR);
- $this->cache_dir = '.' . DS . 'cache' . DS;
- $this->config_dir = '.' . DS . 'configs' . DS;
- $this->debug_tpl = SMARTY_DIR . 'debug.tpl';
- $this->plugin_handler = new Smarty_Internal_Plugin_Handler($this);
- $this->filter_handler = new Smarty_Internal_Run_Filter($this);
- if (!$this->debugging && $this->debugging_ctrl == 'URL') {
- if (isset($_SERVER['QUERY_STRING'])) {
- $_query_string = $_SERVER['QUERY_STRING'];
- } else {
- $_query_string = '';
- }
- if (false !== strpos($_query_string, $this->smarty_debug_id)) {
- if (false !== strpos($_query_string, $this->smarty_debug_id . '=on')) {
- // enable debugging for this browser session
- setcookie('SMARTY_DEBUG', true);
- $this->debugging = true;
- } elseif (false !== strpos($_query_string, $this->smarty_debug_id . '=off')) {
- // disable debugging for this browser session
- setcookie('SMARTY_DEBUG', false);
- $this->debugging = false;
- } else {
- // enable debugging for this page
- $this->debugging = true;
- }
- } else {
- if (isset($_COOKIE['SMARTY_DEBUG'])) {
- $this->debugging = true;
- }
- }
- }
- $this->assign_global('SCRIPT_NAME', $_SERVER['SCRIPT_NAME']);
- }
-
- /**
- * Class destructor
- */
- public function __destruct()
- {
- // restore to previous exception handler, if any
- if (!empty($this->exception_handler))
- restore_exception_handler();
- }
-
- /**
- * fetches a rendered Smarty template
- *
- * @param string $template the resource handle of the template file or template object
- * @param mixed $cache_id cache id to be used with this template
- * @param mixed $compile_id compile id to be used with this template
- * @param object $ |null $parent next higher level of Smarty variables
- * @return string rendered template output
- */
- public function fetch($template, $cache_id = null, $compile_id = null, $parent = null)
- {
- if (is_object($cache_id)) {
- $parent = $cache_id;
- $cache_id = null;
- }
- if ($parent === null) {
- // get default Smarty data object
- $parent = $this;
- }
- // create template object if necessary
- ($template instanceof $this->template_class)? $_template = $template :
- $_template = $this->createTemplate ($template, $cache_id, $compile_id, $parent);
- $_smarty_old_error_level = $this->debugging ? error_reporting() : error_reporting(isset($this->error_reporting)
- ? $this->error_reporting : error_reporting() &~E_NOTICE);
- // return redered template
- if (isset($this->autoload_filters['output']) || isset($this->registered_filters['output'])) {
- $_output = $this->filter_handler->execute('output', $_template->getRenderedTemplate());
- } else {
- $_output = $_template->getRenderedTemplate();
- }
- $_template->rendered_content = null;
- error_reporting($_smarty_old_error_level);
- return $_output;
- }
-
- /**
- * displays a Smarty template
- *
- * @param string $ |object $template the resource handle of the template file or template object
- * @param mixed $cache_id cache id to be used with this template
- * @param mixed $compile_id compile id to be used with this template
- * @param object $parent next higher level of Smarty variables
- */
- public function display($template, $cache_id = null, $compile_id = null, $parent = null)
- {
- // display template
- echo $this->fetch ($template, $cache_id, $compile_id, $parent);
- // debug output
- if ($this->debugging) {
- Smarty_Internal_Debug::display_debug($this);
- }
- return true;
- }
-
- /**
- * test if cache i valid
- *
- * @param string $ |object $template the resource handle of the template file or template object
- * @param mixed $cache_id cache id to be used with this template
- * @param mixed $compile_id compile id to be used with this template
- * @return boolean cache status
- */
- public function is_cached($template, $cache_id = null, $compile_id = null)
- {
- if (!($template instanceof $this->template_class)) {
- $template = $this->createTemplate ($template, $cache_id, $compile_id, $this);
- }
- // return cache status of template
- return $template->isCached();
- }
-
- /**
- * Loads security class and enables security
- */
- public function enableSecurity()
- {
- if (isset($this->security_class)) {
- $this->security_policy = new $this->security_class;
- $this->security_handler = new Smarty_Internal_Security_Handler($this);
- $this->security = true;
- } else {
- throw new Exception('Property security_class is not defined');
- }
- }
-
- /**
- * Set template directory
- *
- * @param string $ |array $template_dir folder(s) of template sorces
- */
- public function setTemplateDir($template_dir)
- {
- $this->template_dir = (array)$template_dir;
- return;
- }
- /**
- * Adds template directory(s) to existing ones
- *
- * @param string $ |array $template_dir folder(s) of template sources
- */
- public function addTemplateDir($template_dir)
- {
- $this->template_dir = array_merge((array)$this->template_dir, (array)$template_dir);
- $this->template_dir = array_unique($this->template_dir);
- return;
- }
- /**
- * Set compile directory
- *
- * @param string $compile_dir folder of compiled template sources
- */
- public function setCompileDir($compile_dir)
- {
- $this->compile_dir = $compile_dir;
- return;
- }
- /**
- * Set cache directory
- *
- * @param string $cache_dir folder of cache files
- */
- public function setCacheDir($cache_dir)
- {
- $this->cache_dir = $cache_dir;
- return;
- }
- /**
- * Enable Caching
- */
- public function enableCaching()
- {
- $this->caching = true;
- return;
- }
- /**
- * Set caching life time
- *
- * @param integer $lifetime lifetime of cached file in seconds
- */
- public function setCacheLifetime($lifetime)
- {
- $this->cache_lifetime = $lifetime;
- return;
- }
- /**
- * Takes unknown classes and loads plugin files for them
- * class name format: Smarty_PluginType_PluginName
- * plugin filename format: plugintype.pluginname.php
- *
- * @param string $plugin_name class plugin name to load
- * @return boolean
- */
- public function loadPlugin($plugin_name)
- {
- // if class exists, exit silently (already loaded)
- if (class_exists($plugin_name, false))
- return true;
- // if callable as function, exit silently (already loaded)
- if (is_callable($plugin_name))
- return true;
- // Plugin name is expected to be: Smarty_[Type]_[Name]
- $_plugin_name = strtolower($plugin_name);
- $_name_parts = explode('_', $_plugin_name, 3);
- // class name must have three parts to be valid plugin
- if (count($_name_parts) < 3 || $_name_parts[0] !== 'smarty') {
- throw new Exception("plugin {$plugin_name} is not a valid name format");
- return false;
- }
- // if type is "internal", get plugin from sysplugins
- if ($_name_parts[1] == 'internal') {
- if (file_exists(SMARTY_SYSPLUGINS_DIR . $_plugin_name . '.php')) {
- require_once(SMARTY_SYSPLUGINS_DIR . $_plugin_name . '.php');
- return true;
- } else {
- return false;
- }
- }
- // plugin filename is expected to be: [type].[name].php
- $_plugin_filename = "{$_name_parts[1]}.{$_name_parts[2]}.php";
- // loop through plugin dirs and find the plugin
- foreach((array)$this->plugins_dir as $_plugin_dir) {
- if (strpos('/\\', substr($_plugin_dir, -1)) === false) {
- $_plugin_dir .= DS;
- }
-
- if (file_exists($_plugin_dir . $_plugin_filename)) {
- require_once($_plugin_dir . $_plugin_filename);
- return true;
- }
- }
- // no plugin loaded
- return false;
- }
-
- /**
- * Sets the exception handler for Smarty.
- *
- * @param mixed $handler function name or array with object/method names
- * @return string previous exception handler
- */
- public function setExceptionHandler($handler)
- {
- $this->exception_handler = $handler;
- return set_exception_handler($handler);
- }
-
- /**
- * trigger Smarty error
- *
- * @param string $error_msg
- * @param integer $error_type
- */
- public function trigger_error($error_msg, $error_type = E_USER_WARNING)
- {
- throw new Exception("Smarty error: $error_msg");
- }
-
- /**
- * Takes unknown class methods and lazy loads sysplugin files for them
- * class name format: Smarty_Method_MethodName
- * plugin filename format: method.methodname.php
- *
- * @param string $name unknown methode name
- * @param array $args aurgument array
- */
- public function __call($name, $args)
- {
- $name = strtolower($name);
- if ($name == 'smarty') {
- throw new Exception('Please use parent::__construct() to call parent constuctor');
- }
- $function_name = 'smarty_method_' . $name;
- if (!is_callable($function_name)) {
- if (!file_exists(SMARTY_SYSPLUGINS_DIR . $function_name . '.php')) {
- throw new Exception('Undefined Smarty method "' . $name . '"');
- }
- require_once(SMARTY_SYSPLUGINS_DIR . $function_name . '.php');
- }
- return call_user_func_array($function_name, array_merge(array($this), $args));
- }
-}
-
-function smartyAutoload($class)
-{
- $_class = strtolower($class);
- if (substr($_class, 0, 16) === 'smarty_internal_' || $_class == 'smarty_security') {
- include SMARTY_SYSPLUGINS_DIR . $_class . '.php';
- }
-}
-
-?>
diff --git a/includes/Smarty/SmartyBC.class.php b/includes/Smarty/SmartyBC.class.php
new file mode 100755
index 0000000..f8f0a13
--- /dev/null
+++ b/includes/Smarty/SmartyBC.class.php
@@ -0,0 +1,460 @@
+<?php
+/**
+ * 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/
+ * @copyright 2008 New Digital Group, Inc.
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author Uwe Tews
+ * @author Rodney Rehm
+ * @package Smarty
+ */
+/**
+ * @ignore
+ */
+require(dirname(__FILE__) . '/Smarty.class.php');
+
+/**
+ * Smarty Backward Compatability Wrapper Class
+ *
+ * @package Smarty
+ */
+class SmartyBC extends Smarty {
+
+ /**
+ * Smarty 2 BC
+ * @var string
+ */
+ public $_version = self::SMARTY_VERSION;
+
+ /**
+ * Initialize new SmartyBC object
+ *
+ * @param array $options options to set during initialization, e.g. array( 'forceCompile' => false )
+ */
+ public function __construct(array $options=array())
+ {
+ parent::__construct($options);
+ // register {php} tag
+ $this->registerPlugin('block', 'php', 'smarty_php_tag');
+ }
+
+ /**
+ * wrapper for assign_by_ref
+ *
+ * @param string $tpl_var the template variable name
+ * @param mixed &$value the referenced value to assign
+ */
+ public function assign_by_ref($tpl_var, &$value)
+ {
+ $this->assignByRef($tpl_var, $value);
+ }
+
+ /**
+ * wrapper for append_by_ref
+ *
+ * @param string $tpl_var the template variable name
+ * @param mixed &$value the referenced value to append
+ * @param boolean $merge flag if array elements shall be merged
+ */
+ public function append_by_ref($tpl_var, &$value, $merge = false)
+ {
+ $this->appendByRef($tpl_var, $value, $merge);
+ }
+
+ /**
+ * clear the given assigned template variable.
+ *
+ * @param string $tpl_var the template variable to clear
+ */
+ public function clear_assign($tpl_var)
+ {
+ $this->clearAssign($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
+ * @param bool $cacheable
+ * @param mixed $cache_attrs
+ */
+ public function register_function($function, $function_impl, $cacheable=true, $cache_attrs=null)
+ {
+ $this->registerPlugin('function', $function, $function_impl, $cacheable, $cache_attrs);
+ }
+
+ /**
+ * Unregisters custom function
+ *
+ * @param string $function name of template function
+ */
+ public function unregister_function($function)
+ {
+ $this->unregisterPlugin('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 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
+ */
+ public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
+ {
+ settype($allowed, 'array');
+ settype($smarty_args, 'boolean');
+ $this->registerObject($object, $object_impl, $allowed, $smarty_args, $block_methods);
+ }
+
+ /**
+ * Unregisters object
+ *
+ * @param string $object name of template object
+ */
+ public function unregister_object($object)
+ {
+ $this->unregisterObject($object);
+ }
+
+ /**
+ * Registers block function to be used in templates
+ *
+ * @param string $block name of template block
+ * @param string $block_impl PHP function to register
+ * @param bool $cacheable
+ * @param mixed $cache_attrs
+ */
+ public function register_block($block, $block_impl, $cacheable=true, $cache_attrs=null)
+ {
+ $this->registerPlugin('block', $block, $block_impl, $cacheable, $cache_attrs);
+ }
+
+ /**
+ * Unregisters block function
+ *
+ * @param string $block name of template function
+ */
+ public function unregister_block($block)
+ {
+ $this->unregisterPlugin('block', $block);
+ }
+
+ /**
+ * Registers compiler function
+ *
+ * @param string $function name of template function
+ * @param string $function_impl name of PHP function to register
+ * @param bool $cacheable
+ */
+ public function register_compiler_function($function, $function_impl, $cacheable=true)
+ {
+ $this->registerPlugin('compiler', $function, $function_impl, $cacheable);
+ }
+
+ /**
+ * Unregisters compiler function
+ *
+ * @param string $function name of template function
+ */
+ public function unregister_compiler_function($function)
+ {
+ $this->unregisterPlugin('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
+ */
+ public function register_modifier($modifier, $modifier_impl)
+ {
+ $this->registerPlugin('modifier', $modifier, $modifier_impl);
+ }
+
+ /**
+ * Unregisters modifier
+ *
+ * @param string $modifier name of template modifier
+ */
+ public function unregister_modifier($modifier)
+ {
+ $this->unregisterPlugin('modifier', $modifier);
+ }
+
+ /**
+ * Registers a resource to fetch a template
+ *
+ * @param string $type name of resource
+ * @param array $functions array of functions to handle resource
+ */
+ public function register_resource($type, $functions)
+ {
+ $this->registerResource($type, $functions);
+ }
+
+ /**
+ * Unregisters a resource
+ *
+ * @param string $type name of resource
+ */
+ public function unregister_resource($type)
+ {
+ $this->unregisterResource($type);
+ }
+
+ /**
+ * Registers a prefilter function to apply
+ * to a template before compiling
+ *
+ * @param callable $function
+ */
+ public function register_prefilter($function)
+ {
+ $this->registerFilter('pre', $function);
+ }
+
+ /**
+ * Unregisters a prefilter function
+ *
+ * @param callable $function
+ */
+ public function unregister_prefilter($function)
+ {
+ $this->unregisterFilter('pre', $function);
+ }
+
+ /**
+ * Registers a postfilter function to apply
+ * to a compiled template after compilation
+ *
+ * @param callable $function
+ */
+ public function register_postfilter($function)
+ {
+ $this->registerFilter('post', $function);
+ }
+
+ /**
+ * Unregisters a postfilter function
+ *
+ * @param callable $function
+ */
+ public function unregister_postfilter($function)
+ {
+ $this->unregisterFilter('post', $function);
+ }
+
+ /**
+ * Registers an output filter function to apply
+ * to a template output
+ *
+ * @param callable $function
+ */
+ public function register_outputfilter($function)
+ {
+ $this->registerFilter('output', $function);
+ }
+
+ /**
+ * Unregisters an outputfilter function
+ *
+ * @param callable $function
+ */
+ public function unregister_outputfilter($function)
+ {
+ $this->unregisterFilter('output', $function);
+ }
+
+ /**
+ * load a filter of specified type and name
+ *
+ * @param string $type filter type
+ * @param string $name filter name
+ */
+ public function load_filter($type, $name)
+ {
+ $this->loadFilter($type, $name);
+ }
+
+ /**
+ * 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
+ */
+ public function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)
+ {
+ return $this->clearCache($tpl_file, $cache_id, $compile_id, $exp_time);
+ }
+
+ /**
+ * clear the entire contents of cache (all templates)
+ *
+ * @param string $exp_time expire time
+ * @return boolean
+ */
+ public function clear_all_cache($exp_time = null)
+ {
+ return $this->clearCache(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 boolean
+ */
+ public function is_cached($tpl_file, $cache_id = null, $compile_id = null)
+ {
+ return $this->isCached($tpl_file, $cache_id, $compile_id);
+ }
+
+ /**
+ * clear all the assigned template variables.
+ */
+ public function clear_all_assign()
+ {
+ $this->clearAllAssign();
+ }
+
+ /**
+ * clears compiled version of specified template resource,
+ * 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
+ * @return boolean results of {@link smarty_core_rm_auto()}
+ */
+ public function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)
+ {
+ return $this->clearCompiledTemplate($tpl_file, $compile_id, $exp_time);
+ }
+
+ /**
+ * Checks whether requested template exists.
+ *
+ * @param string $tpl_file
+ * @return boolean
+ */
+ public function template_exists($tpl_file)
+ {
+ return $this->templateExists($tpl_file);
+ }
+
+ /**
+ * Returns an array containing template variables
+ *
+ * @param string $name
+ * @return array
+ */
+ public function get_template_vars($name=null)
+ {
+ return $this->getTemplateVars($name);
+ }
+
+ /**
+ * Returns an array containing config variables
+ *
+ * @param string $name
+ * @return array
+ */
+ public function get_config_vars($name=null)
+ {
+ return $this->getConfigVars($name);
+ }
+
+ /**
+ * load configuration values
+ *
+ * @param string $file
+ * @param string $section
+ * @param string $scope
+ */
+ public function config_load($file, $section = null, $scope = 'global')
+ {
+ $this->ConfigLoad($file, $section, $scope);
+ }
+
+ /**
+ * return a reference to a registered object
+ *
+ * @param string $name
+ * @return object
+ */
+ public function get_registered_object($name)
+ {
+ return $this->getRegisteredObject($name);
+ }
+
+ /**
+ * clear configuration values
+ *
+ * @param string $var
+ */
+ public function clear_config($var = null)
+ {
+ $this->clearConfig($var);
+ }
+
+ /**
+ * trigger Smarty error
+ *
+ * @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
diff --git a/includes/Smarty/debug.tpl b/includes/Smarty/debug.tpl
deleted file mode 100644
index 9fd46b1..0000000
--- a/includes/Smarty/debug.tpl
+++ /dev/null
@@ -1,136 +0,0 @@
-{capture assign=debug_output}
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-<head>
- <title>Smarty Debug Console</title>
-<style type="text/css">
-{literal}
-body, h1, h2, td, th, p {
- font-family: sans-serif;
- font-weight: normal;
- font-size: 0.9em;
- margin: 1px;
- padding: 0;
-}
-
-h1 {
- margin: 0;
- text-align: left;
- padding: 2px;
- background-color: #f0c040;
- color: black;
- font-weight: bold;
- font-size: 1.2em;
- }
-
-h2 {
- background-color: #9B410E;
- color: white;
- text-align: left;
- font-weight: bold;
- padding: 2px;
- border-top: 1px solid black;
-}
-
-body {
- background: black;
-}
-
-p, table, div {
- background: #f0ead8;
-}
-
-p {
- margin: 0;
- font-style: italic;
- text-align: center;
-}
-
-table {
- width: 100%;
-}
-
-th, td {
- font-family: monospace;
- vertical-align: top;
- text-align: left;
- width: 50%;
-}
-
-td {
- color: green;
-}
-
-.odd {
- background-color: #eeeeee;
-}
-
-.even {
- background-color: #fafafa;
-}
-
-.exectime {
- font-size: 0.8em;
- font-style: italic;
-}
-
-#table_assigned_vars th {
- color: blue;
-}
-
-#table_config_vars th {
- color: maroon;
-}
-{/literal}
-</style>
-</head>
-<body>
-
-<h1>Smarty Debug Console - Total Time {$execution_time|string_format:"%.5f"}</h1>
-
-<h2>included templates &amp; config files (load time in seconds)</h2>
-
-<div>
-{foreach $template_data as $template}
- <font color=brown>{$template.name}</font>
- <span class="exectime">
- (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"})
- </span>
- <br>
-{/foreach}
-</div>
-
-<h2>assigned template variables</h2>
-
-<table id="table_assigned_vars">
- {foreach $assigned_vars as $vars}
- <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
- <th>${$vars@key|escape:'html'}</th>
- <td>{$vars|debug_print_var}</td></tr>
- {/foreach}
-</table>
-
-<h2>assigned config file variables (outer template scope)</h2>
-
-<table id="table_config_vars">
- {foreach $config_vars as $vars}
- <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
- <th>{$vars@key|escape:'html'}</th>
- <td>{$vars|debug_print_var}</td></tr>
- {/foreach}
-
-</table>
-</body>
-</html>
-{/capture}
-<script type="text/javascript">
-{literal} if ( self.name == '' ) {
- var title = 'Console';
- }
- else {
- var title = 'Console_' + self.name;
- }{/literal}
- _smarty_console = window.open("",title.value,"width=680,height=600,resizable,scrollbars=yes");
- _smarty_console.document.write("{$debug_output|escape:'javascript'}");
- _smarty_console.document.close();
-</script>
diff --git a/includes/Smarty/plugins/block.php.php b/includes/Smarty/plugins/block.php.php
deleted file mode 100644
index 362ec9c..0000000
--- a/includes/Smarty/plugins/block.php.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-/**
-* Smarty plugin to execute PHP code
-*
-* @package Smarty
-* @subpackage PluginsBlock
-* @author Uwe Tews
-*/
-
-/**
-* Smarty {php}{/php} block plugin
-*
-* @param string $content contents of the block
-* @param object $smarty Smarty object
-* @param boolean $ &$repeat repeat flag
-* @param object $template template object
-* @return string content re-formatted
-*/
-function smarty_block_php($params, $content, $smarty, &$repeat, $template)
-{
- // get security settings
- if ($template->security && isset($smarty->security_handler)) {
- $sec_obj = $smarty->security_policy;
- } else {
- $sec_obj = $smarty;
- }
- if (is_null($content)) {
- if (!$smarty->allow_php_tag) {
- trigger_error("{php} is deprecated, set allow_php_tag = true to enable", E_USER_WARNING);
- }
- return;
- }
-
- eval($content);
-
- return '';
-}
-
-?>
diff --git a/includes/Smarty/plugins/block.textformat.php b/includes/Smarty/plugins/block.textformat.php
deleted file mode 100644
index f578bfb..0000000
--- a/includes/Smarty/plugins/block.textformat.php
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-/**
-* Smarty plugin to format text blocks
-*
-* @package Smarty
-* @subpackage PluginsBlock
-*/
-
-/**
-* Smarty {textformat}{/textformat} block plugin
-*
-* Type: block function<br>
-* Name: textformat<br>
-* Purpose: format text a certain way with preset styles
-* or custom wrap/indent settings<br>
-*
-* @link http://smarty.php.net/manual/en/language.function.textformat.php {textformat}
- (Smarty online manual)
-* @param array $params parameters
-* <pre>
-* Params: style: string (email)
-* indent: integer (0)
-* wrap: integer (80)
-* wrap_char string ("\n")
-* indent_char: string (" ")
-* wrap_boundary: boolean (true)
-* </pre>
-* @author Monte Ohrt <monte at ohrt dot com>
-* @param string $content contents of the block
-* @param object $smarty Smarty object
-* @param boolean &$repeat repeat flag
-* @param object $template template object
-* @return string content re-formatted
-*/
-function smarty_block_textformat($params, $content, $smarty, &$repeat, $template)
-{
- if (is_null($content)) {
- return;
- }
-
- $style = null;
- $indent = 0;
- $indent_first = 0;
- $indent_char = ' ';
- $wrap = 80;
- $wrap_char = "\n";
- $wrap_cut = false;
- $assign = null;
-
- foreach ($params as $_key => $_val) {
- switch ($_key) {
- case 'style':
- case 'indent_char':
- case 'wrap_char':
- case 'assign':
- $$_key = (string)$_val;
- break;
-
- case 'indent':
- case 'indent_first':
- case 'wrap':
- $$_key = (int)$_val;
- break;
-
- case 'wrap_cut':
- $$_key = (bool)$_val;
- break;
-
- default:
- $smarty->trigger_error("textformat: unknown attribute '$_key'");
- }
- }
-
- if ($style == 'email') {
- $wrap = 72;
- }
- // split into paragraphs
- $_paragraphs = preg_split('![\r\n][\r\n]!', $content);
- $_output = '';
-
- for($_x = 0, $_y = count($_paragraphs); $_x < $_y; $_x++) {
- if ($_paragraphs[$_x] == '') {
- continue;
- }
- // convert mult. spaces & special chars to single space
- $_paragraphs[$_x] = preg_replace(array('!\s+!', '!(^\s+)|(\s+$)!'), array(' ', ''), $_paragraphs[$_x]);
- // indent first line
- if ($indent_first > 0) {
- $_paragraphs[$_x] = str_repeat($indent_char, $indent_first) . $_paragraphs[$_x];
- }
- // wordwrap sentences
- $_paragraphs[$_x] = wordwrap($_paragraphs[$_x], $wrap - $indent, $wrap_char, $wrap_cut);
- // indent lines
- if ($indent > 0) {
- $_paragraphs[$_x] = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraphs[$_x]);
- }
- }
- $_output = implode($wrap_char . $wrap_char, $_paragraphs);
-
- return $assign ? $template->assign($assign, $_output) : $_output;
-}
-
-?>
diff --git a/includes/Smarty/plugins/function.counter.php b/includes/Smarty/plugins/function.counter.php
deleted file mode 100644
index 88e49d8..0000000
--- a/includes/Smarty/plugins/function.counter.php
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsFunction
- */
-
-
-/**
- * Smarty {counter} function plugin
- *
- * Type: function<br>
- * Name: counter<br>
- * Purpose: print out a counter value
- * @author Monte Ohrt <monte at ohrt dot com>
- * @link http://smarty.php.net/manual/en/language.function.counter.php {counter}
- * (Smarty online manual)
- * @param array $params parameters
- * @param object $smarty Smarty object
- * @param object $template template object
- * @return string|null
- */
-function smarty_function_counter($params, $smarty, $template)
-{
-
- $name = (isset($params['name'])) ? $params['name'] : 'default';
- if (!isset($template->plugin_data['counter'][$name])) {
- $template->plugin_data['counter'][$name] = array(
- 'start'=>1,
- 'skip'=>1,
- 'direction'=>'up',
- 'count'=>1
- );
- }
- $counter = &$template->plugin_data['counter'][$name];
-
- if (isset($params['start'])) {
- $counter['start'] = $counter['count'] = (int)$params['start'];
- }
-
- if (!empty($params['assign'])) {
- $counter['assign'] = $params['assign'];
- }
-
- if (isset($counter['assign'])) {
- $template->assign($counter['assign'], $counter['count']);
- }
-
- if (isset($params['print'])) {
- $print = (bool)$params['print'];
- } else {
- $print = empty($counter['assign']);
- }
-
- if ($print) {
- $retval = $counter['count'];
- } else {
- $retval = null;
- }
-
- if (isset($params['skip'])) {
- $counter['skip'] = $params['skip'];
- }
-
- if (isset($params['direction'])) {
- $counter['direction'] = $params['direction'];
- }
-
- if ($counter['direction'] == "down")
- $counter['count'] -= $counter['skip'];
- else
- $counter['count'] += $counter['skip'];
-
- return $retval;
-
-}
-
-?>
diff --git a/includes/Smarty/plugins/function.cycle.php b/includes/Smarty/plugins/function.cycle.php
deleted file mode 100644
index e93a040..0000000
--- a/includes/Smarty/plugins/function.cycle.php
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsFunction
- */
-
-/**
- * Smarty {cycle} function plugin
- *
- * Type: function<br>
- * Name: cycle<br>
- * Date: May 3, 2002<br>
- * Purpose: cycle through given values<br>
- *
- * Examples:<br>
- * <pre>
- * {cycle values="#eeeeee,#d0d0d0d"}
- * {cycle name=row values="one,two,three" reset=true}
- * {cycle name=row}
- * </pre>
- * @link http://smarty.php.net/manual/en/language.function.cycle.php {cycle}
- * (Smarty online manual)
- * @author Monte Ohrt <monte at ohrt dot com>
- * @author credit to Mark Priatel <mpriatel@rogers.com>
- * @author credit to Gerard <gerard@interfold.com>
- * @author credit to Jason Sweat <jsweat_php@yahoo.com>
- * @param array $params parameters
- * Input:
- * - name = name of cycle (optional)
- * - values = comma separated list of values to cycle,
- * or an array of values to cycle
- * (this can be left out for subsequent calls)
- * - reset = boolean - resets given var to true
- * - print = boolean - print var or not. default is true
- * - advance = boolean - whether or not to advance the cycle
- * - delimiter = the value delimiter, default is ","
- * - assign = boolean, assigns to template var instead of
- * printed.
- * @param object $smarty Smarty object
- * @param object $template template object
- * @return string|null
- */
-function smarty_function_cycle($params, $smarty, $template)
-{
- $name = (empty($params['name'])) ? 'default' : $params['name'];
- $print = (isset($params['print'])) ? (bool)$params['print'] : true;
- $advance = (isset($params['advance'])) ? (bool)$params['advance'] : true;
- $reset = (isset($params['reset'])) ? (bool)$params['reset'] : false;
-
- if (!in_array('values', array_keys($params))) {
- if(!isset($template->plugin_data['cycle'][$name]['values'])) {
- throw new Exception ("cycle: missing 'values' parameter");
- return;
- }
- } else {
- if(isset($template->plugin_data['cycle'][$name]['values'])
- && $template->plugin_data['cycle'][$name]['values'] != $params['values'] ) {
- $template->plugin_data['cycle'][$name]['index'] = 0;
- }
- $template->plugin_data['cycle'][$name]['values'] = $params['values'];
- }
-
- if (isset($params['delimiter'])) {
- $template->plugin_data['cycle'][$name]['delimiter'] = $params['delimiter'];
- } elseif (!isset($template->plugin_data['cycle'][$name]['delimiter'])) {
- $template->plugin_data['cycle'][$name]['delimiter'] = ',';
- }
-
- if(is_array($template->plugin_data['cycle'][$name]['values'])) {
- $cycle_array = $template->plugin_data['cycle'][$name]['values'];
- } else {
- $cycle_array = explode($template->plugin_data['cycle'][$name]['delimiter'],$template->plugin_data['cycle'][$name]['values']);
- }
-
- if(!isset($template->plugin_data['cycle'][$name]['index']) || $reset ) {
- $template->plugin_data['cycle'][$name]['index'] = 0;
- }
-
- if (isset($params['assign'])) {
- $print = false;
- $template->assign($params['assign'], $cycle_array[$template->plugin_data['cycle'][$name]['index']]);
- }
-
- if($print) {
- $retval = $cycle_array[$template->plugin_data['cycle'][$name]['index']];
- } else {
- $retval = null;
- }
-
- if($advance) {
- if ( $template->plugin_data['cycle'][$name]['index'] >= count($cycle_array) -1 ) {
- $template->plugin_data['cycle'][$name]['index'] = 0;
- } else {
- $template->plugin_data['cycle'][$name]['index']++;
- }
- }
-
- return $retval;
-}
-?>
diff --git a/includes/Smarty/plugins/function.fetch.php b/includes/Smarty/plugins/function.fetch.php
deleted file mode 100644
index 958d2ef..0000000
--- a/includes/Smarty/plugins/function.fetch.php
+++ /dev/null
@@ -1,217 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsFunction
- */
-
-
-/**
- * Smarty {fetch} plugin
- *
- * Type: function<br>
- * Name: fetch<br>
- * Purpose: fetch file, web or ftp data and display results
- * @link http://smarty.php.net/manual/en/language.function.fetch.php {fetch}
- * (Smarty online manual)
- * @author Monte Ohrt <monte at ohrt dot com>
- * @param array $params parameters
- * @param object $smarty Smarty object
- * @param object $template template object
- * @return string|null if the assign parameter is passed, Smarty assigns the
- * result to a template variable
- */
-function smarty_function_fetch($params, $smarty, $template)
-{
- if (empty($params['file'])) {
- throw new Exception ("[plugin] fetch parameter 'file' cannot be empty");
- return;
- }
-
- $content = '';
- if ($template->security && !preg_match('!^(http|ftp)://!i', $params['file'])) {
- if(!$smarty->security_handler->isTrustedResourceDir($params['file'])) {
- return;
- }
-
- // fetch the file
- if($fp = @fopen($params['file'],'r')) {
- while(!feof($fp)) {
- $content .= fgets ($fp,4096);
- }
- fclose($fp);
- } else {
- throw new Exception ('[plugin] fetch cannot read file \'' . $params['file'] . '\'');
- return;
- }
- } else {
- // not a local file
- if(preg_match('!^http://!i',$params['file'])) {
- // http fetch
- if($uri_parts = parse_url($params['file'])) {
- // set defaults
- $host = $server_name = $uri_parts['host'];
- $timeout = 30;
- $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*";
- $agent = "Smarty Template Engine ".$smarty->_version;
- $referer = "";
- $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/';
- $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : '';
- $_is_proxy = false;
- if(empty($uri_parts['port'])) {
- $port = 80;
- } else {
- $port = $uri_parts['port'];
- }
- if(!empty($uri_parts['user'])) {
- $user = $uri_parts['user'];
- }
- if(!empty($uri_parts['pass'])) {
- $pass = $uri_parts['pass'];
- }
- // loop through parameters, setup headers
- foreach($params as $param_key => $param_value) {
- switch($param_key) {
- case "file":
- case "assign":
- case "assign_headers":
- break;
- case "user":
- if(!empty($param_value)) {
- $user = $param_value;
- }
- break;
- case "pass":
- if(!empty($param_value)) {
- $pass = $param_value;
- }
- break;
- case "accept":
- if(!empty($param_value)) {
- $accept = $param_value;
- }
- break;
- case "header":
- if(!empty($param_value)) {
- if(!preg_match('![\w\d-]+: .+!',$param_value)) {
- throw new Exception ("[plugin] invalid header format '".$param_value."'");
- return;
- } else {
- $extra_headers[] = $param_value;
- }
- }
- break;
- case "proxy_host":
- if(!empty($param_value)) {
- $proxy_host = $param_value;
- }
- break;
- case "proxy_port":
- if(!preg_match('!\D!', $param_value)) {
- $proxy_port = (int) $param_value;
- } else {
- throw new Exception ("[plugin] invalid value for attribute '".$param_key."'");
- return;
- }
- break;
- case "agent":
- if(!empty($param_value)) {
- $agent = $param_value;
- }
- break;
- case "referer":
- if(!empty($param_value)) {
- $referer = $param_value;
- }
- break;
- case "timeout":
- if(!preg_match('!\D!', $param_value)) {
- $timeout = (int) $param_value;
- } else {
- throw new Exception ("[plugin] invalid value for attribute '".$param_key."'");
- return;
- }
- break;
- default:
- throw new Exception ("[plugin] unrecognized attribute '".$param_key."'");
- return;
- }
- }
- if(!empty($proxy_host) && !empty($proxy_port)) {
- $_is_proxy = true;
- $fp = fsockopen($proxy_host,$proxy_port,$errno,$errstr,$timeout);
- } else {
- $fp = fsockopen($server_name,$port,$errno,$errstr,$timeout);
- }
-
- if(!$fp) {
- throw new Exception ("[plugin] unable to fetch: $errstr ($errno)");
- return;
- } else {
- if($_is_proxy) {
- fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n");
- } else {
- fputs($fp, "GET $uri HTTP/1.0\r\n");
- }
- if(!empty($host)) {
- fputs($fp, "Host: $host\r\n");
- }
- if(!empty($accept)) {
- fputs($fp, "Accept: $accept\r\n");
- }
- if(!empty($agent)) {
- fputs($fp, "User-Agent: $agent\r\n");
- }
- if(!empty($referer)) {
- fputs($fp, "Referer: $referer\r\n");
- }
- if(isset($extra_headers) && is_array($extra_headers)) {
- foreach($extra_headers as $curr_header) {
- fputs($fp, $curr_header."\r\n");
- }
- }
- if(!empty($user) && !empty($pass)) {
- fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n");
- }
-
- fputs($fp, "\r\n");
- while(!feof($fp)) {
- $content .= fgets($fp,4096);
- }
- fclose($fp);
- $csplit = preg_split("!\r\n\r\n!",$content,2);
-
- $content = $csplit[1];
-
- if(!empty($params['assign_headers'])) {
- $template->assign($params['assign_headers'],preg_split("!\r\n!",$csplit[0]));
- }
- }
- } else {
- throw new Exception ("[plugin] unable to parse URL, check syntax");
- return;
- }
- } else {
- // ftp fetch
- if($fp = @fopen($params['file'],'r')) {
- while(!feof($fp)) {
- $content .= fgets ($fp,4096);
- }
- fclose($fp);
- } else {
- throw new Exception ('[plugin] fetch cannot read file \'' . $params['file'] .'\'');
- return;
- }
- }
-
- }
-
-
- if (!empty($params['assign'])) {
- $template->assign($params['assign'],$content);
- } else {
- return $content;
- }
-}
-
-?>
diff --git a/includes/Smarty/plugins/function.html_checkboxes.php b/includes/Smarty/plugins/function.html_checkboxes.php
deleted file mode 100644
index 0e04f6e..0000000
--- a/includes/Smarty/plugins/function.html_checkboxes.php
+++ /dev/null
@@ -1,145 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsFunction
- */
-
-
-/**
- * Smarty {html_checkboxes} function plugin
- *
- * File: function.html_checkboxes.php<br>
- * Type: function<br>
- * Name: html_checkboxes<br>
- * Date: 24.Feb.2003<br>
- * Purpose: Prints out a list of checkbox input types<br>
- * Examples:
- * <pre>
- * {html_checkboxes values=$ids output=$names}
- * {html_checkboxes values=$ids name='box' separator='<br>' output=$names}
- * {html_checkboxes values=$ids checked=$checked separator='<br>' output=$names}
- * </pre>
- * @link http://smarty.php.net/manual/en/language.function.html.checkboxes.php {html_checkboxes}
- * (Smarty online manual)
- * @author Christopher Kvarme <christopher.kvarme@flashjab.com>
- * @author credits to Monte Ohrt <monte at ohrt dot com>
- * @version 1.0
- * @param array $params parameters
- * Input:<br>
- * - name (optional) - string default "checkbox"
- * - values (required) - array
- * - options (optional) - associative array
- * - checked (optional) - array default not set
- * - separator (optional) - ie <br> or &nbsp;
- * - output (optional) - the output next to each checkbox
- * - assign (optional) - assign the output as an array to this variable
- * @param object $smarty Smarty object
- * @param object $template template object
- * @return string
- * @uses smarty_function_escape_special_chars()
- */
-function smarty_function_html_checkboxes($params, $smarty, $template)
-{
- require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
- //$smarty->loadPlugin('Smarty_shared_escape_special_chars');
-
- $name = 'checkbox';
- $values = null;
- $options = null;
- $selected = null;
- $separator = '';
- $labels = true;
- $output = null;
-
- $extra = '';
-
- foreach($params as $_key => $_val) {
- switch($_key) {
- case 'name':
- case 'separator':
- $$_key = $_val;
- break;
-
- case 'labels':
- $$_key = (bool)$_val;
- break;
-
- case 'options':
- $$_key = (array)$_val;
- break;
-
- case 'values':
- case 'output':
- $$_key = array_values((array)$_val);
- break;
-
- case 'checked':
- case 'selected':
- $selected = array_map('strval', array_values((array)$_val));
- break;
-
- case 'checkboxes':
- throw new Exception ('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING);
- $options = (array)$_val;
- break;
-
- case 'assign':
- break;
-
- default:
- if(!is_array($_val)) {
- $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
- } else {
- throw new Exception ("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
- }
- break;
- }
- }
-
- if (!isset($options) && !isset($values))
- return ''; /* raise error here? */
-
- settype($selected, 'array');
- $_html_result = array();
-
- if (isset($options)) {
-
- foreach ($options as $_key=>$_val)
- $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
-
-
- } else {
- foreach ($values as $_i=>$_key) {
- $_val = isset($output[$_i]) ? $output[$_i] : '';
- $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
- }
-
- }
-
- if(!empty($params['assign'])) {
- $template->assign($params['assign'], $_html_result);
- } else {
- return implode("\n",$_html_result);
- }
-
-}
-
-function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels) {
- $_output = '';
- if ($labels) $_output .= '<label>';
- $_output .= '<input type="checkbox" name="'
- . smarty_function_escape_special_chars($name) . '[]" value="'
- . smarty_function_escape_special_chars($value) . '"';
-
- if (in_array((string)$value, $selected)) {
- $_output .= ' checked="checked"';
- }
- $_output .= $extra . ' />' . $output;
- if ($labels) $_output .= '</label>';
- $_output .= $separator;
-
- return $_output;
-}
-
-?>
diff --git a/includes/Smarty/plugins/function.html_image.php b/includes/Smarty/plugins/function.html_image.php
deleted file mode 100644
index 6d612df..0000000
--- a/includes/Smarty/plugins/function.html_image.php
+++ /dev/null
@@ -1,139 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsFunction
-*/
-
-/**
-* Smarty {html_image} function plugin
-*
-* Type: function<br>
-* Name: html_image<br>
-* Date: Feb 24, 2003<br>
-* Purpose: format HTML tags for the image<br>
-* Examples: {html_image file="/images/masthead.gif"}
-* Output: <img src="/images/masthead.gif" width=400 height=23>
-*
-* @link http://smarty.php.net/manual/en/language.function.html.image.php {html_image}
- (Smarty online manual)
-* @author Monte Ohrt <monte at ohrt dot com>
-* @author credits to Duda <duda@big.hu>
-* @version 1.0
-* @param array $params parameters
-* Input:<br>
-* - file = file (and path) of image (required)
-* - height = image height (optional, default actual height)
-* - width = image width (optional, default actual width)
-* - basedir = base directory for absolute paths, default
-* is environment variable DOCUMENT_ROOT
-* - path_prefix = prefix for path output (optional, default empty)
-* @param object $smarty Smarty object
-* @param object $template template object
-* @return string
-* @uses smarty_function_escape_special_chars()
-*/
-function smarty_function_html_image($params, $smarty, $template)
-{
- require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
- //$smarty->loadPlugin('Smarty_shared_escape_special_chars');
-
- $alt = '';
- $file = '';
- $height = '';
- $width = '';
- $extra = '';
- $prefix = '';
- $suffix = '';
- $path_prefix = '';
- $server_vars = ($smarty->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
- $basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : '';
- foreach($params as $_key => $_val) {
- switch ($_key) {
- case 'file':
- case 'height':
- case 'width':
- case 'dpi':
- case 'path_prefix':
- case 'basedir':
- $$_key = $_val;
- break;
-
- case 'alt':
- if (!is_array($_val)) {
- $$_key = smarty_function_escape_special_chars($_val);
- } else {
- throw new Exception ("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
- }
- break;
-
- case 'link':
- case 'href':
- $prefix = '<a href="' . $_val . '">';
- $suffix = '</a>';
- break;
-
- default:
- if (!is_array($_val)) {
- $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
- } else {
- throw new Exception ("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
- }
- break;
- }
- }
-
- if (empty($file)) {
- throw new Exception ("html_image: missing 'file' parameter", E_USER_NOTICE);
- return;
- }
-
- if (substr($file, 0, 1) == '/') {
- $_image_path = $basedir . $file;
- } else {
- $_image_path = $file;
- }
-
- if (!isset($params['width']) || !isset($params['height'])) {
- if (!$_image_data = @getimagesize($_image_path)) {
- if (!file_exists($_image_path)) {
- throw new Exception ("html_image: unable to find '$_image_path'", E_USER_NOTICE);
- return;
- } else if (!is_readable($_image_path)) {
- throw new Exception ("html_image: unable to read '$_image_path'", E_USER_NOTICE);
- return;
- } else {
- throw new Exception ("html_image: '$_image_path' is not a valid image file", E_USER_NOTICE);
- return;
- }
- }
- if ($template->security) {
- if (!$smarty->security_handler->isTrustedResourceDir($_image_path)) {
- return;
- }
- }
-
- if (!isset($params['width'])) {
- $width = $_image_data[0];
- }
- if (!isset($params['height'])) {
- $height = $_image_data[1];
- }
- }
-
- if (isset($params['dpi'])) {
- if (strstr($server_vars['HTTP_USER_AGENT'], 'Mac')) {
- $dpi_default = 72;
- } else {
- $dpi_default = 96;
- }
- $_resize = $dpi_default / $params['dpi'];
- $width = round($width * $_resize);
- $height = round($height * $_resize);
- }
-
- return $prefix . '<img src="' . $path_prefix . $file . '" alt="' . $alt . '" width="' . $width . '" height="' . $height . '"' . $extra . ' />' . $suffix;
-}
-
-?>
diff --git a/includes/Smarty/plugins/function.html_options.php b/includes/Smarty/plugins/function.html_options.php
deleted file mode 100644
index 66d8b76..0000000
--- a/includes/Smarty/plugins/function.html_options.php
+++ /dev/null
@@ -1,122 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsFunction
-*/
-
-/**
-* Smarty {html_options} function plugin
-*
-* Type: function<br>
-* Name: html_options<br>
-* Purpose: Prints the list of <option> tags generated from
-* the passed parameters
-*
-* @link http://smarty.php.net/manual/en/language.function.html.options.php {html_image}
- (Smarty online manual)
-* @author Monte Ohrt <monte at ohrt dot com>
-* @param array $params parameters
-* Input:<br>
-* - name (optional) - string default "select"
-* - values (required if no options supplied) - array
-* - options (required if no values supplied) - associative array
-* - selected (optional) - string default not set
-* - output (required if not options supplied) - array
-* @param object $smarty Smarty object
-* @param object $template template object
-* @return string
-* @uses smarty_function_escape_special_chars()
-*/
-
-function smarty_function_html_options($params, $smarty, $template)
-{
- require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
- //$smarty->loadPlugin('Smarty_shared_escape_special_chars');
-
- $name = null;
- $values = null;
- $options = null;
- $selected = array();
- $output = null;
-
- $extra = '';
-
- foreach($params as $_key => $_val) {
- switch ($_key) {
- case 'name':
- $$_key = (string)$_val;
- break;
-
- case 'options':
- $$_key = (array)$_val;
- break;
-
- case 'values':
- case 'output':
- $$_key = array_values((array)$_val);
- break;
-
- case 'selected':
- $$_key = array_map('strval', array_values((array)$_val));
- break;
-
- default:
- if (!is_array($_val)) {
- $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
- } else {
- throw new Exception ("html_options: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
- }
- break;
- }
- }
-
- if (!isset($options) && !isset($values))
- return '';
- /* raise error here? */
-
- $_html_result = '';
-
- if (isset($options)) {
- foreach ($options as $_key => $_val)
- $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
- } else {
- foreach ($values as $_i => $_key) {
- $_val = isset($output[$_i]) ? $output[$_i] : '';
- $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
- }
- }
-
- if (!empty($name)) {
- $_html_result = '<select name="' . $name . '"' . $extra . '>' . "\n" . $_html_result . '</select>' . "\n";
- }
-
- return $_html_result;
-}
-
-function smarty_function_html_options_optoutput($key, $value, $selected)
-{
- if (!is_array($value)) {
- $_html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' .
- smarty_function_escape_special_chars($key) . '"';
- if (in_array((string)$key, $selected))
- $_html_result .= ' selected="selected"';
- $_html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n";
- } else {
- $_html_result = smarty_function_html_options_optgroup($key, $value, $selected);
- }
- return $_html_result;
-}
-
-function smarty_function_html_options_optgroup($key, $values, $selected)
-{
- $optgroup_html = '<optgroup label="' . smarty_function_escape_special_chars($key) . '">' . "\n";
- foreach ($values as $key => $value) {
- $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected);
- }
- $optgroup_html .= "</optgroup>\n";
- return $optgroup_html;
-}
-
-?>
diff --git a/includes/Smarty/plugins/function.html_radios.php b/includes/Smarty/plugins/function.html_radios.php
deleted file mode 100644
index edfd8ad..0000000
--- a/includes/Smarty/plugins/function.html_radios.php
+++ /dev/null
@@ -1,156 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsFunction
-*/
-
-/**
-* Smarty {html_radios} function plugin
-*
-* File: function.html_radios.php<br>
-* Type: function<br>
-* Name: html_radios<br>
-* Date: 24.Feb.2003<br>
-* Purpose: Prints out a list of radio input types<br>
-* Examples:
-* <pre>
-* {html_radios values=$ids output=$names}
-* {html_radios values=$ids name='box' separator='<br>' output=$names}
-* {html_radios values=$ids checked=$checked separator='<br>' output=$names}
-* </pre>
-*
-* @link http://smarty.php.net/manual/en/language.function.html.radios.php {html_radios}
- (Smarty online manual)
-* @author Christopher Kvarme <christopher.kvarme@flashjab.com>
-* @author credits to Monte Ohrt <monte at ohrt dot com>
-* @version 1.0
-* @param array $params parameters
-* Input:<br>
-* - name (optional) - string default "radio"
-* - values (required) - array
-* - options (optional) - associative array
-* - checked (optional) - array default not set
-* - separator (optional) - ie <br> or &nbsp;
-* - output (optional) - the output next to each radio button
-* - assign (optional) - assign the output as an array to this variable
-* @param object $smarty Smarty object
-* @param object $template template object
-* @return string
-* @uses smarty_function_escape_special_chars()
-*/
-function smarty_function_html_radios($params, $smarty, $template)
-{
- require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
- //$smarty->loadPlugin('Smarty_shared_escape_special_chars');
-
- $name = 'radio';
- $values = null;
- $options = null;
- $selected = null;
- $separator = '';
- $labels = true;
- $label_ids = false;
- $output = null;
- $extra = '';
-
- foreach($params as $_key => $_val) {
- switch ($_key) {
- case 'name':
- case 'separator':
- $$_key = (string)$_val;
- break;
-
- case 'checked':
- case 'selected':
- if (is_array($_val)) {
- throw new Exception ('html_radios: the "' . $_key . '" attribute cannot be an array', E_USER_WARNING);
- } else {
- $selected = (string)$_val;
- }
- break;
-
- case 'labels':
- case 'label_ids':
- $$_key = (bool)$_val;
- break;
-
- case 'options':
- $$_key = (array)$_val;
- break;
-
- case 'values':
- case 'output':
- $$_key = array_values((array)$_val);
- break;
-
- case 'radios':
- throw new Exception ('html_radios: the use of the "radios" attribute is deprecated, use "options" instead', E_USER_WARNING);
- $options = (array)$_val;
- break;
-
- case 'assign':
- break;
-
- default:
- if (!is_array($_val)) {
- $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
- } else {
- throw new Exception ("html_radios: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
- }
- break;
- }
- }
-
- if (!isset($options) && !isset($values))
- return '';
- /* raise error here? */
-
- $_html_result = array();
-
- if (isset($options)) {
- foreach ($options as $_key => $_val)
- $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids);
- } else {
- foreach ($values as $_i => $_key) {
- $_val = isset($output[$_i]) ? $output[$_i] : '';
- $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids);
- }
- }
-
- if (!empty($params['assign'])) {
- $template->assign($params['assign'], $_html_result);
- } else {
- return implode("\n", $_html_result);
- }
-}
-
-function smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids)
-{
- $_output = '';
- if ($labels) {
- if ($label_ids) {
- $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!', '_', $name . '_' . $value));
- $_output .= '<label for="' . $_id . '">';
- } else {
- $_output .= '<label>';
- }
- }
- $_output .= '<input type="radio" name="'
- . smarty_function_escape_special_chars($name) . '" value="'
- . smarty_function_escape_special_chars($value) . '"';
-
- if ($labels && $label_ids) $_output .= ' id="' . $_id . '"';
-
- if ((string)$value == $selected) {
- $_output .= ' checked="checked"';
- }
- $_output .= $extra . ' />' . $output;
- if ($labels) $_output .= '</label>';
- $_output .= $separator;
-
- return $_output;
-}
-
-?>
diff --git a/includes/Smarty/plugins/function.html_select_date.php b/includes/Smarty/plugins/function.html_select_date.php
deleted file mode 100644
index 1416c3b..0000000
--- a/includes/Smarty/plugins/function.html_select_date.php
+++ /dev/null
@@ -1,333 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsFunction
-*/
-
-/**
-* Smarty {html_select_date} plugin
-*
-* Type: function<br>
-* Name: html_select_date<br>
-* Purpose: Prints the dropdowns for date selection.
-*
-* ChangeLog:<br>
-* - 1.0 initial release
-* - 1.1 added support for +/- N syntax for begin
-* and end year values. (Monte)
-* - 1.2 added support for yyyy-mm-dd syntax for
-* time value. (Jan Rosier)
-* - 1.3 added support for choosing format for
-* month values (Gary Loescher)
-* - 1.3.1 added support for choosing format for
-* day values (Marcus Bointon)
-* - 1.3.2 support negative timestamps, force year
-* dropdown to include given date unless explicitly set (Monte)
-* - 1.3.4 fix behaviour of 0000-00-00 00:00:00 dates to match that
-* of 0000-00-00 dates (cybot, boots)
-*
-* @link http://smarty.php.net/manual/en/language.function.html.select.date.php {html_select_date}
- (Smarty online manual)
-* @version 1.3.4
-* @author Andrei Zmievski
-* @author Monte Ohrt <monte at ohrt dot com>
-* @param array $params parameters
-* @param object $smarty Smarty object
-* @param object $template template object
-* @return string
-*/
-function smarty_function_html_select_date($params, $smarty, $template)
-{
- require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
- require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
- require_once(SMARTY_PLUGINS_DIR . 'function.html_options.php');
- //$smarty->loadPlugin('Smarty_shared_escape_special_chars');
- //$smarty->loadPlugin('Smarty_shared_make_timestamp');
- //$smarty->loadPlugin('Smarty_function_html_options');
-
- /* Default values. */
- $prefix = "Date_";
- $start_year = strftime("%Y");
- $end_year = $start_year;
- $display_days = true;
- $display_months = true;
- $display_years = true;
- $month_format = "%B";
- /* Write months as numbers by default GL */
- $month_value_format = "%m";
- $day_format = "%02d";
- /* Write day values using this format MB */
- $day_value_format = "%d";
- $year_as_text = false;
- /* Display years in reverse order? Ie. 2000,1999,.... */
- $reverse_years = false;
- /* Should the select boxes be part of an array when returned from PHP?
- e.g. setting it to "birthday", would create "birthday[Day]",
- "birthday[Month]" & "birthday[Year]". Can be combined with prefix */
- $field_array = null;
- /* <select size>'s of the different <select> tags.
- If not set, uses default dropdown. */
- $day_size = null;
- $month_size = null;
- $year_size = null;
- /* Unparsed attributes common to *ALL* the <select>/<input> tags.
- An example might be in the template: all_extra ='class ="foo"'. */
- $all_extra = null;
- /* Separate attributes for the tags. */
- $day_extra = null;
- $month_extra = null;
- $year_extra = null;
- /* Order in which to display the fields.
- "D" -> day, "M" -> month, "Y" -> year. */
- $field_order = 'MDY';
- /* String printed between the different fields. */
- $field_separator = "\n";
- $time = time();
- $all_empty = null;
- $day_empty = null;
- $month_empty = null;
- $year_empty = null;
- $extra_attrs = '';
-
- foreach ($params as $_key => $_value) {
- switch ($_key) {
- case 'prefix':
- case 'time':
- case 'start_year':
- case 'end_year':
- case 'month_format':
- case 'day_format':
- case 'day_value_format':
- case 'field_array':
- case 'day_size':
- case 'month_size':
- case 'year_size':
- case 'all_extra':
- case 'day_extra':
- case 'month_extra':
- case 'year_extra':
- case 'field_order':
- case 'field_separator':
- case 'month_value_format':
- case 'month_empty':
- case 'day_empty':
- case 'year_empty':
- $$_key = (string)$_value;
- break;
-
- case 'all_empty':
- $$_key = (string)$_value;
- $day_empty = $month_empty = $year_empty = $all_empty;
- break;
-
- case 'display_days':
- case 'display_months':
- case 'display_years':
- case 'year_as_text':
- case 'reverse_years':
- $$_key = (bool)$_value;
- break;
-
- default:
- if (!is_array($_value)) {
- $extra_attrs .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_value) . '"';
- } else {
- throw new Exception ("html_select_date: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
- }
- break;
- }
- }
-
- if (preg_match('!^-\d+$!', $time)) {
- // negative timestamp, use date()
- $time = date('Y-m-d', $time);
- }
- // If $time is not in format yyyy-mm-dd
- if (preg_match('/^(\d{0,4}-\d{0,2}-\d{0,2})/', $time, $found)) {
- $time = $found[1];
- } else {
- // use smarty_make_timestamp to get an unix timestamp and
- // strftime to make yyyy-mm-dd
- $time = strftime('%Y-%m-%d', smarty_make_timestamp($time));
- }
- // Now split this in pieces, which later can be used to set the select
- $time = explode("-", $time);
- // make syntax "+N" or "-N" work with start_year and end_year
- if (preg_match('!^(\+|\-)\s*(\d+)$!', $end_year, $match)) {
- if ($match[1] == '+') {
- $end_year = strftime('%Y') + $match[2];
- } else {
- $end_year = strftime('%Y') - $match[2];
- }
- }
- if (preg_match('!^(\+|\-)\s*(\d+)$!', $start_year, $match)) {
- if ($match[1] == '+') {
- $start_year = strftime('%Y') + $match[2];
- } else {
- $start_year = strftime('%Y') - $match[2];
- }
- }
- if (strlen($time[0]) > 0) {
- if ($start_year > $time[0] && !isset($params['start_year'])) {
- // force start year to include given date if not explicitly set
- $start_year = $time[0];
- }
- if ($end_year < $time[0] && !isset($params['end_year'])) {
- // force end year to include given date if not explicitly set
- $end_year = $time[0];
- }
- }
-
- $field_order = strtoupper($field_order);
-
- $html_result = $month_result = $day_result = $year_result = "";
-
- $field_separator_count = -1;
- if ($display_months) {
- $field_separator_count++;
- $month_names = array();
- $month_values = array();
- if (isset($month_empty)) {
- $month_names[''] = $month_empty;
- $month_values[''] = '';
- }
- for ($i = 1; $i <= 12; $i++) {
- $month_names[$i] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000));
- $month_values[$i] = strftime($month_value_format, mktime(0, 0, 0, $i, 1, 2000));
- }
-
- $month_result .= '<select name=';
- if (null !== $field_array) {
- $month_result .= '"' . $field_array . '[' . $prefix . 'Month]"';
- } else {
- $month_result .= '"' . $prefix . 'Month"';
- }
- if (null !== $month_size) {
- $month_result .= ' size="' . $month_size . '"';
- }
- if (null !== $month_extra) {
- $month_result .= ' ' . $month_extra;
- }
- if (null !== $all_extra) {
- $month_result .= ' ' . $all_extra;
- }
- $month_result .= $extra_attrs . '>' . "\n";
-
- $month_result .= smarty_function_html_options(array('output' => $month_names,
- 'values' => $month_values,
- 'selected' => (int)$time[1] ? strftime($month_value_format, mktime(0, 0, 0, (int)$time[1], 1, 2000)) : '',
- 'print_result' => false),
- $smarty, $template);
- $month_result .= '</select>';
- }
-
- if ($display_days) {
- $field_separator_count++;
- $days = array();
- if (isset($day_empty)) {
- $days[''] = $day_empty;
- $day_values[''] = '';
- }
- for ($i = 1; $i <= 31; $i++) {
- $days[] = sprintf($day_format, $i);
- $day_values[] = sprintf($day_value_format, $i);
- }
-
- $day_result .= '<select name=';
- if (null !== $field_array) {
- $day_result .= '"' . $field_array . '[' . $prefix . 'Day]"';
- } else {
- $day_result .= '"' . $prefix . 'Day"';
- }
- if (null !== $day_size) {
- $day_result .= ' size="' . $day_size . '"';
- }
- if (null !== $all_extra) {
- $day_result .= ' ' . $all_extra;
- }
- if (null !== $day_extra) {
- $day_result .= ' ' . $day_extra;
- }
- $day_result .= $extra_attrs . '>' . "\n";
- $day_result .= smarty_function_html_options(array('output' => $days,
- 'values' => $day_values,
- 'selected' => $time[2],
- 'print_result' => false),
- $smarty, $template);
- $day_result .= '</select>';
- }
-
- if ($display_years) {
- $field_separator_count++;
- if (null !== $field_array) {
- $year_name = $field_array . '[' . $prefix . 'Year]';
- } else {
- $year_name = $prefix . 'Year';
- }
- if ($year_as_text) {
- $year_result .= '<input type="text" name="' . $year_name . '" value="' . $time[0] . '" size="4" maxlength="4"';
- if (null !== $all_extra) {
- $year_result .= ' ' . $all_extra;
- }
- if (null !== $year_extra) {
- $year_result .= ' ' . $year_extra;
- }
- $year_result .= ' />';
- } else {
- $years = range((int)$start_year, (int)$end_year);
- if ($reverse_years) {
- rsort($years, SORT_NUMERIC);
- } else {
- sort($years, SORT_NUMERIC);
- }
- $yearvals = $years;
- if (isset($year_empty)) {
- array_unshift($years, $year_empty);
- array_unshift($yearvals, '');
- }
- $year_result .= '<select name="' . $year_name . '"';
- if (null !== $year_size) {
- $year_result .= ' size="' . $year_size . '"';
- }
- if (null !== $all_extra) {
- $year_result .= ' ' . $all_extra;
- }
- if (null !== $year_extra) {
- $year_result .= ' ' . $year_extra;
- }
- $year_result .= $extra_attrs . '>' . "\n";
- $year_result .= smarty_function_html_options(array('output' => $years,
- 'values' => $yearvals,
- 'selected' => $time[0],
- 'print_result' => false),
- $smarty, $template);
- $year_result .= '</select>';
- }
- }
- // Loop thru the field_order field
- for ($i = 0; $i <= 2; $i++) {
- $c = substr($field_order, $i, 1);
- switch ($c) {
- case 'D':
- $html_result .= $day_result;
- break;
-
- case 'M':
- $html_result .= $month_result;
- break;
-
- case 'Y':
- $html_result .= $year_result;
- break;
- }
- // Add the field seperator
- if ($i < $field_separator_count) {
- $html_result .= $field_separator;
- }
- }
-
- return $html_result;
-}
-?>
diff --git a/includes/Smarty/plugins/function.html_select_time.php b/includes/Smarty/plugins/function.html_select_time.php
deleted file mode 100644
index 097df93..0000000
--- a/includes/Smarty/plugins/function.html_select_time.php
+++ /dev/null
@@ -1,197 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsFunction
-*/
-
-/**
-* Smarty {html_select_time} function plugin
-*
-* Type: function<br>
-* Name: html_select_time<br>
-* Purpose: Prints the dropdowns for time selection
-*
-* @link http://smarty.php.net/manual/en/language.function.html.select.time.php {html_select_time}
- (Smarty online manual)
-* @author Roberto Berto <roberto@berto.net>
-* @credits Monte Ohrt <monte AT ohrt DOT com>
-* @param array $params parameters
-* @param object $smarty Smarty object
-* @param object $template template object
-* @return string
-* @uses smarty_make_timestamp()
-*/
-function smarty_function_html_select_time($params, $smarty, $template)
-{
- require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
- require_once(SMARTY_PLUGINS_DIR . 'function.html_options.php');
- //$smarty->loadPlugin('Smarty_shared_make_timestamp');
- //$smarty->loadPlugin('Smarty_function_html_options');
-
- /* Default values. */
- $prefix = "Time_";
- $time = time();
- $display_hours = true;
- $display_minutes = true;
- $display_seconds = true;
- $display_meridian = true;
- $use_24_hours = true;
- $minute_interval = 1;
- $second_interval = 1;
- /* Should the select boxes be part of an array when returned from PHP?
- e.g. setting it to "birthday", would create "birthday[Hour]",
- "birthday[Minute]", "birthday[Seconds]" & "birthday[Meridian]".
- Can be combined with prefix. */
- $field_array = null;
- $all_extra = null;
- $hour_extra = null;
- $minute_extra = null;
- $second_extra = null;
- $meridian_extra = null;
-
- foreach ($params as $_key => $_value) {
- switch ($_key) {
- case 'prefix':
- case 'time':
- case 'field_array':
- case 'all_extra':
- case 'hour_extra':
- case 'minute_extra':
- case 'second_extra':
- case 'meridian_extra':
- $$_key = (string)$_value;
- break;
-
- case 'display_hours':
- case 'display_minutes':
- case 'display_seconds':
- case 'display_meridian':
- case 'use_24_hours':
- $$_key = (bool)$_value;
- break;
-
- case 'minute_interval':
- case 'second_interval':
- $$_key = (int)$_value;
- break;
-
- default:
- throw new Exception ("[html_select_time] unknown parameter $_key", E_USER_WARNING);
- }
- }
-
- $time = smarty_make_timestamp($time);
-
- $html_result = '';
-
- if ($display_hours) {
- $hours = $use_24_hours ? range(0, 23) : range(1, 12);
- $hour_fmt = $use_24_hours ? '%H' : '%I';
- for ($i = 0, $for_max = count($hours); $i < $for_max; $i++)
- $hours[$i] = sprintf('%02d', $hours[$i]);
- $html_result .= '<select name=';
- if (null !== $field_array) {
- $html_result .= '"' . $field_array . '[' . $prefix . 'Hour]"';
- } else {
- $html_result .= '"' . $prefix . 'Hour"';
- }
- if (null !== $hour_extra) {
- $html_result .= ' ' . $hour_extra;
- }
- if (null !== $all_extra) {
- $html_result .= ' ' . $all_extra;
- }
- $html_result .= '>' . "\n";
- $html_result .= smarty_function_html_options(array('output' => $hours,
- 'values' => $hours,
- 'selected' => strftime($hour_fmt, $time),
- 'print_result' => false),
- $smarty, $template);
- $html_result .= "</select>\n";
- }
-
- if ($display_minutes) {
- $all_minutes = range(0, 59);
- for ($i = 0, $for_max = count($all_minutes); $i < $for_max; $i += $minute_interval)
- $minutes[] = sprintf('%02d', $all_minutes[$i]);
- $selected = intval(floor(strftime('%M', $time) / $minute_interval) * $minute_interval);
- $html_result .= '<select name=';
- if (null !== $field_array) {
- $html_result .= '"' . $field_array . '[' . $prefix . 'Minute]"';
- } else {
- $html_result .= '"' . $prefix . 'Minute"';
- }
- if (null !== $minute_extra) {
- $html_result .= ' ' . $minute_extra;
- }
- if (null !== $all_extra) {
- $html_result .= ' ' . $all_extra;
- }
- $html_result .= '>' . "\n";
-
- $html_result .= smarty_function_html_options(array('output' => $minutes,
- 'values' => $minutes,
- 'selected' => $selected,
- 'print_result' => false),
- $smarty, $template);
- $html_result .= "</select>\n";
- }
-
- if ($display_seconds) {
- $all_seconds = range(0, 59);
- for ($i = 0, $for_max = count($all_seconds); $i < $for_max; $i += $second_interval)
- $seconds[] = sprintf('%02d', $all_seconds[$i]);
- $selected = intval(floor(strftime('%S', $time) / $second_interval) * $second_interval);
- $html_result .= '<select name=';
- if (null !== $field_array) {
- $html_result .= '"' . $field_array . '[' . $prefix . 'Second]"';
- } else {
- $html_result .= '"' . $prefix . 'Second"';
- }
-
- if (null !== $second_extra) {
- $html_result .= ' ' . $second_extra;
- }
- if (null !== $all_extra) {
- $html_result .= ' ' . $all_extra;
- }
- $html_result .= '>' . "\n";
-
- $html_result .= smarty_function_html_options(array('output' => $seconds,
- 'values' => $seconds,
- 'selected' => $selected,
- 'print_result' => false),
- $smarty, $template);
- $html_result .= "</select>\n";
- }
-
- if ($display_meridian && !$use_24_hours) {
- $html_result .= '<select name=';
- if (null !== $field_array) {
- $html_result .= '"' . $field_array . '[' . $prefix . 'Meridian]"';
- } else {
- $html_result .= '"' . $prefix . 'Meridian"';
- }
-
- if (null !== $meridian_extra) {
- $html_result .= ' ' . $meridian_extra;
- }
- if (null !== $all_extra) {
- $html_result .= ' ' . $all_extra;
- }
- $html_result .= '>' . "\n";
-
- $html_result .= smarty_function_html_options(array('output' => array('AM', 'PM'),
- 'values' => array('am', 'pm'),
- 'selected' => strtolower(strftime('%p', $time)),
- 'print_result' => false),
- $smarty, $template);
- $html_result .= "</select>\n";
- }
-
- return $html_result;
-}
-
-?>
diff --git a/includes/Smarty/plugins/function.html_table.php b/includes/Smarty/plugins/function.html_table.php
deleted file mode 100644
index 8f7afd2..0000000
--- a/includes/Smarty/plugins/function.html_table.php
+++ /dev/null
@@ -1,176 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsFunction
-*/
-
-/**
-* Smarty {html_table} function plugin
-*
-* Type: function<br>
-* Name: html_table<br>
-* Date: Feb 17, 2003<br>
-* Purpose: make an html table from an array of data<br>
-*
-*
-* Examples:
-* <pre>
-* {table loop=$data}
-* {table loop=$data cols=4 tr_attr='"bgcolor=red"'}
-* {table loop=$data cols="first,second,third" tr_attr=$colors}
-* </pre>
-*
-* @author Monte Ohrt <monte at ohrt dot com>
-* @author credit to Messju Mohr <messju at lammfellpuschen dot de>
-* @author credit to boots <boots dot smarty at yahoo dot com>
-* @version 1.1
-* @link http://smarty.php.net/manual/en/language.function.html.table.php {html_table}
- (Smarty online manual)
-* @param array $params parameters
-* Input:<br>
-* - loop = array to loop through
-* - cols = number of columns, comma separated list of column names
-* or array of column names
-* - rows = number of rows
-* - table_attr = table attributes
-* - th_attr = table heading attributes (arrays are cycled)
-* - tr_attr = table row attributes (arrays are cycled)
-* - td_attr = table cell attributes (arrays are cycled)
-* - trailpad = value to pad trailing cells with
-* - caption = text for caption element
-* - vdir = vertical direction (default: "down", means top-to-bottom)
-* - hdir = horizontal direction (default: "right", means left-to-right)
-* - inner = inner loop (default "cols": print $loop line by line,
-* $loop will be printed column by column otherwise)
-* @param object $smarty Smarty object
-* @param object $template template object
-* @return string
-*/
-function smarty_function_html_table($params, $smarty, $template)
-{
- $table_attr = 'border="1"';
- $tr_attr = '';
- $th_attr = '';
- $td_attr = '';
- $cols = $cols_count = 3;
- $rows = 3;
- $trailpad = '&nbsp;';
- $vdir = 'down';
- $hdir = 'right';
- $inner = 'cols';
- $caption = '';
-
- if (!isset($params['loop'])) {
- throw new Exception ("html_table: missing 'loop' parameter");
- return;
- }
-
- foreach ($params as $_key => $_value) {
- switch ($_key) {
- case 'loop':
- $$_key = (array)$_value;
- break;
-
- case 'cols':
- if (is_array($_value) && !empty($_value)) {
- $cols = $_value;
- $cols_count = count($_value);
- } elseif (!is_numeric($_value) && is_string($_value) && !empty($_value)) {
- $cols = explode(',', $_value);
- $cols_count = count($cols);
- } elseif (!empty($_value)) {
- $cols_count = (int)$_value;
- } else {
- $cols_count = $cols;
- }
- break;
-
- case 'rows':
- $$_key = (int)$_value;
- break;
-
- case 'table_attr':
- case 'trailpad':
- case 'hdir':
- case 'vdir':
- case 'inner':
- case 'caption':
- $$_key = (string)$_value;
- break;
-
- case 'tr_attr':
- case 'td_attr':
- case 'th_attr':
- $$_key = $_value;
- break;
- }
- }
-
- $loop_count = count($loop);
- if (empty($params['rows'])) {
- /* no rows specified */
- $rows = ceil($loop_count / $cols_count);
- } elseif (empty($params['cols'])) {
- if (!empty($params['rows'])) {
- /* no cols specified, but rows */
- $cols_count = ceil($loop_count / $rows);
- }
- }
-
- $output = "<table $table_attr>\n";
-
- if (!empty($caption)) {
- $output .= '<caption>' . $caption . "</caption>\n";
- }
-
- if (is_array($cols)) {
- $cols = ($hdir == 'right') ? $cols : array_reverse($cols);
- $output .= "<thead><tr>\n";
-
- for ($r = 0; $r < $cols_count; $r++) {
- $output .= '<th' . smarty_function_html_table_cycle('th', $th_attr, $r) . '>';
- $output .= $cols[$r];
- $output .= "</th>\n";
- }
- $output .= "</tr></thead>\n";
- }
-
- $output .= "<tbody>\n";
- for ($r = 0; $r < $rows; $r++) {
- $output .= "<tr" . smarty_function_html_table_cycle('tr', $tr_attr, $r) . ">\n";
- $rx = ($vdir == 'down') ? $r * $cols_count : ($rows-1 - $r) * $cols_count;
-
- for ($c = 0; $c < $cols_count; $c++) {
- $x = ($hdir == 'right') ? $rx + $c : $rx + $cols_count-1 - $c;
- if ($inner != 'cols') {
- /* shuffle x to loop over rows*/
- $x = floor($x / $cols_count) + ($x % $cols_count) * $rows;
- }
-
- if ($x < $loop_count) {
- $output .= "<td" . smarty_function_html_table_cycle('td', $td_attr, $c) . ">" . $loop[$x] . "</td>\n";
- } else {
- $output .= "<td" . smarty_function_html_table_cycle('td', $td_attr, $c) . ">$trailpad</td>\n";
- }
- }
- $output .= "</tr>\n";
- }
- $output .= "</tbody>\n";
- $output .= "</table>\n";
-
- return $output;
-}
-
-function smarty_function_html_table_cycle($name, $var, $no)
-{
- if (!is_array($var)) {
- $ret = $var;
- } else {
- $ret = $var[$no % count($var)];
- }
-
- return ($ret) ? ' ' . $ret : '';
-}
-?>
diff --git a/includes/Smarty/plugins/function.mailto.php b/includes/Smarty/plugins/function.mailto.php
deleted file mode 100644
index a5552e6..0000000
--- a/includes/Smarty/plugins/function.mailto.php
+++ /dev/null
@@ -1,157 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsFunction
-*/
-
-/**
-* Smarty {mailto} function plugin
-*
-* Type: function<br>
-* Name: mailto<br>
-* Date: May 21, 2002
-* Purpose: automate mailto address link creation, and optionally
-* encode them.<br>
-*
-* Examples:
-* <pre>
-* {mailto address="me@domain.com"}
-* {mailto address="me@domain.com" encode="javascript"}
-* {mailto address="me@domain.com" encode="hex"}
-* {mailto address="me@domain.com" subject="Hello to you!"}
-* {mailto address="me@domain.com" cc="you@domain.com,they@domain.com"}
-* {mailto address="me@domain.com" extra='class="mailto"'}
-* </pre>
-*
-* @link http://smarty.php.net/manual/en/language.function.mailto.php {mailto}
- (Smarty online manual)
-* @version 1.2
-* @author Monte Ohrt <monte at ohrt dot com>
-* @author credits to Jason Sweat (added cc, bcc and subject functionality)
-* @param array $params parameters
-* Input:<br>
-* - address = e-mail address
-* - text = (optional) text to display, default is address
-* - encode = (optional) can be one of:
-* * none : no encoding (default)
-* * javascript : encode with javascript
-* * javascript_charcode : encode with javascript charcode
-* * hex : encode with hexidecimal (no javascript)
-* - cc = (optional) address(es) to carbon copy
-* - bcc = (optional) address(es) to blind carbon copy
-* - subject = (optional) e-mail subject
-* - newsgroups = (optional) newsgroup(s) to post to
-* - followupto = (optional) address(es) to follow up to
-* - extra = (optional) extra tags for the href link
-* @param object $smarty Smarty object
-* @param object $template template object
-* @return string
-*/
-function smarty_function_mailto($params, $smarty, $template)
-{
- $extra = '';
-
- if (empty($params['address'])) {
- throw new Exception ("mailto: missing 'address' parameter");
- return;
- } else {
- $address = $params['address'];
- }
-
- $text = $address;
- // netscape and mozilla do not decode %40 (@) in BCC field (bug?)
- // so, don't encode it.
- $search = array('%40', '%2C');
- $replace = array('@', ',');
- $mail_parms = array();
- foreach ($params as $var => $value) {
- switch ($var) {
- case 'cc':
- case 'bcc':
- case 'followupto':
- if (!empty($value))
- $mail_parms[] = $var . '=' . str_replace($search, $replace, rawurlencode($value));
- break;
-
- case 'subject':
- case 'newsgroups':
- $mail_parms[] = $var . '=' . rawurlencode($value);
- break;
-
- case 'extra':
- case 'text':
- $$var = $value;
-
- default:
- }
- }
-
- $mail_parm_vals = '';
- for ($i = 0; $i < count($mail_parms); $i++) {
- $mail_parm_vals .= (0 == $i) ? '?' : '&';
- $mail_parm_vals .= $mail_parms[$i];
- }
- $address .= $mail_parm_vals;
-
- $encode = (empty($params['encode'])) ? 'none' : $params['encode'];
- if (!in_array($encode, array('javascript', 'javascript_charcode', 'hex', 'none'))) {
- throw new Exception ("mailto: 'encode' parameter must be none, javascript or hex");
- return;
- }
-
- if ($encode == 'javascript') {
- $string = 'document.write(\'<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>\');';
-
- $js_encode = '';
- for ($x = 0; $x < strlen($string); $x++) {
- $js_encode .= '%' . bin2hex($string[$x]);
- }
-
- return '<script type="text/javascript">eval(unescape(\'' . $js_encode . '\'))</script>';
- } elseif ($encode == 'javascript_charcode') {
- $string = '<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>';
-
- for($x = 0, $y = strlen($string); $x < $y; $x++) {
- $ord[] = ord($string[$x]);
- }
-
- $_ret = "<script type=\"text/javascript\" language=\"javascript\">\n";
- $_ret .= "<!--\n";
- $_ret .= "{document.write(String.fromCharCode(";
- $_ret .= implode(',', $ord);
- $_ret .= "))";
- $_ret .= "}\n";
- $_ret .= "//-->\n";
- $_ret .= "</script>\n";
-
- return $_ret;
- } elseif ($encode == 'hex') {
- preg_match('!^(.*)(\?.*)$!', $address, $match);
- if (!empty($match[2])) {
- throw new Exception ("mailto: hex encoding does not work with extra attributes. Try javascript.");
- return;
- }
- $address_encode = '';
- for ($x = 0; $x < strlen($address); $x++) {
- if (preg_match('!\w!', $address[$x])) {
- $address_encode .= '%' . bin2hex($address[$x]);
- } else {
- $address_encode .= $address[$x];
- }
- }
- $text_encode = '';
- for ($x = 0; $x < strlen($text); $x++) {
- $text_encode .= '&#x' . bin2hex($text[$x]) . ';';
- }
-
- $mailto = "&#109;&#97;&#105;&#108;&#116;&#111;&#58;";
- return '<a href="' . $mailto . $address_encode . '" ' . $extra . '>' . $text_encode . '</a>';
- } else {
- // no encoding
- return '<a href="mailto:' . $address . '" ' . $extra . '>' . $text . '</a>';
- }
-}
-
-?>
diff --git a/includes/Smarty/plugins/function.math.php b/includes/Smarty/plugins/function.math.php
deleted file mode 100644
index b309af1..0000000
--- a/includes/Smarty/plugins/function.math.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-/**
- * Smarty plugin
- *
- * This plugin is only for Smarty2 BC
- * @package Smarty
- * @subpackage PluginsFunction
- */
-
-
-/**
- * Smarty {math} function plugin
- *
- * Type: function<br>
- * Name: math<br>
- * Purpose: handle math computations in template<br>
- * @link http://smarty.php.net/manual/en/language.function.math.php {math}
- * (Smarty online manual)
- * @author Monte Ohrt <monte at ohrt dot com>
- * @param array $params parameters
- * @param object $smarty Smarty object
- * @param object $template template object
- * @return string|null
- */
-function smarty_function_math($params, $smarty, $template)
-{
- // be sure equation parameter is present
- if (empty($params['equation'])) {
- throw new Exception ("math: missing equation parameter");
- return;
- }
-
- $equation = $params['equation'];
-
- // make sure parenthesis are balanced
- if (substr_count($equation,"(") != substr_count($equation,")")) {
- throw new Exception ("math: unbalanced parenthesis");
- return;
- }
-
- // match all vars in equation, make sure all are passed
- preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]+)!",$equation, $match);
- $allowed_funcs = array('int','abs','ceil','cos','exp','floor','log','log10',
- 'max','min','pi','pow','rand','round','sin','sqrt','srand','tan');
-
- foreach($match[1] as $curr_var) {
- if ($curr_var && !in_array($curr_var, array_keys($params)) && !in_array($curr_var, $allowed_funcs)) {
- throw new Exception ("math: function call $curr_var not allowed");
- return;
- }
- }
-
- foreach($params as $key => $val) {
- if ($key != "equation" && $key != "format" && $key != "assign") {
- // make sure value is not empty
- if (strlen($val)==0) {
- throw new Exception ("math: parameter $key is empty");
- return;
- }
- if (!is_numeric($val)) {
- throw new Exception ("math: parameter $key: is not numeric");
- return;
- }
- $equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation);
- }
- }
-
- eval("\$smarty_math_result = ".$equation.";");
-
- if (empty($params['format'])) {
- if (empty($params['assign'])) {
- return $smarty_math_result;
- } else {
- $template->assign($params['assign'],$smarty_math_result);
- }
- } else {
- if (empty($params['assign'])){
- printf($params['format'],$smarty_math_result);
- } else {
- $template->assign($params['assign'],sprintf($params['format'],$smarty_math_result));
- }
- }
-}
-?>
diff --git a/includes/Smarty/plugins/function.popup.php b/includes/Smarty/plugins/function.popup.php
deleted file mode 100644
index 509c3c3..0000000
--- a/includes/Smarty/plugins/function.popup.php
+++ /dev/null
@@ -1,118 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsFunction
- */
-
-
-/**
- * Smarty {popup} function plugin
- *
- * Type: function<br>
- * Name: popup<br>
- * Purpose: make text pop up in windows via overlib
- * @link http://smarty.php.net/manual/en/language.function.popup.php {popup}
- * (Smarty online manual)
- * @author Monte Ohrt <monte at ohrt dot com>
- * @param array $params parameters
- * @param object $smarty Smarty object
- * @param object $template template object
- * @return string
- */
-function smarty_function_popup($params, $smarty, $template)
-{
- $append = '';
- foreach ($params as $_key=>$_value) {
- switch ($_key) {
- case 'text':
- case 'trigger':
- case 'function':
- case 'inarray':
- $$_key = (string)$_value;
- if ($_key == 'function' || $_key == 'inarray')
- $append .= ',' . strtoupper($_key) . ",'$_value'";
- break;
-
- case 'caption':
- case 'closetext':
- case 'status':
- $append .= ',' . strtoupper($_key) . ",'" . str_replace("'","\'",$_value) . "'";
- break;
-
- case 'fgcolor':
- case 'bgcolor':
- case 'textcolor':
- case 'capcolor':
- case 'closecolor':
- case 'textfont':
- case 'captionfont':
- case 'closefont':
- case 'fgbackground':
- case 'bgbackground':
- case 'caparray':
- case 'capicon':
- case 'background':
- case 'frame':
- $append .= ',' . strtoupper($_key) . ",'$_value'";
- break;
-
- case 'textsize':
- case 'captionsize':
- case 'closesize':
- case 'width':
- case 'height':
- case 'border':
- case 'offsetx':
- case 'offsety':
- case 'snapx':
- case 'snapy':
- case 'fixx':
- case 'fixy':
- case 'padx':
- case 'pady':
- case 'timeout':
- case 'delay':
- $append .= ',' . strtoupper($_key) . ",$_value";
- break;
-
- case 'sticky':
- case 'left':
- case 'right':
- case 'center':
- case 'above':
- case 'below':
- case 'noclose':
- case 'autostatus':
- case 'autostatuscap':
- case 'fullhtml':
- case 'hauto':
- case 'vauto':
- case 'mouseoff':
- case 'followmouse':
- case 'closeclick':
- case 'wrap':
- if ($_value) $append .= ',' . strtoupper($_key);
- break;
-
- default:
- throw new Exception ("[popup] unknown parameter $_key", E_USER_WARNING);
- }
- }
-
- if (empty($text) && !isset($inarray) && empty($function)) {
- throw new Exception ("overlib: attribute 'text' or 'inarray' or 'function' required");
- return false;
- }
-
- if (empty($trigger)) { $trigger = "onmouseover"; }
-
- $retval = $trigger . '="return overlib(\''.preg_replace(array("!'!",'!"!',"![\r\n]!"),array("\'","\'",'\r'),$text).'\'';
- $retval .= $append . ');"';
- if ($trigger == 'onmouseover')
- $retval .= ' onmouseout="nd();"';
-
-
- return $retval;
-}
-?>
diff --git a/includes/Smarty/plugins/function.popup_init.php b/includes/Smarty/plugins/function.popup_init.php
deleted file mode 100644
index 053b155..0000000
--- a/includes/Smarty/plugins/function.popup_init.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsFunction
- */
-
-
-/**
- * Smarty {popup_init} function plugin
- *
- * Type: function<br>
- * Name: popup_init<br>
- * Purpose: initialize overlib
- * @link http://smarty.php.net/manual/en/language.function.popup.init.php {popup_init}
- * (Smarty online manual)
- * @author Monte Ohrt <monte at ohrt dot com>
- * @param array $params parameters
- * @param object $smarty Smarty object
- * @param object $template template object
- * @return string
- */
-function smarty_function_popup_init($params, $smarty, $template)
-{
- $zindex = 1000;
-
- if (!empty($params['zindex'])) {
- $zindex = $params['zindex'];
- }
-
- if (!empty($params['src'])) {
- return '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>' . "\n"
- . '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>' . "\n";
- } else {
- throw new Exception ("popup_init: missing src parameter");
- }
-}
-
-/* vim: set expandtab: */
-
-?>
diff --git a/includes/Smarty/plugins/modifier.capitalize.php b/includes/Smarty/plugins/modifier.capitalize.php
deleted file mode 100644
index acff0bc..0000000
--- a/includes/Smarty/plugins/modifier.capitalize.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsModifier
- */
-
-
-/**
- * Smarty capitalize modifier plugin
- *
- * Type: modifier<br>
- * Name: capitalize<br>
- * Purpose: capitalize words in the string
- * @link http://smarty.php.net/manual/en/language.modifiers.php#LANGUAGE.MODIFIER.CAPITALIZE
- * capitalize (Smarty online manual)
- * @author Monte Ohrt <monte at ohrt dot com>
- * @param string
- * @return string
- */
-function smarty_modifier_capitalize($string, $uc_digits = false)
-{
- smarty_modifier_capitalize_ucfirst(null, $uc_digits);
- return preg_replace_callback('!\'?\b\w(\w|\')*\b!', 'smarty_modifier_capitalize_ucfirst', $string);
-}
-
-function smarty_modifier_capitalize_ucfirst($string, $uc_digits = null)
-{
- static $_uc_digits = false;
-
- if(isset($uc_digits)) {
- $_uc_digits = $uc_digits;
- return;
- }
-
- if(substr($string[0],0,1) != "'" && !preg_match("!\d!",$string[0]) || $_uc_digits)
- return ucfirst($string[0]);
- else
- return $string[0];
-}
-?>
diff --git a/includes/Smarty/plugins/modifier.cat.php b/includes/Smarty/plugins/modifier.cat.php
deleted file mode 100644
index 1b932d0..0000000
--- a/includes/Smarty/plugins/modifier.cat.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsModifier
- */
-
-
-/**
- * Smarty cat modifier plugin
- *
- * Type: modifier<br>
- * Name: cat<br>
- * Date: Feb 24, 2003
- * Purpose: catenate a value to a variable
- * Input: string to catenate
- * Example: {$var|cat:"foo"}
- * @link http://smarty.php.net/manual/en/language.modifier.cat.php cat
- * (Smarty online manual)
- * @author Monte Ohrt <monte at ohrt dot com>
- * @version 1.0
- * @param string
- * @param string
- * @return string
- */
-function smarty_modifier_cat($string, $cat)
-{
- return $string . $cat;
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.count_characters.php b/includes/Smarty/plugins/modifier.count_characters.php
deleted file mode 100644
index 6d52465..0000000
--- a/includes/Smarty/plugins/modifier.count_characters.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsModifier
- */
-
-
-/**
- * Smarty count_characters modifier plugin
- *
- * Type: modifier<br>
- * Name: count_characteres<br>
- * Purpose: count the number of characters in a text
- * @link http://smarty.php.net/manual/en/language.modifier.count.characters.php
- * count_characters (Smarty online manual)
- * @author Monte Ohrt <monte at ohrt dot com>
- * @param string $string input string
- * @param boolean $include_spaces include whitespace in the character count
- * @return integer number of characters
- */
-function smarty_modifier_count_characters($string, $include_spaces = false)
-{
- if ($include_spaces)
- return(strlen($string));
-
- return preg_match_all("/[^\s]/",$string, $match);
-}
-?>
diff --git a/includes/Smarty/plugins/modifier.count_paragraphs.php b/includes/Smarty/plugins/modifier.count_paragraphs.php
deleted file mode 100644
index 441da09..0000000
--- a/includes/Smarty/plugins/modifier.count_paragraphs.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsModifier
- */
-
-
-/**
- * Smarty count_paragraphs modifier plugin
- *
- * Type: modifier<br>
- * Name: count_paragraphs<br>
- * Purpose: count the number of paragraphs in a text
- * @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php
- * count_paragraphs (Smarty online manual)
- * @author Monte Ohrt <monte at ohrt dot com>
- * @param string
- * @return integer
- */
-function smarty_modifier_count_paragraphs($string)
-{
- // count \r or \n characters
- return count(preg_split('/[\r\n]+/', $string));
-}
-?>
diff --git a/includes/Smarty/plugins/modifier.count_sentences.php b/includes/Smarty/plugins/modifier.count_sentences.php
deleted file mode 100644
index 7783c92..0000000
--- a/includes/Smarty/plugins/modifier.count_sentences.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsModifier
- */
-
-
-/**
- * Smarty count_sentences modifier plugin
- *
- * Type: modifier<br>
- * Name: count_sentences
- * Purpose: count the number of sentences in a text
- * @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php
- * count_sentences (Smarty online manual)
- * @author Monte Ohrt <monte at ohrt dot com>
- * @param string
- * @return integer
- */
-function smarty_modifier_count_sentences($string)
-{
- // find periods with a word before but not after.
- return preg_match_all('/[^\s]\.(?!\w)/', $string, $match);
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.count_words.php b/includes/Smarty/plugins/modifier.count_words.php
deleted file mode 100644
index 1079d8f..0000000
--- a/includes/Smarty/plugins/modifier.count_words.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsModifier
- */
-
-
-/**
- * Smarty count_words modifier plugin
- *
- * Type: modifier<br>
- * Name: count_words<br>
- * Purpose: count the number of words in a text
- * @link http://smarty.php.net/manual/en/language.modifier.count.words.php
- * count_words (Smarty online manual)
- * @author Monte Ohrt <monte at ohrt dot com>
- * @param string
- * @return integer
- */
-function smarty_modifier_count_words($string)
-{
- return str_word_count($string);
-}
-?>
diff --git a/includes/Smarty/plugins/modifier.date_format.php b/includes/Smarty/plugins/modifier.date_format.php
deleted file mode 100644
index ff4a91c..0000000
--- a/includes/Smarty/plugins/modifier.date_format.php
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
-
-/**
-* Smarty date_format modifier plugin
-*
-* Type: modifier<br>
-* Name: date_format<br>
-* Purpose: format datestamps via strftime<br>
-* Input:<br>
-* - string: input date string
-* - format: strftime format for output
-* - default_date: default date if $string is empty
-*
-* @link http://smarty.php.net/manual/en/language.modifier.date.format.php date_format (Smarty online manual)
-* @author Monte Ohrt <monte at ohrt dot com>
-* @param string $
-* @param string $
-* @param string $
-* @return string |void
-* @uses smarty_make_timestamp()
-*/
-function smarty_modifier_date_format($string, $format = SMARTY_RESOURCE_DATE_FORMAT, $default_date = '')
-{
- /**
- * Include the {@link shared.make_timestamp.php} plugin
- */
- require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
- if ($string != '') {
- $timestamp = smarty_make_timestamp($string);
- } elseif ($default_date != '') {
- $timestamp = smarty_make_timestamp($default_date);
- } else {
- return;
- }
- if (DS == '\\') {
- $_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T');
- $_win_to = array('%m/%d/%y', '%b', "\n", '%I:%M:%S %p', '%H:%M', "\t", '%H:%M:%S');
- if (strpos($format, '%e') !== false) {
- $_win_from[] = '%e';
- $_win_to[] = sprintf('%\' 2d', date('j', $timestamp));
- }
- if (strpos($format, '%l') !== false) {
- $_win_from[] = '%l';
- $_win_to[] = sprintf('%\' 2d', date('h', $timestamp));
- }
- $format = str_replace($_win_from, $_win_to, $format);
- }
- return strftime($format, $timestamp);
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.debug_print_var.php b/includes/Smarty/plugins/modifier.debug_print_var.php
deleted file mode 100644
index e976d12..0000000
--- a/includes/Smarty/plugins/modifier.debug_print_var.php
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage Debug
-*/
-
-/**
-* Smarty debug_print_var modifier plugin
-*
-* Type: modifier<br>
-* Name: debug_print_var<br>
-* Purpose: formats variable contents for display in the console
-*
-* @link http://smarty.php.net/manual/en/language.modifier.debug.print.var.php debug_print_var (Smarty online manual)
-* @author Monte Ohrt <monte at ohrt dot com>
-* @param array $ |object
-* @param integer $
-* @param integer $
-* @return string
-*/
-class Smarty_Modifier_Debug_Print_Var {
- static function execute ($var, $depth = 0, $length = 40)
- {
- $_replace = array("\n" => '<i>\n</i>',
- "\r" => '<i>\r</i>',
- "\t" => '<i>\t</i>'
- );
-
- switch (gettype($var)) {
- case 'array' :
- $results = '<b>Array (' . count($var) . ')</b>';
- foreach ($var as $curr_key => $curr_val) {
- $results .= '<br>' . str_repeat('&nbsp;', $depth * 2)
- . '<b>' . strtr($curr_key, $_replace) . '</b> =&gt; '
- . self::execute($curr_val, ++$depth, $length);
- $depth--;
- }
- break;
- case 'object' :
- $object_vars = get_object_vars($var);
- $results = '<b>' . get_class($var) . ' Object (' . count($object_vars) . ')</b>';
- foreach ($object_vars as $curr_key => $curr_val) {
- $results .= '<br>' . str_repeat('&nbsp;', $depth * 2)
- . '<b> -&gt;' . strtr($curr_key, $_replace) . '</b> = '
- . self::execute($curr_val, ++$depth, $length);
- $depth--;
- }
- break;
- case 'boolean' :
- case 'NULL' :
- case 'resource' :
- if (true === $var) {
- $results = 'true';
- } elseif (false === $var) {
- $results = 'false';
- } elseif (null === $var) {
- $results = 'null';
- } else {
- $results = htmlspecialchars((string) $var);
- }
- $results = '<i>' . $results . '</i>';
- break;
- case 'integer' :
- case 'float' :
- $results = htmlspecialchars((string) $var);
- break;
- case 'string' :
- $results = strtr($var, $_replace);
- if (strlen($var) > $length) {
- $results = substr($var, 0, $length - 3) . '...';
- }
- $results = htmlspecialchars('"' . $results . '"');
- break;
- case 'unknown type' :
- default :
- $results = strtr((string) $var, $_replace);
- if (strlen($results) > $length) {
- $results = substr($results, 0, $length - 3) . '...';
- }
- $results = htmlspecialchars($results);
- }
-
- return $results;
- }
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.default.php b/includes/Smarty/plugins/modifier.default.php
deleted file mode 100644
index 2622d07..0000000
--- a/includes/Smarty/plugins/modifier.default.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsModifier
- */
-
-
-/**
- * Smarty default modifier plugin
- *
- * Type: modifier<br>
- * Name: default<br>
- * Purpose: designate default value for empty variables
- * @link http://smarty.php.net/manual/en/language.modifier.default.php
- * default (Smarty online manual)
- * @author Monte Ohrt <monte at ohrt dot com>
- * @param string
- * @param string
- * @return string
- */
-function smarty_modifier_default($string, $default = '')
-{
- if (!isset($string) || $string === '')
- return $default;
- else
- return $string;
-}
-?>
diff --git a/includes/Smarty/plugins/modifier.escape.php b/includes/Smarty/plugins/modifier.escape.php
deleted file mode 100644
index 0e58d8b..0000000
--- a/includes/Smarty/plugins/modifier.escape.php
+++ /dev/null
@@ -1,111 +0,0 @@
-<?php
-
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
-
-/**
-* Smarty escape modifier plugin
-*
-* Type: modifier<br>
-* Name: escape<br>
-* Purpose: escape string for output
-*
-* @link http://smarty.php.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online manual)
-* @author Monte Ohrt <monte at ohrt dot com>
-* @param string $string input string
-* @param string $esc_type escape type
-* @param string $char_set character set
-* @return string escaped input string
-*/
-function smarty_modifier_escape($string, $esc_type = 'html', $char_set = SMARTY_RESOURCE_CHAR_SET)
-{
- switch ($esc_type) {
- case 'html':
- return htmlspecialchars($string, ENT_QUOTES, $char_set);
-
- case 'htmlall':
- return htmlentities($string, ENT_QUOTES, $char_set);
-
- case 'url':
- return rawurlencode($string);
-
- case 'urlpathinfo':
- return str_replace('%2F', '/', rawurlencode($string));
-
- case 'quotes':
- // escape unescaped single quotes
- return preg_replace("%(?<!\\\\)'%", "\\'", $string);
-
- case 'hex':
- // escape every character into hex
- $return = '';
- for ($x = 0; $x < strlen($string); $x++) {
- $return .= '%' . bin2hex($string[$x]);
- }
- return $return;
-
- case 'hexentity':
- $return = '';
- for ($x = 0; $x < strlen($string); $x++) {
- $return .= '&#x' . bin2hex($string[$x]) . ';';
- }
- return $return;
-
- case 'decentity':
- $return = '';
- for ($x = 0; $x < strlen($string); $x++) {
- $return .= '&#' . ord($string[$x]) . ';';
- }
- return $return;
-
- case 'javascript':
- // escape quotes and backslashes, newlines, etc.
- return strtr($string, array('\\' => '\\\\', "'" => "\\'", '"' => '\\"', "\r" => '\\r', "\n" => '\\n', '</' => '<\/'));
-
- case 'mail':
- // safe way to display e-mail address on a web page
- if ($smarty->has_mb) {
- return mb_str_replace(array('@', '.'), array(' [AT] ', ' [DOT] '), $string);
- } else {
- return str_replace(array('@', '.'), array(' [AT] ', ' [DOT] '), $string);
- }
-
- case 'nonstd':
- // escape non-standard chars, such as ms document quotes
- $_res = '';
- for($_i = 0, $_len = strlen($string); $_i < $_len; $_i++) {
- $_ord = ord(substr($string, $_i, 1));
- // non-standard char, escape it
- if ($_ord >= 126) {
- $_res .= '&#' . $_ord . ';';
- } else {
- $_res .= substr($string, $_i, 1);
- }
- }
- return $_res;
-
- default:
- return $string;
- }
- if (!function_exists("mb_str_replace")) {
- // simulate the missing PHP mb_str_replace function
- function mb_str_replace($needle, $replacement, $haystack)
- {
- $needle_len = mb_strlen($needle);
- $replacement_len = mb_strlen($replacement);
- $pos = mb_strpos($haystack, $needle, 0);
- while ($pos !== false) {
- $haystack = mb_substr($haystack, 0, $pos) . $replacement
- . mb_substr($haystack, $pos + $needle_len);
- $pos = mb_strpos($haystack, $needle, $pos + $replacement_len);
- }
- return $haystack;
- }
- }
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.indent.php b/includes/Smarty/plugins/modifier.indent.php
deleted file mode 100644
index 4f2f9d8..0000000
--- a/includes/Smarty/plugins/modifier.indent.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsModifier
- */
-
-
-/**
- * Smarty indent modifier plugin
- *
- * Type: modifier<br>
- * Name: indent<br>
- * Purpose: indent lines of text
- * @link http://smarty.php.net/manual/en/language.modifier.indent.php
- * indent (Smarty online manual)
- * @author Monte Ohrt <monte at ohrt dot com>
- * @param string
- * @param integer
- * @param string
- * @return string
- */
-function smarty_modifier_indent($string,$chars=4,$char=" ")
-{
- return preg_replace('!^!m',str_repeat($char,$chars),$string);
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.lower.php b/includes/Smarty/plugins/modifier.lower.php
deleted file mode 100644
index 34a609e..0000000
--- a/includes/Smarty/plugins/modifier.lower.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
-
-/**
-* Smarty lower modifier plugin
-*
-* Type: modifier<br>
-* Name: lower<br>
-* Purpose: convert string to lowercase
-*
-* @link http://smarty.php.net/manual/en/language.modifier.lower.php lower (Smarty online manual)
-* @author Monte Ohrt <monte at ohrt dot com>
-* @param string $
-* @return string
-*/
-function smarty_modifier_lower($string)
-{
- if (function_exists('mb_strtolower')) {
- return mb_strtolower($string);
- } else {
- return strtolower($string);
- }
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.noprint.php b/includes/Smarty/plugins/modifier.noprint.php
deleted file mode 100644
index 3e9df06..0000000
--- a/includes/Smarty/plugins/modifier.noprint.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsModifier
- */
-
-
-/**
- * Smarty noprint modifier plugin
- *
- * Type: modifier<br>
- * Name: noprint<br>
- * Purpose: return an empty string
- * @author Uwe Tews
- * @param string
- * @return string
- */
-function smarty_modifier_noprint($string)
-{
- return '';
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.regex_replace.php b/includes/Smarty/plugins/modifier.regex_replace.php
deleted file mode 100644
index 100b58c..0000000
--- a/includes/Smarty/plugins/modifier.regex_replace.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage plugins
- */
-
-
-/**
- * Smarty regex_replace modifier plugin
- *
- * Type: modifier<br>
- * Name: regex_replace<br>
- * Purpose: regular expression search/replace
- * @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php
- * regex_replace (Smarty online manual)
- * @author Monte Ohrt <monte at ohrt dot com>
- * @param string
- * @param string|array
- * @param string|array
- * @return string
- */
-function smarty_modifier_regex_replace($string, $search, $replace)
-{
- if(is_array($search)) {
- foreach($search as $idx => $s)
- $search[$idx] = _smarty_regex_replace_check($s);
- } else {
- $search = _smarty_regex_replace_check($search);
- }
-
- return preg_replace($search, $replace, $string);
-}
-
-function _smarty_regex_replace_check($search)
-{
- if (($pos = strpos($search,"\0")) !== false)
- $search = substr($search,0,$pos);
- if (preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) {
- /* remove eval-modifier from $search */
- $search = substr($search, 0, -strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]);
- }
- return $search;
-}
-
-/* vim: set expandtab: */
-
-?>
diff --git a/includes/Smarty/plugins/modifier.replace.php b/includes/Smarty/plugins/modifier.replace.php
deleted file mode 100644
index 5f70979..0000000
--- a/includes/Smarty/plugins/modifier.replace.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
-
-/**
-* Smarty replace modifier plugin
-*
-* Type: modifier<br>
-* Name: replace<br>
-* Purpose: simple search/replace
-*
-* @link http://smarty.php.net/manual/en/language.modifier.replace.php replace (Smarty online manual)
-* @author Monte Ohrt <monte at ohrt dot com>
-* @author Uwe Tews
-* @param string $
-* @param string $
-* @param string $
-* @return string
-*/
-function smarty_modifier_replace($string, $search, $replace)
-{
- if (!function_exists("mb_str_replace")) {
- // simulate the missing PHP mb_str_replace function
- function mb_str_replace($needle, $replacement, $haystack)
- {
- $needle_len = mb_strlen($needle);
- $replacement_len = mb_strlen($replacement);
- $pos = mb_strpos($haystack, $needle, 0);
- while ($pos !== false) {
- $haystack = mb_substr($haystack, 0, $pos) . $replacement
- . mb_substr($haystack, $pos + $needle_len);
- $pos = mb_strpos($haystack, $needle, $pos + $replacement_len);
- }
- return $haystack;
- }
- }
- if (function_exists('mb_substr')) {
- return mb_str_replace($search, $replace, $string);
- } else {
- return str_replace($search, $replace, $string);
- }
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.romanize.php b/includes/Smarty/plugins/modifier.romanize.php
deleted file mode 100644
index 022156b..0000000
--- a/includes/Smarty/plugins/modifier.romanize.php
+++ /dev/null
@@ -1,88 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
-
-/**
-* Smarty romanize modifier plugin
-*
-* Type: modifier<br>
-* Name: romanize<br>
-* Purpose: prints a number in roman
-*
-* @param int $
-* @return string
-*/
-function smarty_modifier_romanize ($number) {
- return romanize($number);
-}
-
-function romanize ($number) {
- switch ($number) {
- //Avoid return 'v' . romanize($number - 5); to speed up
- case 1: return 'i';
- case 2: return 'ii';
- case 3: return 'iii';
- case 4: return 'iv';
- case 5: return 'v';
- case 6: return 'vi';
- case 7: return 'vii';
- case 8: return 'viii';
- case 9: return 'ix';
- case 10: return 'x';
-
- case 50: return 'l';
- case 100: return 'c';
- case 500: return 'd';
- case 1000: return 'm';
-
- default:
- if ($number < 21)
- return 'x' . romanize($number - 10);
- elseif ($number < 30)
- return 'xx' . romanize($number - 20);
- elseif ($number < 40)
- return 'xxx' . romanize($number - 30);
- elseif ($number < 50)
- return 'xl' . romanize($number - 40);
- elseif ($number < 60)
- return 'l' . romanize($number - 50);
- elseif ($number < 70)
- return 'lx' . romanize($number - 60);
- elseif ($number < 80)
- return 'lxx' . romanize($number - 70);
- elseif ($number < 90)
- return 'lxxx' . romanize($number - 80);
- elseif ($number < 100)
- return 'xc' . romanize($number - 90);
- elseif ($number < 200)
- return 'c' . romanize($number - 100);
- elseif ($number < 300)
- return 'cc' . romanize($number - 200);
- elseif ($number < 400)
- return 'ccc' . romanize($number - 300);
- elseif ($number < 500)
- return 'cd' . romanize($number - 400);
- elseif ($number < 600)
- return 'd' . romanize($number - 500);
- elseif ($number < 700)
- return 'dc' . romanize($number - 600);
- elseif ($number < 800)
- return 'dcc' . romanize($number - 700);
- elseif ($number < 900)
- return 'dccc' . romanize($number - 800);
- elseif ($number < 1000)
- return 'cm' . romanize($number - 800);
- elseif (is_numeric($number)) {
- $m = floor($number / 1000);
- return str_repeat('m', $m) . romanize($number - $m);
- }
- else
- return $number; //Not a arab number
- }
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.spacify.php b/includes/Smarty/plugins/modifier.spacify.php
deleted file mode 100644
index d2593ec..0000000
--- a/includes/Smarty/plugins/modifier.spacify.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
-
-/**
-* Smarty spacify modifier plugin
-*
-* Type: modifier<br>
-* Name: spacify<br>
-* Purpose: add spaces between characters in a string
-*
-* @link http://smarty.php.net/manual/en/language.modifier.spacify.php spacify (Smarty online manual)
-* @author Monte Ohrt <monte at ohrt dot com>
-* @param string $
-* @param string $
-* @return string
-*/
-function smarty_modifier_spacify($string, $spacify_char = ' ')
-{
- return implode($spacify_char, preg_split('//', $string, -1));
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.string_format.php b/includes/Smarty/plugins/modifier.string_format.php
deleted file mode 100644
index fd96c8b..0000000
--- a/includes/Smarty/plugins/modifier.string_format.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
-
-/**
-* Smarty string_format modifier plugin
-*
-* Type: modifier<br>
-* Name: string_format<br>
-* Purpose: format strings via sprintf
-*
-* @link http://smarty.php.net/manual/en/language.modifier.string.format.php string_format (Smarty online manual)
-* @author Monte Ohrt <monte at ohrt dot com>
-* @param string $string input string
-* @param string $format format string
-* @return string formatted string
-*/
- function smarty_modifier_string_format($string, $format)
- {
- return sprintf($format, $string);
- }
-
-?>
diff --git a/includes/Smarty/plugins/modifier.string_format.php.orig b/includes/Smarty/plugins/modifier.string_format.php.orig
deleted file mode 100644
index dd1fa2a..0000000
--- a/includes/Smarty/plugins/modifier.string_format.php.orig
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
-
-/**
-* Smarty string_format modifier plugin
-*
-* Type: modifier<br>
-* Name: string_format<br>
-* Purpose: format strings via sprintf
-*
-* @link http://smarty.php.net/manual/en/language.modifier.string.format.php string_format (Smarty online manual)
-* @author Monte Ohrt <monte at ohrt dot com>
-* @param string $string input string
-* @param string $format format string
-* @return string formatted string
-*/
- function smarty_modifier_string_format($string, $format)
- {
- return sprintf($format, $string);
- }
-
-?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifier.strip.php b/includes/Smarty/plugins/modifier.strip.php
deleted file mode 100644
index 39f0f9f..0000000
--- a/includes/Smarty/plugins/modifier.strip.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
-
-/**
-* Smarty strip modifier plugin
-*
-* Type: modifier<br>
-* Name: strip<br>
-* Purpose: Replace all repeated spaces, newlines, tabs
-* with a single space or supplied replacement string.<br>
-* Example: {$var|strip} {$var|strip:"&nbsp;"}
-* Date: September 25th, 2002
-*
-* @link http://smarty.php.net/manual/en/language.modifier.strip.php strip (Smarty online manual)
-* @author Monte Ohrt <monte at ohrt dot com>
-* @version 1.0
-* @param string $
-* @param string $
-* @return string
-*/
-function smarty_modifier_strip($text, $replace = ' ')
-{
- return preg_replace('!\s+!', $replace, $text);
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.strip_tags.php b/includes/Smarty/plugins/modifier.strip_tags.php
deleted file mode 100644
index 6af08b2..0000000
--- a/includes/Smarty/plugins/modifier.strip_tags.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
-
-/**
-* Smarty strip_tags modifier plugin
-*
-* Type: modifier<br>
-* Name: strip_tags<br>
-* Purpose: strip html tags from text
-*
-* @link http://smarty.php.net/manual/en/language.modifier.strip.tags.php strip_tags (Smarty online manual)
-* @author Monte Ohrt <monte at ohrt dot com>
-* @param string $
-* @param boolean $
-* @return string
-*/
-function smarty_modifier_strip_tags($string, $replace_with_space = true)
-{
- if ($replace_with_space) {
- return preg_replace('!<[^>]*?>!', ' ', $string);
- } else {
- return strip_tags($string);
- }
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.text2html.php b/includes/Smarty/plugins/modifier.text2html.php
deleted file mode 100644
index 3244a91..0000000
--- a/includes/Smarty/plugins/modifier.text2html.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage plugins
- */
-
-
-/**
- * Smarty lower modifier plugin
- *
- * Type: modifier<br>
- * Name: yyyymmdd<br>
- * Purpose: Appends dashes to yyyymmdd string to output yyyy-mm-dd
- * @author Wolfaeym
- * @param string
- * @return string
- */
-function smarty_modifier_text2html($string)
-{
- //HTML entities
- $string = htmlspecialchars($string, ENT_QUOTES);
-
- //E-mail -> mailto links
- $string = preg_replace("/([_a-z0-9-]+(\._a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+)/i", "<a href=\"mailto:\\1\">\\1</A>", $string);
-
- //Linkify URLs
- //TODO handle www.
- //TODO Relative links for current domain
- $string = preg_replace("@([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])@i", "<a href=\"\\1://\\2\\3\">\\1://\\2\\3</a>", $string);
-
- //\n -> <br />
- $string = nl2br($string);
-
- return $string;
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.truncate.php b/includes/Smarty/plugins/modifier.truncate.php
deleted file mode 100644
index 943a8ab..0000000
--- a/includes/Smarty/plugins/modifier.truncate.php
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
-
-/**
-* Smarty truncate modifier plugin
-*
-* Type: modifier<br>
-* Name: truncate<br>
-* Purpose: Truncate a string to a certain length if necessary,
-* optionally splitting in the middle of a word, and
-* appending the $etc string or inserting $etc into the middle.
-*
-* @link http://smarty.php.net/manual/en/language.modifier.truncate.php truncate (Smarty online manual)
-* @author Monte Ohrt <monte at ohrt dot com>
-* @param string $string input string
-* @param integer $length lenght of truncated text
-* @param string $etc end string
-* @param boolean $break_words truncate at word boundary
-* @param boolean $middle truncate in the middle of text
-* @return string truncated string
-*/
-function smarty_modifier_truncate($string, $length = 80, $etc = '...',
- $break_words = false, $middle = false)
-{
- if ($length == 0)
- return '';
-
- if (is_callable('mb_strlen')) {
- if (mb_strlen($string) > $length) {
- $length -= min($length, mb_strlen($etc));
- if (!$break_words && !$middle) {
- $string = mb_ereg_replace('/\s+?(\S+)?$/', '', mb_substr($string, 0, $length + 1), 'p');
- }
- if (!$middle) {
- return mb_substr($string, 0, $length) . $etc;
- } else {
- return mb_substr($string, 0, $length / 2) . $etc . mb_substr($string, - $length / 2);
- }
- } else {
- return $string;
- }
- } else {
- if (strlen($string) > $length) {
- $length -= min($length, strlen($etc));
- if (!$break_words && !$middle) {
- $string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length + 1));
- }
- if (!$middle) {
- return substr($string, 0, $length) . $etc;
- } else {
- return substr($string, 0, $length / 2) . $etc . substr($string, - $length / 2);
- }
- } else {
- return $string;
- }
- }
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.upper.php b/includes/Smarty/plugins/modifier.upper.php
deleted file mode 100644
index fefa854..0000000
--- a/includes/Smarty/plugins/modifier.upper.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
-
-/**
-* Smarty upper modifier plugin
-*
-* Type: modifier<br>
-* Name: upper<br>
-* Purpose: convert string to uppercase
-*
-* @link http://smarty.php.net/manual/en/language.modifier.upper.php upper (Smarty online manual)
-* @author Monte Ohrt <monte at ohrt dot com>
-* @param string $
-* @return string
-*/
-function smarty_modifier_upper($string)
-{
- if (function_exists('mb_strtoupper')) {
- return mb_strtoupper($string);
- } else {
- return strtoupper($string);
- }
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.wordwrap.php b/includes/Smarty/plugins/modifier.wordwrap.php
deleted file mode 100644
index 92a79de..0000000
--- a/includes/Smarty/plugins/modifier.wordwrap.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsModifier
- */
-
-
-/**
- * Smarty wordwrap modifier plugin
- *
- * Type: modifier<br>
- * Name: wordwrap<br>
- * Purpose: wrap a string of text at a given length
- * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php
- * wordwrap (Smarty online manual)
- * @author Monte Ohrt <monte at ohrt dot com>
- * @param string
- * @param integer
- * @param string
- * @param boolean
- * @return string
- */
-function smarty_modifier_wordwrap($string,$length=80,$break="\n",$cut=false)
-{
- return wordwrap($string,$length,$break,$cut);
-}
-
-?>
diff --git a/includes/Smarty/plugins/modifier.yyyymmdd.php b/includes/Smarty/plugins/modifier.yyyymmdd.php
deleted file mode 100644
index 11320a5..0000000
--- a/includes/Smarty/plugins/modifier.yyyymmdd.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage plugins
- */
-
-
-/**
- * Smarty lower modifier plugin
- *
- * Type: modifier<br>
- * Name: yyyymmdd<br>
- * Purpose: Appends dashes to yyyymmdd string to output yyyy-mm-dd
- * @author Wolfaeym
- * @param string
- * @return string
- */
-function smarty_modifier_yyyymmdd($string)
-{
- return substr($string, 0, 4) . '-' . substr($string, 4, 2)
- . '-' . substr($string, 6, 2);
-}
-
-?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.cat.php b/includes/Smarty/plugins/modifiercompiler.cat.php
new file mode 100755
index 0000000..1cfe630
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.cat.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty cat modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: cat<br>
+ * Date: Feb 24, 2003<br>
+ * Purpose: catenate a value to a variable<br>
+ * Input: string to catenate<br>
+ * Example: {$var|cat:"foo"}
+ *
+ * @link http://smarty.php.net/manual/en/language.modifier.cat.php cat
+ * (Smarty online manual)
+ * @author Uwe Tews
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+function smarty_modifiercompiler_cat($params, $compiler)
+{
+ return '('.implode(').(', $params).')';
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.count_characters.php b/includes/Smarty/plugins/modifiercompiler.count_characters.php
new file mode 100755
index 0000000..98e8efa
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.count_characters.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty count_characters modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: count_characteres<br>
+ * Purpose: count the number of characters in a text
+ *
+ * @link http://www.smarty.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online manual)
+ * @author Uwe Tews
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+function smarty_modifiercompiler_count_characters($params, $compiler)
+{
+ if (!isset($params[1]) || $params[1] != 'true') {
+ return 'preg_match_all(\'/[^\s]/' . Smarty::$_UTF8_MODIFIER . '\',' . $params[0] . ', $tmp)';
+ }
+ if (Smarty::$_MBSTRING) {
+ return 'mb_strlen(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')';
+ }
+ // no MBString fallback
+ return 'strlen(' . $params[0] . ')';
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.count_paragraphs.php b/includes/Smarty/plugins/modifiercompiler.count_paragraphs.php
new file mode 100755
index 0000000..0e1b0af
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.count_paragraphs.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty count_paragraphs modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: count_paragraphs<br>
+ * Purpose: count the number of paragraphs in a text
+ *
+ * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php
+ * count_paragraphs (Smarty online manual)
+ * @author Uwe Tews
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+function smarty_modifiercompiler_count_paragraphs($params, $compiler)
+{
+ // count \r or \n characters
+ return '(preg_match_all(\'#[\r\n]+#\', ' . $params[0] . ', $tmp)+1)';
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.count_sentences.php b/includes/Smarty/plugins/modifiercompiler.count_sentences.php
new file mode 100755
index 0000000..2f517be
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.count_sentences.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty count_sentences modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: count_sentences
+ * Purpose: count the number of sentences in a text
+ *
+ * @link http://www.smarty.net/manual/en/language.modifier.count.paragraphs.php
+ * count_sentences (Smarty online manual)
+ * @author Uwe Tews
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+function smarty_modifiercompiler_count_sentences($params, $compiler)
+{
+ // find periods, question marks, exclamation marks with a word before but not after.
+ return 'preg_match_all("#\w[\.\?\!](\W|$)#S' . Smarty::$_UTF8_MODIFIER . '", ' . $params[0] . ', $tmp)';
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.count_words.php b/includes/Smarty/plugins/modifiercompiler.count_words.php
new file mode 100755
index 0000000..e05738c
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.count_words.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty count_words modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: count_words<br>
+ * Purpose: count the number of words in a text
+ *
+ * @link http://www.smarty.net/manual/en/language.modifier.count.words.php count_words (Smarty online manual)
+ * @author Uwe Tews
+ * @param array $params parameters
+ * @return string with compiled code
+*/
+function smarty_modifiercompiler_count_words($params, $compiler)
+{
+ if (Smarty::$_MBSTRING) {
+ // return 'preg_match_all(\'#[\w\pL]+#' . Smarty::$_UTF8_MODIFIER . '\', ' . $params[0] . ', $tmp)';
+ // expression taken from http://de.php.net/manual/en/function.str-word-count.php#85592
+ return 'preg_match_all(\'/\p{L}[\p{L}\p{Mn}\p{Pd}\\\'\x{2019}]*/' . Smarty::$_UTF8_MODIFIER . '\', ' . $params[0] . ', $tmp)';
+ }
+ // no MBString fallback
+ return 'str_word_count(' . $params[0] . ')';
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.default.php b/includes/Smarty/plugins/modifiercompiler.default.php
new file mode 100755
index 0000000..4f831a5
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.default.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty default modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: default<br>
+ * Purpose: designate default value for empty variables
+ *
+ * @link http://www.smarty.net/manual/en/language.modifier.default.php default (Smarty online manual)
+ * @author Uwe Tews
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+function smarty_modifiercompiler_default ($params, $compiler)
+{
+ $output = $params[0];
+ if (!isset($params[1])) {
+ $params[1] = "''";
+ }
+
+ array_shift($params);
+ foreach ($params as $param) {
+ $output = '(($tmp = @' . $output . ')===null||$tmp===\'\' ? ' . $param . ' : $tmp)';
+ }
+ return $output;
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.escape.php b/includes/Smarty/plugins/modifiercompiler.escape.php
new file mode 100755
index 0000000..b4cd3c8
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.escape.php
@@ -0,0 +1,90 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * @ignore
+ */
+require_once( SMARTY_PLUGINS_DIR .'shared.literal_compiler_param.php' );
+
+/**
+ * Smarty escape modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: escape<br>
+ * Purpose: escape string for output
+ *
+ * @link http://www.smarty.net/docsv2/en/language.modifier.escape count_characters (Smarty online manual)
+ * @author Rodney Rehm
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+function smarty_modifiercompiler_escape($params, $compiler)
+{
+ try {
+ $esc_type = smarty_literal_compiler_param($params, 1, 'html');
+ $char_set = smarty_literal_compiler_param($params, 2, Smarty::$_CHARSET);
+ $double_encode = smarty_literal_compiler_param($params, 3, true);
+
+ if (!$char_set) {
+ $char_set = Smarty::$_CHARSET;
+ }
+
+ switch ($esc_type) {
+ case 'html':
+ return 'htmlspecialchars('
+ . $params[0] .', ENT_QUOTES, '
+ . var_export($char_set, true) . ', '
+ . var_export($double_encode, true) . ')';
+
+ case 'htmlall':
+ if (Smarty::$_MBSTRING) {
+ return 'mb_convert_encoding(htmlspecialchars('
+ . $params[0] .', ENT_QUOTES, '
+ . var_export($char_set, true) . ', '
+ . var_export($double_encode, true)
+ . '), "HTML-ENTITIES", '
+ . var_export($char_set, true) . ')';
+ }
+
+ // no MBString fallback
+ return 'htmlentities('
+ . $params[0] .', ENT_QUOTES, '
+ . var_export($char_set, true) . ', '
+ . var_export($double_encode, true) . ')';
+
+ case 'url':
+ return 'rawurlencode(' . $params[0] . ')';
+
+ case 'urlpathinfo':
+ return 'str_replace("%2F", "/", rawurlencode(' . $params[0] . '))';
+
+ case 'quotes':
+ // escape unescaped single quotes
+ return 'preg_replace("%(?<!\\\\\\\\)\'%", "\\\'",' . $params[0] . ')';
+
+ case 'javascript':
+ // escape quotes and backslashes, newlines, etc.
+ return 'strtr(' . $params[0] . ', array("\\\\" => "\\\\\\\\", "\'" => "\\\\\'", "\"" => "\\\\\"", "\\r" => "\\\\r", "\\n" => "\\\n", "</" => "<\/" ))';
+
+ }
+ } catch(SmartyException $e) {
+ // pass through to regular plugin fallback
+ }
+
+ // could not optimize |escape call, so fallback to regular plugin
+ if ($compiler->tag_nocache | $compiler->nocache) {
+ $compiler->template->required_plugins['nocache']['escape']['modifier']['file'] = SMARTY_PLUGINS_DIR .'modifier.escape.php';
+ $compiler->template->required_plugins['nocache']['escape']['modifier']['function'] = 'smarty_modifier_escape';
+ } else {
+ $compiler->template->required_plugins['compiled']['escape']['modifier']['file'] = SMARTY_PLUGINS_DIR .'modifier.escape.php';
+ $compiler->template->required_plugins['compiled']['escape']['modifier']['function'] = 'smarty_modifier_escape';
+ }
+ return 'smarty_modifier_escape(' . join( ', ', $params ) . ')';
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.from_charset.php b/includes/Smarty/plugins/modifiercompiler.from_charset.php
new file mode 100755
index 0000000..93b568a
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.from_charset.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty from_charset modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: from_charset<br>
+ * Purpose: convert character encoding from $charset to internal encoding
+ *
+ * @author Rodney Rehm
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+function smarty_modifiercompiler_from_charset($params, $compiler)
+{
+ if (!Smarty::$_MBSTRING) {
+ // FIXME: (rodneyrehm) shouldn't this throw an error?
+ return $params[0];
+ }
+
+ if (!isset($params[1])) {
+ $params[1] = '"ISO-8859-1"';
+ }
+
+ return 'mb_convert_encoding(' . $params[0] . ', "' . addslashes(Smarty::$_CHARSET) . '", ' . $params[1] . ')';
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.indent.php b/includes/Smarty/plugins/modifiercompiler.indent.php
new file mode 100755
index 0000000..020c4fd
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.indent.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty indent modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: indent<br>
+ * Purpose: indent lines of text
+ *
+ * @link http://www.smarty.net/manual/en/language.modifier.indent.php indent (Smarty online manual)
+ * @author Uwe Tews
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+
+function smarty_modifiercompiler_indent($params, $compiler)
+{
+ if (!isset($params[1])) {
+ $params[1] = 4;
+ }
+ if (!isset($params[2])) {
+ $params[2] = "' '";
+ }
+ return 'preg_replace(\'!^!m\',str_repeat(' . $params[2] . ',' . $params[1] . '),' . $params[0] . ')';
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.lower.php b/includes/Smarty/plugins/modifiercompiler.lower.php
new file mode 100755
index 0000000..1845cc1
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.lower.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty lower modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: lower<br>
+ * Purpose: convert string to lowercase
+ *
+ * @link http://www.smarty.net/manual/en/language.modifier.lower.php lower (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author Uwe Tews
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+
+function smarty_modifiercompiler_lower($params, $compiler)
+{
+ if (Smarty::$_MBSTRING) {
+ return 'mb_strtolower(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')' ;
+ }
+ // no MBString fallback
+ return 'strtolower(' . $params[0] . ')';
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.noprint.php b/includes/Smarty/plugins/modifiercompiler.noprint.php
new file mode 100755
index 0000000..3ca2657
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.noprint.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty noprint modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: noprint<br>
+ * Purpose: return an empty string
+ *
+ * @author Uwe Tews
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+function smarty_modifiercompiler_noprint($params, $compiler)
+{
+ return "''";
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.string_format.php b/includes/Smarty/plugins/modifiercompiler.string_format.php
new file mode 100755
index 0000000..8334597
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.string_format.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty string_format modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: string_format<br>
+ * Purpose: format strings via sprintf
+ *
+ * @link http://www.smarty.net/manual/en/language.modifier.string.format.php string_format (Smarty online manual)
+ * @author Uwe Tews
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+function smarty_modifiercompiler_string_format($params, $compiler)
+{
+ return 'sprintf(' . $params[1] . ',' . $params[0] . ')';
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.strip.php b/includes/Smarty/plugins/modifiercompiler.strip.php
new file mode 100755
index 0000000..f1d5db0
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.strip.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty strip modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: strip<br>
+ * Purpose: Replace all repeated spaces, newlines, tabs
+ * with a single space or supplied replacement string.<br>
+ * Example: {$var|strip} {$var|strip:"&nbsp;"}<br>
+ * Date: September 25th, 2002
+ *
+ * @link http://www.smarty.net/manual/en/language.modifier.strip.php strip (Smarty online manual)
+ * @author Uwe Tews
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+
+function smarty_modifiercompiler_strip($params, $compiler)
+{
+ if (!isset($params[1])) {
+ $params[1] = "' '";
+ }
+ return "preg_replace('!\s+!" . Smarty::$_UTF8_MODIFIER . "', {$params[1]},{$params[0]})";
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.strip_tags.php b/includes/Smarty/plugins/modifiercompiler.strip_tags.php
new file mode 100755
index 0000000..296a3a2
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.strip_tags.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty strip_tags modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: strip_tags<br>
+ * Purpose: strip html tags from text
+ *
+ * @link http://www.smarty.net/manual/en/language.modifier.strip.tags.php strip_tags (Smarty online manual)
+ * @author Uwe Tews
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+function smarty_modifiercompiler_strip_tags($params, $compiler)
+{
+ if (!isset($params[1])) {
+ $params[1] = true;
+ }
+ if ($params[1] === true) {
+ return "preg_replace('!<[^>]*?>!', ' ', {$params[0]})";
+ } else {
+ return 'strip_tags(' . $params[0] . ')';
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.to_charset.php b/includes/Smarty/plugins/modifiercompiler.to_charset.php
new file mode 100755
index 0000000..f5cdf45
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.to_charset.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty to_charset modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: to_charset<br>
+ * Purpose: convert character encoding from internal encoding to $charset
+ *
+ * @author Rodney Rehm
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+function smarty_modifiercompiler_to_charset($params, $compiler)
+{
+ if (!Smarty::$_MBSTRING) {
+ // FIXME: (rodneyrehm) shouldn't this throw an error?
+ return $params[0];
+ }
+
+ if (!isset($params[1])) {
+ $params[1] = '"ISO-8859-1"';
+ }
+
+ return 'mb_convert_encoding(' . $params[0] . ', ' . $params[1] . ', "' . addslashes(Smarty::$_CHARSET) . '")';
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.unescape.php b/includes/Smarty/plugins/modifiercompiler.unescape.php
new file mode 100755
index 0000000..4321ff1
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.unescape.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty unescape modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: unescape<br>
+ * Purpose: unescape html entities
+ *
+ * @author Rodney Rehm
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+function smarty_modifiercompiler_unescape($params, $compiler)
+{
+ if (!isset($params[1])) {
+ $params[1] = 'html';
+ }
+ if (!isset($params[2])) {
+ $params[2] = '\'' . addslashes(Smarty::$_CHARSET) . '\'';
+ } else {
+ $params[2] = "'" . $params[2] . "'";
+ }
+
+ switch (trim($params[1], '"\'')) {
+ case 'entity':
+ case 'htmlall':
+ if (Smarty::$_MBSTRING) {
+ return 'mb_convert_encoding(' . $params[0] . ', ' . $params[2] . ', \'HTML-ENTITIES\')';
+ }
+
+ return 'html_entity_decode(' . $params[0] . ', ENT_NOQUOTES, ' . $params[2] . ')';
+
+ case 'html':
+ return 'htmlspecialchars_decode(' . $params[0] . ', ENT_QUOTES)';
+
+ case 'url':
+ return 'rawurldecode(' . $params[0] . ')';
+
+ default:
+ return $params[0];
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.upper.php b/includes/Smarty/plugins/modifiercompiler.upper.php
new file mode 100755
index 0000000..f368e37
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.upper.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty upper modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: lower<br>
+ * Purpose: convert string to uppercase
+ *
+ * @link http://smarty.php.net/manual/en/language.modifier.upper.php lower (Smarty online manual)
+ * @author Uwe Tews
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+function smarty_modifiercompiler_upper($params, $compiler)
+{
+ if (Smarty::$_MBSTRING) {
+ return 'mb_strtoupper(' . $params[0] . ', \'' . addslashes(Smarty::$_CHARSET) . '\')' ;
+ }
+ // no MBString fallback
+ return 'strtoupper(' . $params[0] . ')';
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/modifiercompiler.wordwrap.php b/includes/Smarty/plugins/modifiercompiler.wordwrap.php
new file mode 100755
index 0000000..f6845ad
--- /dev/null
+++ b/includes/Smarty/plugins/modifiercompiler.wordwrap.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsModifierCompiler
+ */
+
+/**
+ * Smarty wordwrap modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: wordwrap<br>
+ * Purpose: wrap a string of text at a given length
+ *
+ * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php wordwrap (Smarty online manual)
+ * @author Uwe Tews
+ * @param array $params parameters
+ * @return string with compiled code
+ */
+function smarty_modifiercompiler_wordwrap($params, $compiler)
+{
+ if (!isset($params[1])) {
+ $params[1] = 80;
+ }
+ if (!isset($params[2])) {
+ $params[2] = '"\n"';
+ }
+ if (!isset($params[3])) {
+ $params[3] = 'false';
+ }
+ $function = 'wordwrap';
+ if (Smarty::$_MBSTRING) {
+ if ($compiler->tag_nocache | $compiler->nocache) {
+ $compiler->template->required_plugins['nocache']['wordwrap']['modifier']['file'] = SMARTY_PLUGINS_DIR .'shared.mb_wordwrap.php';
+ $compiler->template->required_plugins['nocache']['wordwrap']['modifier']['function'] = 'smarty_mb_wordwrap';
+ } else {
+ $compiler->template->required_plugins['compiled']['wordwrap']['modifier']['file'] = SMARTY_PLUGINS_DIR .'shared.mb_wordwrap.php';
+ $compiler->template->required_plugins['compiled']['wordwrap']['modifier']['function'] = 'smarty_mb_wordwrap';
+ }
+ $function = 'smarty_mb_wordwrap';
+ }
+ return $function . '(' . $params[0] . ',' . $params[1] . ',' . $params[2] . ',' . $params[3] . ')';
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/outputfilter.trimwhitespace.php b/includes/Smarty/plugins/outputfilter.trimwhitespace.php
deleted file mode 100644
index ce5fde9..0000000
--- a/includes/Smarty/plugins/outputfilter.trimwhitespace.php
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package Smarty
- * @subpackage PluginsFilter
- */
-
-/**
- * Smarty trimwhitespace outputfilter plugin
- *
- * File: outputfilter.trimwhitespace.php<br>
- * Type: outputfilter<br>
- * Name: trimwhitespace<br>
- * Date: Jan 25, 2003<br>
- * Purpose: trim leading white space and blank lines from
- * template source after it gets interpreted, cleaning
- * up code and saving bandwidth. Does not affect
- * <<PRE>></PRE> and <SCRIPT></SCRIPT> blocks.<br>
- * Install: Drop into the plugin directory, call
- * <code>$smarty->load_filter('output','trimwhitespace');</code>
- * from application.
- * @author Monte Ohrt <monte at ohrt dot com>
- * @author Contributions from Lars Noschinski <lars@usenet.noschinski.de>
- * @version 1.3
- * @param string $source input string
- * @param object &$smarty Smarty object
- * @return string filtered output
- */
-function smarty_outputfilter_trimwhitespace($source, $smarty)
-{
- // Pull out the script blocks
- preg_match_all("!<script[^>]*?>.*?</script>!is", $source, $match);
- $_script_blocks = $match[0];
- $source = preg_replace("!<script[^>]*?>.*?</script>!is",
- '@@@SMARTY:TRIM:SCRIPT@@@', $source);
-
- // Pull out the pre blocks
- preg_match_all("!<pre[^>]*?>.*?</pre>!is", $source, $match);
- $_pre_blocks = $match[0];
- $source = preg_replace("!<pre[^>]*?>.*?</pre>!is",
- '@@@SMARTY:TRIM:PRE@@@', $source);
-
- // Pull out the textarea blocks
- preg_match_all("!<textarea[^>]*?>.*?</textarea>!is", $source, $match);
- $_textarea_blocks = $match[0];
- $source = preg_replace("!<textarea[^>]*?>.*?</textarea>!is",
- '@@@SMARTY:TRIM:TEXTAREA@@@', $source);
-
- // remove all leading spaces, tabs and carriage returns NOT
- // preceeded by a php close tag.
- $source = trim(preg_replace('/((?<!\?>)\n)[\s]+/m', '\1', $source));
-
- // replace textarea blocks
- smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:TEXTAREA@@@",$_textarea_blocks, $source);
-
- // replace pre blocks
- smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:PRE@@@",$_pre_blocks, $source);
-
- // replace script blocks
- smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:SCRIPT@@@",$_script_blocks, $source);
-
- return $source;
-}
-
-function smarty_outputfilter_trimwhitespace_replace($search_str, $replace, &$subject) {
- $_len = strlen($search_str);
- $_pos = 0;
- for ($_i=0, $_count=count($replace); $_i<$_count; $_i++)
- if (($_pos=strpos($subject, $search_str, $_pos))!==false)
- $subject = substr_replace($subject, $replace[$_i], $_pos, $_len);
- else
- break;
-
-}
-
-?>
diff --git a/includes/Smarty/plugins/shared.escape_special_chars.php b/includes/Smarty/plugins/shared.escape_special_chars.php
deleted file mode 100644
index f7142f9..0000000
--- a/includes/Smarty/plugins/shared.escape_special_chars.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/**
- * Smarty shared plugin
- * @package Smarty
- * @subpackage PluginsShared
- */
-
-
-/**
- * escape_special_chars common function
- *
- * Function: smarty_function_escape_special_chars<br>
- * Purpose: used by other smarty functions to escape
- * special chars except for already escaped ones
- * @author Monte Ohrt <monte at ohrt dot com>
- * @param string
- * @return string
- */
-function smarty_function_escape_special_chars($string)
-{
- if(!is_array($string)) {
- $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
- $string = htmlspecialchars($string);
- $string = str_replace(array('%%%SMARTY_START%%%','%%%SMARTY_END%%%'), array('&',';'), $string);
- }
- return $string;
-}
-
-/* vim: set expandtab: */
-
-?>
diff --git a/includes/Smarty/plugins/shared.literal_compiler_param.php b/includes/Smarty/plugins/shared.literal_compiler_param.php
new file mode 100755
index 0000000..dbcd937
--- /dev/null
+++ b/includes/Smarty/plugins/shared.literal_compiler_param.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsShared
+ */
+
+/**
+ * evaluate compiler parameter
+ *
+ * @param array $params parameter array as given to the compiler function
+ * @param integer $index array index of the parameter to convert
+ * @param mixed $default value to be returned if the parameter is not present
+ * @return mixed evaluated value of parameter or $default
+ * @throws SmartyException if parameter is not a literal (but an expression, variable, …)
+ * @author Rodney Rehm
+ */
+function smarty_literal_compiler_param($params, $index, $default=null)
+{
+ // not set, go default
+ if (!isset($params[$index])) {
+ return $default;
+ }
+ // test if param is a literal
+ if (!preg_match('/^([\'"]?)[a-zA-Z0-9]+(\\1)$/', $params[$index])) {
+ throw new SmartyException('$param[' . $index . '] is not a literal and is thus not evaluatable at compile time');
+ }
+
+ $t = null;
+ eval("\$t = " . $params[$index] . ";");
+ return $t;
+}
diff --git a/includes/Smarty/plugins/shared.make_timestamp.php b/includes/Smarty/plugins/shared.make_timestamp.php
deleted file mode 100644
index 4e652ad..0000000
--- a/includes/Smarty/plugins/shared.make_timestamp.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/**
- * Smarty shared plugin
- * @package Smarty
- * @subpackage PluginsShared
- */
-
-
-/**
- * Function: smarty_make_timestamp<br>
- * Purpose: used by other smarty functions to make a timestamp
- * from a string.
- * @author Monte Ohrt <monte at ohrt dot com>
- * @param string $string
- * @return string
- */
-function smarty_make_timestamp($string)
-{
- if(empty($string)) {
- // use "now":
- $time = time();
-
- } elseif (preg_match('/^\d{14}$/', $string)) {
- // it is mysql timestamp format of YYYYMMDDHHMMSS?
- $time = mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2),
- substr($string, 4, 2),substr($string, 6, 2),substr($string, 0, 4));
-
- } elseif (is_numeric($string)) {
- // it is a numeric string, we handle it as timestamp
- $time = (int)$string;
-
- } else {
- // strtotime should handle it
- $time = strtotime($string);
- if ($time == -1 || $time === false) {
- // strtotime() was not able to parse $string, use "now":
- $time = time();
- }
- }
- return $time;
-
-}
-?>
diff --git a/includes/Smarty/plugins/shared.mb_str_replace.php b/includes/Smarty/plugins/shared.mb_str_replace.php
new file mode 100755
index 0000000..ecafeb7
--- /dev/null
+++ b/includes/Smarty/plugins/shared.mb_str_replace.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Smarty shared plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsShared
+ */
+if (!function_exists('smarty_mb_str_replace')) {
+
+ /**
+ * Multibyte string replace
+ *
+ * @param string $search the string to be searched
+ * @param string $replace the replacement string
+ * @param string $subject the source string
+ * @param int &$count number of matches found
+ * @return string replaced string
+ * @author Rodney Rehm
+ */
+ function smarty_mb_str_replace($search, $replace, $subject, &$count=0)
+ {
+ if (!is_array($search) && is_array($replace)) {
+ return false;
+ }
+ if (is_array($subject)) {
+ // call mb_replace for each single string in $subject
+ foreach ($subject as &$string) {
+ $string = &smarty_mb_str_replace($search, $replace, $string, $c);
+ $count += $c;
+ }
+ } elseif (is_array($search)) {
+ if (!is_array($replace)) {
+ foreach ($search as &$string) {
+ $subject = smarty_mb_str_replace($string, $replace, $subject, $c);
+ $count += $c;
+ }
+ } else {
+ $n = max(count($search), count($replace));
+ while ($n--) {
+ $subject = smarty_mb_str_replace(current($search), current($replace), $subject, $c);
+ $count += $c;
+ next($search);
+ next($replace);
+ }
+ }
+ } else {
+ $parts = mb_split(preg_quote($search), $subject);
+ $count = count($parts) - 1;
+ $subject = implode($replace, $parts);
+ }
+ return $subject;
+ }
+
+}
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/shared.mb_unicode.php b/includes/Smarty/plugins/shared.mb_unicode.php
new file mode 100755
index 0000000..e7f839e
--- /dev/null
+++ b/includes/Smarty/plugins/shared.mb_unicode.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Smarty shared plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsShared
+ */
+
+/**
+ * convert characters to their decimal unicode equivalents
+ *
+ * @link http://www.ibm.com/developerworks/library/os-php-unicode/index.html#listing3 for inspiration
+ * @param string $string characters to calculate unicode of
+ * @param string $encoding encoding of $string, if null mb_internal_encoding() is used
+ * @return array sequence of unicodes
+ * @author Rodney Rehm
+ */
+function smarty_mb_to_unicode($string, $encoding=null) {
+ if ($encoding) {
+ $expanded = mb_convert_encoding($string, "UTF-32BE", $encoding);
+ } else {
+ $expanded = mb_convert_encoding($string, "UTF-32BE");
+ }
+ return unpack("N*", $expanded);
+}
+
+/**
+ * convert unicodes to the character of given encoding
+ *
+ * @link http://www.ibm.com/developerworks/library/os-php-unicode/index.html#listing3 for inspiration
+ * @param integer|array $unicode single unicode or list of unicodes to convert
+ * @param string $encoding encoding of returned string, if null mb_internal_encoding() is used
+ * @return string unicode as character sequence in given $encoding
+ * @author Rodney Rehm
+ */
+function smarty_mb_from_unicode($unicode, $encoding=null) {
+ $t = '';
+ if (!$encoding) {
+ $encoding = mb_internal_encoding();
+ }
+ foreach((array) $unicode as $utf32be) {
+ $character = pack("N*", $utf32be);
+ $t .= mb_convert_encoding($character, $encoding, "UTF-32BE");
+ }
+ return $t;
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/shared.mb_wordwrap.php b/includes/Smarty/plugins/shared.mb_wordwrap.php
new file mode 100755
index 0000000..ba3498c
--- /dev/null
+++ b/includes/Smarty/plugins/shared.mb_wordwrap.php
@@ -0,0 +1,83 @@
+<?php
+/**
+ * Smarty shared plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsShared
+ */
+
+if(!function_exists('smarty_mb_wordwrap')) {
+
+ /**
+ * Wrap a string to a given number of characters
+ *
+ * @link http://php.net/manual/en/function.wordwrap.php for similarity
+ * @param string $str the string to wrap
+ * @param int $width the width of the output
+ * @param string $break the character used to break the line
+ * @param boolean $cut ignored parameter, just for the sake of
+ * @return string wrapped string
+ * @author Rodney Rehm
+ */
+ function smarty_mb_wordwrap($str, $width=75, $break="\n", $cut=false)
+ {
+ // break words into tokens using white space as a delimiter
+ $tokens = preg_split('!(\s)!S' . Smarty::$_UTF8_MODIFIER, $str, -1, PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE);
+ $length = 0;
+ $t = '';
+ $_previous = false;
+
+ foreach ($tokens as $_token) {
+ $token_length = mb_strlen($_token, Smarty::$_CHARSET);
+ $_tokens = array($_token);
+ if ($token_length > $width) {
+ // remove last space
+ $t = mb_substr($t, 0, -1, Smarty::$_CHARSET);
+ $_previous = false;
+ $length = 0;
+
+ if ($cut) {
+ $_tokens = preg_split('!(.{' . $width . '})!S' . Smarty::$_UTF8_MODIFIER, $_token, -1, PREG_SPLIT_NO_EMPTY + PREG_SPLIT_DELIM_CAPTURE);
+ // broken words go on a new line
+ $t .= $break;
+ }
+ }
+
+ foreach ($_tokens as $token) {
+ $_space = !!preg_match('!^\s$!S' . Smarty::$_UTF8_MODIFIER, $token);
+ $token_length = mb_strlen($token, Smarty::$_CHARSET);
+ $length += $token_length;
+
+ if ($length > $width) {
+ // remove space before inserted break
+ if ($_previous && $token_length < $width) {
+ $t = mb_substr($t, 0, -1, Smarty::$_CHARSET);
+ }
+
+ // add the break before the token
+ $t .= $break;
+ $length = $token_length;
+
+ // skip space after inserting a break
+ if ($_space) {
+ $length = 0;
+ continue;
+ }
+ } else if ($token == "\n") {
+ // hard break must reset counters
+ $_previous = 0;
+ $length = 0;
+ } else {
+ // remember if we had a space or not
+ $_previous = $_space;
+ }
+ // add the token
+ $t .= $token;
+ }
+ }
+
+ return $t;
+ }
+
+}
+?>
\ No newline at end of file
diff --git a/includes/Smarty/plugins/variablefilter.htmlspecialchars.php b/includes/Smarty/plugins/variablefilter.htmlspecialchars.php
deleted file mode 100644
index 08a5783..0000000
--- a/includes/Smarty/plugins/variablefilter.htmlspecialchars.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsFilter
-*/
-
-/**
-* Smarty htmlspecialchars variablefilter plugin
-*
-* @param string $source input string
-* @param object $ &$smarty Smarty object
-* @return string filtered output
-*/
-function smarty_variablefilter_htmlspecialchars($source, &$smarty)
-{
- return htmlspecialchars($source, ENT_QUOTES);
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_cacheresource.php b/includes/Smarty/sysplugins/smarty_cacheresource.php
new file mode 100755
index 0000000..ca18add
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_cacheresource.php
@@ -0,0 +1,381 @@
+<?php
+/**
+* Smarty Internal Plugin
+*
+* @package Smarty
+* @subpackage Cacher
+*/
+
+/**
+* Cache Handler API
+*
+* @package Smarty
+* @subpackage Cacher
+* @author Rodney Rehm
+*/
+abstract class Smarty_CacheResource {
+ /**
+ * cache for Smarty_CacheResource instances
+ * @var array
+ */
+ public static $resources = array();
+
+ /**
+ * resource types provided by the core
+ * @var array
+ */
+ protected static $sysplugins = array(
+ 'file' => true,
+ );
+
+ /**
+ * populate Cached Object with meta data from Resource
+ *
+ * @param Smarty_Template_Cached $cached cached object
+ * @param Smarty_Internal_Template $_template template object
+ * @return void
+ */
+ public abstract function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template);
+
+ /**
+ * populate Cached Object with timestamp and exists from Resource
+ *
+ * @param Smarty_Template_Cached $source cached object
+ * @return void
+ */
+ public abstract function populateTimestamp(Smarty_Template_Cached $cached);
+
+ /**
+ * Read the cached template and process header
+ *
+ * @param Smarty_Internal_Template $_template template object
+ * @param Smarty_Template_Cached $cached cached object
+ * @return booelan true or false if the cached content does not exist
+ */
+ public abstract function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null);
+
+ /**
+ * Write the rendered template output to cache
+ *
+ * @param Smarty_Internal_Template $_template template object
+ * @param string $content content to cache
+ * @return boolean success
+ */
+ public abstract function writeCachedContent(Smarty_Internal_Template $_template, $content);
+
+ /**
+ * Return cached content
+ *
+ * @param Smarty_Internal_Template $_template template object
+ * @param string $content content of cache
+ */
+ public function getCachedContent(Smarty_Internal_Template $_template)
+ {
+ if ($_template->cached->handler->process($_template)) {
+ ob_start();
+ $_template->properties['unifunc']($_template);
+ return ob_get_clean();
+ }
+ return null;
+ }
+
+ /**
+ * Empty cache
+ *
+ * @param Smarty $smarty Smarty object
+ * @param integer $exp_time expiration time (number of seconds, not timestamp)
+ * @return integer number of cache files deleted
+ */
+ public abstract function clearAll(Smarty $smarty, $exp_time=null);
+
+ /**
+ * Empty cache for a specific template
+ *
+ * @param Smarty $smarty Smarty object
+ * @param string $resource_name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @param integer $exp_time expiration time (number of seconds, not timestamp)
+ * @return integer number of cache files deleted
+ */
+ public abstract function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time);
+
+
+ public function locked(Smarty $smarty, Smarty_Template_Cached $cached)
+ {
+ // theoretically locking_timeout should be checked against time_limit (max_execution_time)
+ $start = microtime(true);
+ $hadLock = null;
+ while ($this->hasLock($smarty, $cached)) {
+ $hadLock = true;
+ if (microtime(true) - $start > $smarty->locking_timeout) {
+ // abort waiting for lock release
+ return false;
+ }
+ sleep(1);
+ }
+ return $hadLock;
+ }
+
+ public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
+ {
+ // check if lock exists
+ return false;
+ }
+
+ public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)
+ {
+ // create lock
+ return true;
+ }
+
+ public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)
+ {
+ // release lock
+ return true;
+ }
+
+
+ /**
+ * Load Cache Resource Handler
+ *
+ * @param Smarty $smarty Smarty object
+ * @param string $type name of the cache resource
+ * @return Smarty_CacheResource Cache Resource Handler
+ */
+ public static function load(Smarty $smarty, $type = null)
+ {
+ if (!isset($type)) {
+ $type = $smarty->caching_type;
+ }
+
+ // try smarty's cache
+ if (isset($smarty->_cacheresource_handlers[$type])) {
+ return $smarty->_cacheresource_handlers[$type];
+ }
+
+ // try registered resource
+ if (isset($smarty->registered_cache_resources[$type])) {
+ // do not cache these instances as they may vary from instance to instance
+ return $smarty->_cacheresource_handlers[$type] = $smarty->registered_cache_resources[$type];
+ }
+ // try sysplugins dir
+ if (isset(self::$sysplugins[$type])) {
+ if (!isset(self::$resources[$type])) {
+ $cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($type);
+ self::$resources[$type] = new $cache_resource_class();
+ }
+ return $smarty->_cacheresource_handlers[$type] = self::$resources[$type];
+ }
+ // try plugins dir
+ $cache_resource_class = 'Smarty_CacheResource_' . ucfirst($type);
+ if ($smarty->loadPlugin($cache_resource_class)) {
+ if (!isset(self::$resources[$type])) {
+ self::$resources[$type] = new $cache_resource_class();
+ }
+ return $smarty->_cacheresource_handlers[$type] = self::$resources[$type];
+ }
+ // give up
+ throw new SmartyException("Unable to load cache resource '{$type}'");
+ }
+
+ /**
+ * Invalid Loaded Cache Files
+ *
+ * @param Smarty $smarty Smarty object
+ */
+ public static function invalidLoadedCache(Smarty $smarty)
+ {
+ foreach ($smarty->template_objects as $tpl) {
+ if (isset($tpl->cached)) {
+ $tpl->cached->valid = false;
+ $tpl->cached->processed = false;
+ }
+ }
+ }
+}
+
+/**
+* Smarty Resource Data Object
+*
+* Cache Data Container for Template Files
+*
+* @package Smarty
+* @subpackage TemplateResources
+* @author Rodney Rehm
+*/
+class Smarty_Template_Cached {
+ /**
+ * Source Filepath
+ * @var string
+ */
+ public $filepath = false;
+
+ /**
+ * Source Content
+ * @var string
+ */
+ public $content = null;
+
+ /**
+ * Source Timestamp
+ * @var integer
+ */
+ public $timestamp = false;
+
+ /**
+ * Source Existance
+ * @var boolean
+ */
+ public $exists = false;
+
+ /**
+ * Cache Is Valid
+ * @var boolean
+ */
+ public $valid = false;
+
+ /**
+ * Cache was processed
+ * @var boolean
+ */
+ public $processed = false;
+
+ /**
+ * CacheResource Handler
+ * @var Smarty_CacheResource
+ */
+ public $handler = null;
+
+ /**
+ * Template Compile Id (Smarty_Internal_Template::$compile_id)
+ * @var string
+ */
+ public $compile_id = null;
+
+ /**
+ * Template Cache Id (Smarty_Internal_Template::$cache_id)
+ * @var string
+ */
+ public $cache_id = null;
+
+ /**
+ * Id for cache locking
+ * @var string
+ */
+ public $lock_id = null;
+
+ /**
+ * flag that cache is locked by this instance
+ * @var bool
+ */
+ public $is_locked = false;
+
+ /**
+ * Source Object
+ * @var Smarty_Template_Source
+ */
+ public $source = null;
+
+ /**
+ * create Cached Object container
+ *
+ * @param Smarty_Internal_Template $_template template object
+ */
+ public function __construct(Smarty_Internal_Template $_template)
+ {
+ $this->compile_id = $_template->compile_id;
+ $this->cache_id = $_template->cache_id;
+ $this->source = $_template->source;
+ $_template->cached = $this;
+ $smarty = $_template->smarty;
+
+ //
+ // load resource handler
+ //
+ $this->handler = $handler = Smarty_CacheResource::load($smarty); // Note: prone to circular references
+
+ //
+ // check if cache is valid
+ //
+ if (!($_template->caching == Smarty::CACHING_LIFETIME_CURRENT || $_template->caching == Smarty::CACHING_LIFETIME_SAVED) || $_template->source->recompiled) {
+ $handler->populate($this, $_template);
+ return;
+ }
+ while (true) {
+ while (true) {
+ $handler->populate($this, $_template);
+ if ($this->timestamp === false || $smarty->force_compile || $smarty->force_cache) {
+ $this->valid = false;
+ } else {
+ $this->valid = true;
+ }
+ if ($this->valid && $_template->caching == Smarty::CACHING_LIFETIME_CURRENT && $_template->cache_lifetime >= 0 && time() > ($this->timestamp + $_template->cache_lifetime)) {
+ // lifetime expired
+ $this->valid = false;
+ }
+ if ($this->valid || !$_template->smarty->cache_locking) {
+ break;
+ }
+ if (!$this->handler->locked($_template->smarty, $this)) {
+ $this->handler->acquireLock($_template->smarty, $this);
+ break 2;
+ }
+ }
+ if ($this->valid) {
+ if (!$_template->smarty->cache_locking || $this->handler->locked($_template->smarty, $this) === null) {
+ // load cache file for the following checks
+ if ($smarty->debugging) {
+ Smarty_Internal_Debug::start_cache($_template);
+ }
+ if($handler->process($_template, $this) === false) {
+ $this->valid = false;
+ } else {
+ $this->processed = true;
+ }
+ if ($smarty->debugging) {
+ Smarty_Internal_Debug::end_cache($_template);
+ }
+ } else {
+ continue;
+ }
+ } else {
+ return;
+ }
+ if ($this->valid && $_template->caching === Smarty::CACHING_LIFETIME_SAVED && $_template->properties['cache_lifetime'] >= 0 && (time() > ($_template->cached->timestamp + $_template->properties['cache_lifetime']))) {
+ $this->valid = false;
+ }
+ if (!$this->valid && $_template->smarty->cache_locking) {
+ $this->handler->acquireLock($_template->smarty, $this);
+ return;
+ } else {
+ return;
+ }
+ }
+ }
+
+ /**
+ * Write this cache object to handler
+ *
+ * @param Smarty_Internal_Template $_template template object
+ * @param string $content content to cache
+ * @return boolean success
+ */
+ public function write(Smarty_Internal_Template $_template, $content)
+ {
+ if (!$_template->source->recompiled) {
+ if ($this->handler->writeCachedContent($_template, $content)) {
+ $this->timestamp = time();
+ $this->exists = true;
+ $this->valid = true;
+ if ($_template->smarty->cache_locking) {
+ $this->handler->releaseLock($_template->smarty, $this);
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_cacheresource_custom.php b/includes/Smarty/sysplugins/smarty_cacheresource_custom.php
new file mode 100755
index 0000000..ee9de15
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_cacheresource_custom.php
@@ -0,0 +1,237 @@
+<?php
+/**
+ * Smarty Internal Plugin
+ *
+ * @package Smarty
+ * @subpackage Cacher
+ */
+
+/**
+ * Cache Handler API
+ *
+ * @package Smarty
+ * @subpackage Cacher
+ * @author Rodney Rehm
+ */
+abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource {
+
+ /**
+ * fetch cached content and its modification time from data source
+ *
+ * @param string $id unique cache content identifier
+ * @param string $name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @param string $content cached content
+ * @param integer $mtime cache modification timestamp (epoch)
+ * @return void
+ */
+ protected abstract function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime);
+
+ /**
+ * Fetch cached content's modification timestamp from data source
+ *
+ * {@internal implementing this method is optional.
+ * Only implement it if modification times can be accessed faster than loading the complete cached content.}}
+ *
+ * @param string $id unique cache content identifier
+ * @param string $name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @return integer|boolean timestamp (epoch) the template was modified, or false if not found
+ */
+ protected function fetchTimestamp($id, $name, $cache_id, $compile_id)
+ {
+ return null;
+ }
+
+ /**
+ * Save content to cache
+ *
+ * @param string $id unique cache content identifier
+ * @param string $name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @param integer|null $exp_time seconds till expiration or null
+ * @param string $content content to cache
+ * @return boolean success
+ */
+ protected abstract function save($id, $name, $cache_id, $compile_id, $exp_time, $content);
+
+ /**
+ * Delete content from cache
+ *
+ * @param string $name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @param integer|null $exp_time seconds till expiration time in seconds or null
+ * @return integer number of deleted caches
+ */
+ protected abstract function delete($name, $cache_id, $compile_id, $exp_time);
+
+ /**
+ * populate Cached Object with meta data from Resource
+ *
+ * @param Smarty_Template_Cached $cached cached object
+ * @param Smarty_Internal_Template $_template template object
+ * @return void
+ */
+ public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)
+ {
+ $_cache_id = isset($cached->cache_id) ? preg_replace('![^\w\|]+!', '_', $cached->cache_id) : null;
+ $_compile_id = isset($cached->compile_id) ? preg_replace('![^\w\|]+!', '_', $cached->compile_id) : null;
+
+ $cached->filepath = sha1($cached->source->filepath . $_cache_id . $_compile_id);
+ $this->populateTimestamp($cached);
+ }
+
+ /**
+ * populate Cached Object with timestamp and exists from Resource
+ *
+ * @param Smarty_Template_Cached $source cached object
+ * @return void
+ */
+ public function populateTimestamp(Smarty_Template_Cached $cached)
+ {
+ $mtime = $this->fetchTimestamp($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id);
+ if ($mtime !== null) {
+ $cached->timestamp = $mtime;
+ $cached->exists = !!$cached->timestamp;
+ return;
+ }
+ $timestamp = null;
+ $this->fetch($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id, $cached->content, $timestamp);
+ $cached->timestamp = isset($timestamp) ? $timestamp : false;
+ $cached->exists = !!$cached->timestamp;
+ }
+
+ /**
+ * Read the cached template and process the header
+ *
+ * @param Smarty_Internal_Template $_template template object
+ * @param Smarty_Template_Cached $cached cached object
+ * @return booelan true or false if the cached content does not exist
+ */
+ public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null)
+ {
+ if (!$cached) {
+ $cached = $_template->cached;
+ }
+ $content = $cached->content ? $cached->content : null;
+ $timestamp = $cached->timestamp ? $cached->timestamp : null;
+ if ($content === null || !$timestamp) {
+ $this->fetch(
+ $_template->cached->filepath,
+ $_template->source->name,
+ $_template->cache_id,
+ $_template->compile_id,
+ $content,
+ $timestamp
+ );
+ }
+ if (isset($content)) {
+ $_smarty_tpl = $_template;
+ eval("?>" . $content);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Write the rendered template output to cache
+ *
+ * @param Smarty_Internal_Template $_template template object
+ * @param string $content content to cache
+ * @return boolean success
+ */
+ public function writeCachedContent(Smarty_Internal_Template $_template, $content)
+ {
+ return $this->save(
+ $_template->cached->filepath,
+ $_template->source->name,
+ $_template->cache_id,
+ $_template->compile_id,
+ $_template->properties['cache_lifetime'],
+ $content
+ );
+ }
+
+ /**
+ * Empty cache
+ *
+ * @param Smarty $smarty Smarty object
+ * @param integer $exp_time expiration time (number of seconds, not timestamp)
+ * @return integer number of cache files deleted
+ */
+ public function clearAll(Smarty $smarty, $exp_time=null)
+ {
+ $this->cache = array();
+ return $this->delete(null, null, null, $exp_time);
+ }
+
+ /**
+ * Empty cache for a specific template
+ *
+ * @param Smarty $smarty Smarty object
+ * @param string $resource_name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @param integer $exp_time expiration time (number of seconds, not timestamp)
+ * @return integer number of cache files deleted
+ */
+ public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
+ {
+ $this->cache = array();
+ return $this->delete($resource_name, $cache_id, $compile_id, $exp_time);
+ }
+
+ /**
+ * Check is cache is locked for this template
+ *
+ * @param Smarty $smarty Smarty object
+ * @param Smarty_Template_Cached $cached cached object
+ * @return booelan true or false if cache is locked
+ */
+ public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
+ {
+ $id = $cached->filepath;
+ $name = $cached->source->name . '.lock';
+
+ $mtime = $this->fetchTimestamp($id, $name, null, null);
+ if ($mtime === null) {
+ $this->fetch($id, $name, null, null, $content, $mtime);
+ }
+
+ return $mtime && time() - $mtime < $smarty->locking_timeout;
+ }
+
+ /**
+ * Lock cache for this template
+ *
+ * @param Smarty $smarty Smarty object
+ * @param Smarty_Template_Cached $cached cached object
+ */
+ public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)
+ {
+ $cached->is_locked = true;
+
+ $id = $cached->filepath;
+ $name = $cached->source->name . '.lock';
+ $this->save($id, $name, null, null, $smarty->locking_timeout, '');
+ }
+
+ /**
+ * Unlock cache for this template
+ *
+ * @param Smarty $smarty Smarty object
+ * @param Smarty_Template_Cached $cached cached object
+ */
+ public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)
+ {
+ $cached->is_locked = false;
+
+ $name = $cached->source->name . '.lock';
+ $this->delete($name, null, null, null);
+ }
+}
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_cacheresource_keyvaluestore.php b/includes/Smarty/sysplugins/smarty_cacheresource_keyvaluestore.php
new file mode 100755
index 0000000..dff9b65
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_cacheresource_keyvaluestore.php
@@ -0,0 +1,463 @@
+<?php
+/**
+ * Smarty Internal Plugin
+ *
+ * @package Smarty
+ * @subpackage Cacher
+ */
+
+/**
+ * Smarty Cache Handler Base for Key/Value Storage Implementations
+ *
+ * This class implements the functionality required to use simple key/value stores
+ * for hierarchical cache groups. key/value stores like memcache or APC do not support
+ * wildcards in keys, therefore a cache group cannot be cleared like "a|*" - which
+ * is no problem to filesystem and RDBMS implementations.
+ *
+ * This implementation is based on the concept of invalidation. While one specific cache
+ * can be identified and cleared, any range of caches cannot be identified. For this reason
+ * each level of the cache group hierarchy can have its own value in the store. These values
+ * are nothing but microtimes, telling us when a particular cache group was cleared for the
+ * last time. These keys are evaluated for every cache read to determine if the cache has
+ * been invalidated since it was created and should hence be treated as inexistent.
+ *
+ * Although deep hierarchies are possible, they are not recommended. Try to keep your
+ * cache groups as shallow as possible. Anything up 3-5 parents should be ok. So
+ * »a|b|c« is a good depth where »a|b|c|d|e|f|g|h|i|j|k« isn't. Try to join correlating
+ * cache groups: if your cache groups look somewhat like »a|b|$page|$items|$whatever«
+ * consider using »a|b|c|$page-$items-$whatever« instead.
+ *
+ * @package Smarty
+ * @subpackage Cacher
+ * @author Rodney Rehm
+ */
+abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource {
+
+ /**
+ * cache for contents
+ * @var array
+ */
+ protected $contents = array();
+ /**
+ * cache for timestamps
+ * @var array
+ */
+ protected $timestamps = array();
+
+ /**
+ * populate Cached Object with meta data from Resource
+ *
+ * @param Smarty_Template_Cached $cached cached object
+ * @param Smarty_Internal_Template $_template template object
+ * @return void
+ */
+ public function populate(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template)
+ {
+ $cached->filepath = $_template->source->uid
+ . '#' . $this->sanitize($cached->source->name)
+ . '#' . $this->sanitize($cached->cache_id)
+ . '#' . $this->sanitize($cached->compile_id);
+
+ $this->populateTimestamp($cached);
+ }
+
+ /**
+ * populate Cached Object with timestamp and exists from Resource
+ *
+ * @param Smarty_Template_Cached $cached cached object
+ * @return void
+ */
+ public function populateTimestamp(Smarty_Template_Cached $cached)
+ {
+ if (!$this->fetch($cached->filepath, $cached->source->name, $cached->cache_id, $cached->compile_id, $content, $timestamp, $cached->source->uid)) {
+ return;
+ }
+ $cached->content = $content;
+ $cached->timestamp = (int) $timestamp;
+ $cached->exists = $cached->timestamp;
+ }
+
+ /**
+ * Read the cached template and process the header
+ *
+ * @param Smarty_Internal_Template $_template template object
+ * @param Smarty_Template_Cached $cached cached object
+ * @return booelan true or false if the cached content does not exist
+ */
+ public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null)
+ {
+ if (!$cached) {
+ $cached = $_template->cached;
+ }
+ $content = $cached->content ? $cached->content : null;
+ $timestamp = $cached->timestamp ? $cached->timestamp : null;
+ if ($content === null || !$timestamp) {
+ if (!$this->fetch($_template->cached->filepath, $_template->source->name, $_template->cache_id, $_template->compile_id, $content, $timestamp, $_template->source->uid)) {
+ return false;
+ }
+ }
+ if (isset($content)) {
+ $_smarty_tpl = $_template;
+ eval("?>" . $content);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Write the rendered template output to cache
+ *
+ * @param Smarty_Internal_Template $_template template object
+ * @param string $content content to cache
+ * @return boolean success
+ */
+ public function writeCachedContent(Smarty_Internal_Template $_template, $content)
+ {
+ $this->addMetaTimestamp($content);
+ return $this->write(array($_template->cached->filepath => $content), $_template->properties['cache_lifetime']);
+ }
+
+ /**
+ * Empty cache
+ *
+ * {@internal the $exp_time argument is ignored altogether }}
+ *
+ * @param Smarty $smarty Smarty object
+ * @param integer $exp_time expiration time [being ignored]
+ * @return integer number of cache files deleted [always -1]
+ * @uses purge() to clear the whole store
+ * @uses invalidate() to mark everything outdated if purge() is inapplicable
+ */
+ public function clearAll(Smarty $smarty, $exp_time=null)
+ {
+ if (!$this->purge()) {
+ $this->invalidate(null);
+ }
+ return -1;
+ }
+
+ /**
+ * Empty cache for a specific template
+ *
+ * {@internal the $exp_time argument is ignored altogether}}
+ *
+ * @param Smarty $smarty Smarty object
+ * @param string $resource_name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @param integer $exp_time expiration time [being ignored]
+ * @return integer number of cache files deleted [always -1]
+ * @uses buildCachedFilepath() to generate the CacheID
+ * @uses invalidate() to mark CacheIDs parent chain as outdated
+ * @uses delete() to remove CacheID from cache
+ */
+ public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time)
+ {
+ $uid = $this->getTemplateUid($smarty, $resource_name, $cache_id, $compile_id);
+ $cid = $uid . '#' . $this->sanitize($resource_name) . '#' . $this->sanitize($cache_id) . '#' . $this->sanitize($compile_id);
+ $this->delete(array($cid));
+ $this->invalidate($cid, $resource_name, $cache_id, $compile_id, $uid);
+ return -1;
+ }
+ /**
+ * Get template's unique ID
+ *
+ * @param Smarty $smarty Smarty object
+ * @param string $resource_name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @return string filepath of cache file
+ */
+ protected function getTemplateUid(Smarty $smarty, $resource_name, $cache_id, $compile_id)
+ {
+ $uid = '';
+ if (isset($resource_name)) {
+ $tpl = new $smarty->template_class($resource_name, $smarty);
+ if ($tpl->source->exists) {
+ $uid = $tpl->source->uid;
+ }
+
+ // remove from template cache
+ if ($smarty->allow_ambiguous_resources) {
+ $_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
+ } else {
+ $_templateId = $smarty->joined_template_dir . '#' . $resource_name . $tpl->cache_id . $tpl->compile_id;
+ }
+ if (isset($_templateId[150])) {
+ $_templateId = sha1($_templateId);
+ }
+ unset($smarty->template_objects[$_templateId]);
+ }
+ return $uid;
+ }
+
+ /**
+ * Sanitize CacheID components
+ *
+ * @param string $string CacheID component to sanitize
+ * @return string sanitized CacheID component
+ */
+ protected function sanitize($string)
+ {
+ // some poeple smoke bad weed
+ $string = trim($string, '|');
+ if (!$string) {
+ return null;
+ }
+ return preg_replace('#[^\w\|]+#S', '_', $string);
+ }
+
+ /**
+ * Fetch and prepare a cache object.
+ *
+ * @param string $cid CacheID to fetch
+ * @param string $resource_name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @param string $content cached content
+ * @param integer &$timestamp cached timestamp (epoch)
+ * @param string $resource_uid resource's uid
+ * @return boolean success
+ */
+ protected function fetch($cid, $resource_name = null, $cache_id = null, $compile_id = null, &$content = null, &$timestamp = null, $resource_uid = null)
+ {
+ $t = $this->read(array($cid));
+ $content = !empty($t[$cid]) ? $t[$cid] : null;
+ $timestamp = null;
+
+ if ($content && ($timestamp = $this->getMetaTimestamp($content))) {
+ $invalidated = $this->getLatestInvalidationTimestamp($cid, $resource_name, $cache_id, $compile_id, $resource_uid);
+ if ($invalidated > $timestamp) {
+ $timestamp = null;
+ $content = null;
+ }
+ }
+
+ return !!$content;
+ }
+
+ /**
+ * Add current microtime to the beginning of $cache_content
+ *
+ * {@internal the header uses 8 Bytes, the first 4 Bytes are the seconds, the second 4 Bytes are the microseconds}}
+ *
+ * @param string &$content the content to be cached
+ */
+ protected function addMetaTimestamp(&$content)
+ {
+ $mt = explode(" ", microtime());
+ $ts = pack("NN", $mt[1], (int) ($mt[0] * 100000000));
+ $content = $ts . $content;
+ }
+
+ /**
+ * Extract the timestamp the $content was cached
+ *
+ * @param string &$content the cached content
+ * @return float the microtime the content was cached
+ */
+ protected function getMetaTimestamp(&$content)
+ {
+ $s = unpack("N", substr($content, 0, 4));
+ $m = unpack("N", substr($content, 4, 4));
+ $content = substr($content, 8);
+ return $s[1] + ($m[1] / 100000000);
+ }
+
+ /**
+ * Invalidate CacheID
+ *
+ * @param string $cid CacheID
+ * @param string $resource_name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @param string $resource_uid source's uid
+ * @return void
+ */
+ protected function invalidate($cid = null, $resource_name = null, $cache_id = null, $compile_id = null, $resource_uid = null)
+ {
+ $now = microtime(true);
+ $key = null;
+ // invalidate everything
+ if (!$resource_name && !$cache_id && !$compile_id) {
+ $key = 'IVK#ALL';
+ }
+ // invalidate all caches by template
+ else if ($resource_name && !$cache_id && !$compile_id) {
+ $key = 'IVK#TEMPLATE#' . $resource_uid . '#' . $this->sanitize($resource_name);
+ }
+ // invalidate all caches by cache group
+ else if (!$resource_name && $cache_id && !$compile_id) {
+ $key = 'IVK#CACHE#' . $this->sanitize($cache_id);
+ }
+ // invalidate all caches by compile id
+ else if (!$resource_name && !$cache_id && $compile_id) {
+ $key = 'IVK#COMPILE#' . $this->sanitize($compile_id);
+ }
+ // invalidate by combination
+ else {
+ $key = 'IVK#CID#' . $cid;
+ }
+ $this->write(array($key => $now));
+ }
+
+ /**
+ * Determine the latest timestamp known to the invalidation chain
+ *
+ * @param string $cid CacheID to determine latest invalidation timestamp of
+ * @param string $resource_name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @param string $resource_uid source's filepath
+ * @return float the microtime the CacheID was invalidated
+ */
+ protected function getLatestInvalidationTimestamp($cid, $resource_name = null, $cache_id = null, $compile_id = null, $resource_uid = null)
+ {
+ // abort if there is no CacheID
+ if (false && !$cid) {
+ return 0;
+ }
+ // abort if there are no InvalidationKeys to check
+ if (!($_cid = $this->listInvalidationKeys($cid, $resource_name, $cache_id, $compile_id, $resource_uid))) {
+ return 0;
+ }
+
+ // there are no InValidationKeys
+ if (!($values = $this->read($_cid))) {
+ return 0;
+ }
+ // make sure we're dealing with floats
+ $values = array_map('floatval', $values);
+ return max($values);
+ }
+
+ /**
+ * Translate a CacheID into the list of applicable InvalidationKeys.
+ *
+ * Splits "some|chain|into|an|array" into array( '#clearAll#', 'some', 'some|chain', 'some|chain|into', ... )
+ *
+ * @param string $cid CacheID to translate
+ * @param string $resource_name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @param string $resource_uid source's filepath
+ * @return array list of InvalidationKeys
+ * @uses $invalidationKeyPrefix to prepend to each InvalidationKey
+ */
+ protected function listInvalidationKeys($cid, $resource_name = null, $cache_id = null, $compile_id = null, $resource_uid = null)
+ {
+ $t = array('IVK#ALL');
+ $_name = $_compile = '#';
+ if ($resource_name) {
+ $_name .= $resource_uid . '#' . $this->sanitize($resource_name);
+ $t[] = 'IVK#TEMPLATE' . $_name;
+ }
+ if ($compile_id) {
+ $_compile .= $this->sanitize($compile_id);
+ $t[] = 'IVK#COMPILE' . $_compile;
+ }
+ $_name .= '#';
+ // some poeple smoke bad weed
+ $cid = trim($cache_id, '|');
+ if (!$cid) {
+ return $t;
+ }
+ $i = 0;
+ while (true) {
+ // determine next delimiter position
+ $i = strpos($cid, '|', $i);
+ // add complete CacheID if there are no more delimiters
+ if ($i === false) {
+ $t[] = 'IVK#CACHE#' . $cid;
+ $t[] = 'IVK#CID' . $_name . $cid . $_compile;
+ $t[] = 'IVK#CID' . $_name . $_compile;
+ break;
+ }
+ $part = substr($cid, 0, $i);
+ // add slice to list
+ $t[] = 'IVK#CACHE#' . $part;
+ $t[] = 'IVK#CID' . $_name . $part . $_compile;
+ // skip past delimiter position
+ $i++;
+ }
+ return $t;
+ }
+
+ /**
+ * Check is cache is locked for this template
+ *
+ * @param Smarty $smarty Smarty object
+ * @param Smarty_Template_Cached $cached cached object
+ * @return booelan true or false if cache is locked
+ */
+ public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
+ {
+ $key = 'LOCK#' . $cached->filepath;
+ $data = $this->read(array($key));
+ return $data && time() - $data[$key] < $smarty->locking_timeout;
+ }
+
+ /**
+ * Lock cache for this template
+ *
+ * @param Smarty $smarty Smarty object
+ * @param Smarty_Template_Cached $cached cached object
+ */
+ public function acquireLock(Smarty $smarty, Smarty_Template_Cached $cached)
+ {
+ $cached->is_locked = true;
+ $key = 'LOCK#' . $cached->filepath;
+ $this->write(array($key => time()), $smarty->locking_timeout);
+ }
+
+ /**
+ * Unlock cache for this template
+ *
+ * @param Smarty $smarty Smarty object
+ * @param Smarty_Template_Cached $cached cached object
+ */
+ public function releaseLock(Smarty $smarty, Smarty_Template_Cached $cached)
+ {
+ $cached->is_locked = false;
+ $key = 'LOCK#' . $cached->filepath;
+ $this->delete(array($key));
+ }
+
+ /**
+ * Read values for a set of keys from cache
+ *
+ * @param array $keys list of keys to fetch
+ * @return array list of values with the given keys used as indexes
+ */
+ protected abstract function read(array $keys);
+
+ /**
+ * Save values for a set of keys to cache
+ *
+ * @param array $keys list of values to save
+ * @param int $expire expiration time
+ * @return boolean true on success, false on failure
+ */
+ protected abstract function write(array $keys, $expire=null);
+
+ /**
+ * Remove values from cache
+ *
+ * @param array $keys list of keys to delete
+ * @return boolean true on success, false on failure
+ */
+ protected abstract function delete(array $keys);
+
+ /**
+ * Remove *all* values from cache
+ *
+ * @return boolean true on success, false on failure
+ */
+ protected function purge()
+ {
+ return false;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_config_source.php b/includes/Smarty/sysplugins/smarty_config_source.php
new file mode 100755
index 0000000..043ff13
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_config_source.php
@@ -0,0 +1,95 @@
+<?php
+/**
+ * Smarty Internal Plugin
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ */
+
+/**
+ * Smarty Resource Data Object
+ *
+ * Meta Data Container for Config Files
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Rodney Rehm
+ *
+ * @property string $content
+ * @property int $timestamp
+ * @property bool $exists
+ */
+class Smarty_Config_Source extends Smarty_Template_Source {
+
+ /**
+ * create Config Object container
+ *
+ * @param Smarty_Resource $handler Resource Handler this source object communicates with
+ * @param Smarty $smarty Smarty instance this source object belongs to
+ * @param string $resource full config_resource
+ * @param string $type type of resource
+ * @param string $name resource name
+ * @param string $unique_resource unqiue resource name
+ */
+ public function __construct(Smarty_Resource $handler, Smarty $smarty, $resource, $type, $name, $unique_resource)
+ {
+ $this->handler = $handler; // Note: prone to circular references
+
+ // Note: these may be ->config_compiler_class etc in the future
+ //$this->config_compiler_class = $handler->config_compiler_class;
+ //$this->config_lexer_class = $handler->config_lexer_class;
+ //$this->config_parser_class = $handler->config_parser_class;
+
+ $this->smarty = $smarty;
+ $this->resource = $resource;
+ $this->type = $type;
+ $this->name = $name;
+ $this->unique_resource = $unique_resource;
+ }
+
+ /**
+ * <<magic>> Generic setter.
+ *
+ * @param string $property_name valid: content, timestamp, exists
+ * @param mixed $value newly assigned value (not check for correct type)
+ * @throws SmartyException when the given property name is not valid
+ */
+ public function __set($property_name, $value)
+ {
+ switch ($property_name) {
+ case 'content':
+ case 'timestamp':
+ case 'exists':
+ $this->$property_name = $value;
+ break;
+
+ default:
+ throw new SmartyException("invalid config property '$property_name'.");
+ }
+ }
+
+ /**
+ * <<magic>> Generic getter.
+ *
+ * @param string $property_name valid: content, timestamp, exists
+ * @throws SmartyException when the given property name is not valid
+ */
+ public function __get($property_name)
+ {
+ switch ($property_name) {
+ case 'timestamp':
+ case 'exists':
+ $this->handler->populateTimestamp($this);
+ return $this->$property_name;
+
+ case 'content':
+ return $this->content = $this->handler->getContent($this);
+
+ default:
+ throw new SmartyException("config property '$property_name' does not exist.");
+ }
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_cacher_inlinecode.php b/includes/Smarty/sysplugins/smarty_internal_cacher_inlinecode.php
deleted file mode 100644
index eb943fe..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_cacher_inlinecode.php
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Cacher InlineCode
-*
-* Process nocached code.
-* Version to inject nocache code directly into cache file
-* if caching is disabled at render time the code is being evaluated
-*
-* @package Smarty
-* @subpackage Cacher
-* @author Uwe Tews
-*/
-
-/**
-* Smarty Internal Plugin Cacher InlineCode Class
-*/
-class Smarty_Internal_Cacher_InlineCode {
- function __construct($smarty)
- {
- $this->smarty = $smarty;
- }
-
- /**
- * Inject inline code for nocache template sections
- *
- * This method gets the content of each template element from the parser.
- * If the content is compiled code and it should be not cached the code is injected
- * into the rendered output.
- *
- * @param string $content content of template element
- * @param object $compiler intance of compiler class
- * @param boolean $tag_nocache true if the parser detected a nocache situation
- * @param boolean $is_code true if content is compiled code
- * @return string content
- */
- public function processNocacheCode ($content, $compiler, $is_code)
- {
- // If the template is not evaluated and we have a nocache section and or a nocache tag
- if ($is_code) {
- // generate replacement code
- if ((!$compiler->template->isEvaluated() || $compiler->template->forceNocache) && $compiler->template->caching &&
- ($compiler->nocache || $compiler->tag_nocache)) {
- $compiler->tag_nocache = false;
- $_output = str_replace("'", "\'", $content);
- $_output = '<?php echo \'' . $_output . '\';?>';
- } else {
- $_output = $content;
- }
- } else {
- $_output = $content;
- }
- // if compiled code shall be grabbed
- if ($compiler->template->extract_code == false) {
- // return output
- return $_output;
- } else {
- // store code in extract buffer
- $compiler->template->extracted_compiled_code .= $_output;
- return '';
- }
- }
-
- /**
- * Initialize cacher
- *
- * Is a noop in current implementation
- *
- * @param object $compiler intance of compiler class
- */
- public function initCacher ($compiler)
- {
- return;
- }
-
- /**
- * Close cacher
- *
- * Hook to perform any post processing on the final compiled template
- * Is a noop in current implementation
- *
- * @param object $compiler intance of compiler class
- * @param string $template_code complete compiled template
- * @return string compiled template output
- */
- public function closeCacher ($compiler, $template_code)
- {
- return $template_code;
- }
-
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_cacheresource_file.php b/includes/Smarty/sysplugins/smarty_internal_cacheresource_file.php
deleted file mode 100644
index 269207f..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_cacheresource_file.php
+++ /dev/null
@@ -1,184 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin CacheResource File
-*
-* Implements the file system as resource for the HTML cache
-* Version ussing nocache inserts
-*
-* @package Smarty
-* @subpackage Cacher
-* @author Uwe Tews
-*/
-
-/**
-* This class does contain all necessary methods for the HTML cache on file system
-*/
-class Smarty_Internal_CacheResource_File {
- function __construct($smarty)
- {
- $this->smarty = $smarty;
- }
- /**
- * Returns the filepath of the cached template output
- *
- * @param object $template current template
- * @return string the cache filepath
- */
- public function getCachedFilepath($template)
- {
- return $this->buildCachedFilepath ($template->resource_name, $template->cache_id, $template->compile_id);
- }
-
- /**
- * Returns the timpestamp of the cached template output
- *
- * @param object $template current template
- * @return integer |booelan the template timestamp or false if the file does not exist
- */
- public function getCachedTimestamp($template)
- {
- return ($template->getCachedFilepath() && file_exists($template->getCachedFilepath())) ? filemtime($template->getCachedFilepath()) : false ;
- }
-
- /**
- * Returns the cached template output
- *
- * @param object $template current template
- * @return string |booelan the template content or false if the file does not exist
- */
- public function getCachedContents($template)
- {
- ob_start();
- $_smarty_tpl = $template;
- include $template->getCachedFilepath();
- return ob_get_clean();
- }
-
- /**
- * Writes the rendered template output to cache file
- *
- * @param object $template current template
- * @return boolean status
- */
- public function writeCachedContent($template, $content)
- {
- if (!$template->isEvaluated()) {
- return Smarty_Internal_Write_File::writeFile($template->getCachedFilepath(), $content, $this->smarty);
- } else {
- return false;
- }
- }
-
- /**
- * Empty cache folder
- *
- * @param integer $exp_time expiration time
- * @return integer number of cache files deleted
- */
- public function clearAll($exp_time = null)
- {
- return $this->clear(null, null, null, $exp_time);
- }
- /**
- * Empty cache for a specific template
- *
- * @param string $resource_name template name
- * @param string $cache_id cache id
- * @param string $compile_id compile id
- * @param integer $exp_time expiration time
- * @return integer number of cache files deleted
- */
- public function clear($resource_name, $cache_id, $compile_id, $exp_time)
- {
- $_cache_id = isset($cache_id) ? preg_replace('![^\w\|]+!','_',$cache_id) : null;
- $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!','_',$compile_id) : null;
- $_dir_sep = $this->smarty->use_sub_dirs ? DS : '^';
- if (isset($resource_name)) {
- $_resource_part = (string)abs(crc32($resource_name)) . '.' . $resource_name . '.php';
- } else {
- $_resource_part = null;
- }
- $_dir = $this->smarty->cache_dir;
- if (strpos('/\\', substr($_dir, -1)) === false) {
- $_dir .= DS;
- }
- if ($this->smarty->use_sub_dirs && isset($_cache_id)) {
- $_dir .= str_replace('|', $_dir_sep, $_cache_id) . $_dir_sep;
- }
- $_compile_pos = $this->smarty->use_sub_dirs ? 5 : 2;
- $_count = 0;
- $_cacheDirs = new RecursiveDirectoryIterator($_dir);
- $_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST);
- foreach ($_cache as $_file) {
- if (strpos($_file, '.svn') !== false) continue;
- if ($_file->isDir()) {
- if (!$_cache->isDot()) {
- // delete folder if empty
- @rmdir($_file->getPathname());
- }
- } else {
- $_parts = explode($_dir_sep, $_file);
- $_parts_count = count($_parts);
- $_parts_compile_pos = $_parts_count - $_compile_pos;
- if ($_parts_compile_pos < 0) {
- $_parts_compile_pos = 0;
- }
- if ((substr_compare((string)$_file, $_dir, 0, strlen($_dir)) == 0 &&
- (!isset($resource_name) || $_parts[$_parts_count-1] == $_resource_part) &&
- (!isset($_compile_id) || $_parts[$_parts_compile_pos] == $_compile_id)) ||
- (isset($resource_name) && (string)$_file == $_dir . $_resource_part)) {
- if (isset($exp_time)) {
- if (time() - @filemtime($_file) >= $exp_time) {
- $_count += unlink((string) $_file) ? 1 : 0;
- }
- } else {
- $_count += unlink((string) $_file) ? 1 : 0;
- }
- }
- }
- }
- return $_count;
- }
- /**
- * Get system filepath to cached file
- *
- * @param string $resource_name template name
- * @param string $cache_id cache id
- * @param string $compile_id compile id
- * @return string filepath of cache file
- */
- private function buildCachedFilepath ($resource_name, $cache_id, $compile_id)
- {
- $_cache_id = isset($cache_id) ? preg_replace('![^\w\|]+!','_',$cache_id) : null;
- $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!','_',$compile_id) : null;
- $_files = explode('|', $resource_name);
- $_filepath = (string)abs(crc32($resource_name));
- // if use_sub_dirs, break file into directories
- if ($this->smarty->use_sub_dirs) {
- $_filepath = substr($_filepath, 0, 2) . DS
- . substr($_filepath, 2, 2) . DS
- . substr($_filepath, 4, 2) . DS
- . $_filepath;
- }
- $_compile_dir_sep = $this->smarty->use_sub_dirs ? DS : '^';
- if (isset($_cache_id)) {
- $_cache_id = str_replace('|', $_compile_dir_sep, $_cache_id) . $_compile_dir_sep;
- } else {
- $_cache_id = '';
- }
- if (isset($_compile_id)) {
- $_compile_id = $_compile_id . $_compile_dir_sep;
- } else {
- $_compile_id = '';
- }
- $_cache_dir = $this->smarty->cache_dir;
- if (strpos('/\\', substr($_cache_dir, -1)) === false) {
- $_cache_dir .= DS;
- }
-
- return $_cache_dir . $_cache_id . $_compile_id . $_filepath . '.' . basename($_files[count($_files)-1]) . '.php';
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_append.php b/includes/Smarty/sysplugins/smarty_internal_compile_append.php
deleted file mode 100644
index d60d808..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_append.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Compile Append
-*
-* Compiles the {append} tag
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Append Class
-*/
-class Smarty_Internal_Compile_Append extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {append} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->required_attributes = array('var', 'value');
- $this->optional_attributes = array('scope', 'nocache', 'index');
-
- $_nocache = 'null';
- $_scope = 'null';
- // check for nocache attribute before _get_attributes because
- // it shall not controll caching of the compiled code, but is a parameter
- if (isset($args['nocache'])) {
- if ($args['nocache'] == 'true') {
- $_nocache = 'true';
- $_nocache_boolean = true;
- }
- unset($args['nocache']);
- }
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- if (isset($_attr['scope'])) {
- if ($_attr['scope'] == '\'parent\'') {
- $_scope = SMARTY_PARENT_SCOPE;
- } elseif ($_attr['scope'] == '\'root\'') {
- $_scope = SMARTY_ROOT_SCOPE;
- } elseif ($_attr['scope'] == '\'global\'') {
- $_scope = SMARTY_GLOBAL_SCOPE;
- }
- }
- // compiled output
- if (isset($_attr['index'])) {
- return "<?php \$_smarty_tpl->append($_attr[var],array($_attr[index] => $_attr[value]),true,$_nocache,$_scope);?>";
- } else {
- return "<?php \$_smarty_tpl->append($_attr[var],$_attr[value],false,$_nocache,$_scope);?>";
- }
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_assign.php b/includes/Smarty/sysplugins/smarty_internal_compile_assign.php
deleted file mode 100644
index f2f3c1d..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_assign.php
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Compile Assign
-*
-* Compiles the {assign} tag
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Assign Class
-*/
-class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {assign} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->required_attributes = array('var', 'value');
- $this->optional_attributes = array('scope', 'nocache', 'index');
-
- $_nocache = 'null';
- $_scope = 'null';
- // check for nocache attribute before _get_attributes because
- // it shall not controll caching of the compiled code, but is a parameter
- if (isset($args['nocache'])) {
- if ($args['nocache'] == 'true') {
- $_nocache = 'true';
- $_nocache_boolean = true;
- }
- unset($args['nocache']);
- }
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- if (isset($_attr['scope'])) {
- if ($_attr['scope'] == '\'parent\'') {
- $_scope = SMARTY_PARENT_SCOPE;
- } elseif ($_attr['scope'] == '\'root\'') {
- $_scope = SMARTY_ROOT_SCOPE;
- } elseif ($_attr['scope'] == '\'global\'') {
- $_scope = SMARTY_GLOBAL_SCOPE;
- }
- }
-
- if (isset($_attr['index'])) {
- $_index = $_attr['index'];
- }
- // compiled output
- if (isset($_attr['index'])) {
- if ($_attr['index'] == '') {
- return "<?php \$_smarty_tpl->append($_attr[var],$_attr[value],false,$_nocache,$_scope);?>";
- } else {
- return "<?php \$_tmp$_attr[index] = $_attr[value]; \$_smarty_tpl->append($_attr[var],\$_tmp,true,$_nocache,$_scope); unset (\$_tmp);?>";
- }
- } else {
- return "<?php \$_smarty_tpl->assign($_attr[var],$_attr[value],$_nocache,$_scope);?>";
- }
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_block.php b/includes/Smarty/sysplugins/smarty_internal_compile_block.php
deleted file mode 100644
index ab4ad25..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_block.php
+++ /dev/null
@@ -1,91 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Compile Block
-*
-* Compiles the {block}{/block} tags
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Block Class
-*/
-class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {block} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return boolean true
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->required_attributes = array('name');
- $this->optional_attributes = array('assign');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
- $save = array($_attr, $compiler->template->extracted_compiled_code, $compiler->template->extract_code);
- $this->_open_tag('block', $save);
- $compiler->template->extract_code = true;
- $compiler->template->extracted_compiled_code = '';
- $compiler->template->has_code = false;
- return true;
- }
-}
-
-/**
-* Smarty Internal Plugin Compile BlockClose Class
-*/
-class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {/block} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->smarty = $compiler->smarty;
- $this->compiler->has_code = true;
- // turn off block code extraction
- $compiler->template->extract_code = false;
- // check and get attributes
- $this->optional_attributes = array('name');
- $_attr = $this->_get_attributes($args);
- $saved_data = $this->_close_tag(array('block'));
- // if name does match to opening tag
- if (isset($_attr['name']) && $saved_data[0]['name'] != $_attr['name']) {
- $this->compiler->trigger_template_error('mismatching name attributes "' . $saved_data[0]['name'] . '" and "' . $_attr['name'] . '"');
- }
- $_name = trim($saved_data[0]['name'], "\"'");
- if (isset($this->smarty->block_data[$_name])) {
- if (strpos($this->smarty->block_data[$_name]['compiled'], '%%%%SMARTY_PARENT%%%%') !== false) {
- $_output = str_replace('%%%%SMARTY_PARENT%%%%', $compiler->template->extracted_compiled_code, $this->smarty->block_data[$_name]['compiled']);
- } elseif ($this->smarty->block_data[$_name]['mode'] == 'prepend') {
- $_output = $this->smarty->block_data[$_name]['compiled'] . $compiler->template->extracted_compiled_code;
- } elseif ($this->smarty->block_data[$_name]['mode'] == 'append') {
- $_output = $compiler->template->extracted_compiled_code . $this->smarty->block_data[$_name]['compiled'];
- } elseif (!empty($this->smarty->block_data[$_name])) {
- $_output = $this->smarty->block_data[$_name]['compiled'];
- }
- } else {
- $_output = $compiler->template->extracted_compiled_code;
- }
- $compiler->template->extracted_compiled_code = $saved_data[1];
- $compiler->template->extract_code = $saved_data[2];
- // check for includes in block tags
- preg_match('/(\<\?php \$_smarty_tpl-\>decodeProperties\(\')(.*)(\'.*\?\>)/', $_output, $matches);
- $_output = preg_replace(array('/(\<\?php \$_smarty_tpl-\>decodeProperties\(\')(.*)(\'.*\?\>.*\n)/', '/(\<\?php if\(\!defined\(\'SMARTY_DIR\'\)\))(.*)(\?\>.*\n)/'), '', $_output);
- if (isset($matches[2])) {
- $prop = unserialize($matches[2]);
- $compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $prop['file_dependency']);
- }
- return $_output;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_block_plugin.php b/includes/Smarty/sysplugins/smarty_internal_compile_block_plugin.php
deleted file mode 100644
index 0d66823..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_block_plugin.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Compile Block Plugin
-*
-* Compiles code for the execution of block plugin
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Block Plugin Class
-*/
-class Smarty_Internal_Compile_Block_Plugin extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the execution of block plugin
- *
- * @param array $args array with attributes from parser
- * @param string $tag name of block function
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler, $tag)
- {
- $this->compiler = $compiler;
- if (strlen($tag) < 6 || substr_compare($tag, 'close', -5, 5) != 0) {
- // opening tag of block plugin
- $this->required_attributes = array();
- $this->optional_attributes = array('_any');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
- // convert attributes into parameter array string
- $_paramsArray = array();
- foreach ($_attr as $_key => $_value) {
- if (is_int($_key)) {
- $_paramsArray[] = "$_key=>$_value";
- } else {
- $_paramsArray[] = "'$_key'=>$_value";
- }
- }
- $_params = 'array(' . implode(",", $_paramsArray) . ')';
-
- $this->_open_tag($tag, array($_params, $this->compiler->nocache));
- // not cachable?
- if (isset($this->compiler->smarty->registered_plugins[$tag]) && !$this->compiler->smarty->registered_plugins[$tag][2]) {
- $this->compiler->nocache = true;
- }
- // maybe nocache because of nocache variables
- $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
- // compile code
- $output = '<?php $_block_repeat=true; $_smarty_tpl->smarty->plugin_handler->' . $tag . '(array(' . $_params . ', null, $_smarty_tpl->smarty, &$_block_repeat, $_smarty_tpl),\'block\');while ($_block_repeat) { ob_start();?>';
- } else {
- // must endblock be nocache?
- if ($this->compiler->nocache) {
- $this->compiler->tag_nocache = true;
- }
- // closing tag of block plugin, restore nocache
- list($_params, $this->compiler->nocache) = $this->_close_tag(substr($tag, 0, -5));
- // This tag does create output
- $this->compiler->has_output = true;
- // compile code
- $output = '<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->plugin_handler->' . substr($tag, 0, -5) . '(array(' . $_params . ', $_block_content, $_smarty_tpl->smarty, &$_block_repeat, $_smarty_tpl),\'block\'); }?>';
- }
- return $output;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_break.php b/includes/Smarty/sysplugins/smarty_internal_compile_break.php
new file mode 100755
index 0000000..259c66e
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_compile_break.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Break
+ *
+ * Compiles the {break} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+/**
+ * Smarty Internal Plugin Compile Break Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase {
+
+ /**
+ * Attribute definition: Overwrites base class.
+ *
+ * @var array
+ * @see Smarty_Internal_CompileBase
+ */
+ public $optional_attributes = array('levels');
+ /**
+ * Attribute definition: Overwrites base class.
+ *
+ * @var array
+ * @see Smarty_Internal_CompileBase
+ */
+ public $shorttag_order = array('levels');
+
+ /**
+ * Compiles code for the {break} tag
+ *
+ * @param array $args array with attributes from parser
+ * @param object $compiler compiler object
+ * @param array $parameter array with compilation parameter
+ * @return string compiled code
+ */
+ public function compile($args, $compiler, $parameter)
+ {
+ static $_is_loopy = array('for' => true, 'foreach' => true, 'while' => true, 'section' => true);
+ // check and get attributes
+ $_attr = $this->getAttributes($compiler, $args);
+
+ if ($_attr['nocache'] === true) {
+ $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);
+ }
+
+ if (isset($_attr['levels'])) {
+ if (!is_numeric($_attr['levels'])) {
+ $compiler->trigger_template_error('level attribute must be a numeric constant', $compiler->lex->taglineno);
+ }
+ $_levels = $_attr['levels'];
+ } else {
+ $_levels = 1;
+ }
+ $level_count = $_levels;
+ $stack_count = count($compiler->_tag_stack) - 1;
+ while ($level_count > 0 && $stack_count >= 0) {
+ if (isset($_is_loopy[$compiler->_tag_stack[$stack_count][0]])) {
+ $level_count--;
+ }
+ $stack_count--;
+ }
+ if ($level_count != 0) {
+ $compiler->trigger_template_error("cannot break {$_levels} level(s)", $compiler->lex->taglineno);
+ }
+ $compiler->has_code = true;
+ return "<?php break {$_levels}?>";
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_call.php b/includes/Smarty/sysplugins/smarty_internal_compile_call.php
new file mode 100755
index 0000000..af12a04
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_compile_call.php
@@ -0,0 +1,130 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Function_Call
+ *
+ * Compiles the calls of user defined tags defined by {function}
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Function_Call Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase {
+
+ /**
+ * Attribute definition: Overwrites base class.
+ *
+ * @var array
+ * @see Smarty_Internal_CompileBase
+ */
+ public $required_attributes = array('name');
+ /**
+ * Attribute definition: Overwrites base class.
+ *
+ * @var array
+ * @see Smarty_Internal_CompileBase
+ */
+ public $shorttag_order = array('name');
+ /**
+ * Attribute definition: Overwrites base class.
+ *
+ * @var array
+ * @see Smarty_Internal_CompileBase
+ */
+ public $optional_attributes = array('_any');
+
+ /**
+ * Compiles the calls of user defined tags defined by {function}
+ *
+ * @param array $args array with attributes from parser
+ * @param object $compiler compiler object
+ * @param array $parameter array with compilation parameter
+ * @return string compiled code
+ */
+ public function compile($args, $compiler)
+ {
+ // check and get attributes
+ $_attr = $this->getAttributes($compiler, $args);
+ // save possible attributes
+ if (isset($_attr['assign'])) {
+ // output will be stored in a smarty variable instead of beind displayed
+ $_assign = $_attr['assign'];
+ }
+ $_name = $_attr['name'];
+ if ($compiler->compiles_template_function) {
+ $compiler->called_functions[] = trim($_name, "'\"");
+ }
+ unset($_attr['name'], $_attr['assign'], $_attr['nocache']);
+ // set flag (compiled code of {function} must be included in cache file
+ if ($compiler->nocache || $compiler->tag_nocache) {
+ $_nocache = 'true';
+ } else {
+ $_nocache = 'false';
+ }
+ $_paramsArray = array();
+ foreach ($_attr as $_key => $_value) {
+ if (is_int($_key)) {
+ $_paramsArray[] = "$_key=>$_value";
+ } else {
+ $_paramsArray[] = "'$_key'=>$_value";
+ }
+ }
+ if (isset($compiler->template->properties['function'][$_name]['parameter'])) {
+ foreach ($compiler->template->properties['function'][$_name]['parameter'] as $_key => $_value) {
+ if (!isset($_attr[$_key])) {
+ if (is_int($_key)) {
+ $_paramsArray[] = "$_key=>$_value";
+ } else {
+ $_paramsArray[] = "'$_key'=>$_value";
+ }
+ }
+ }
+ } elseif (isset($compiler->smarty->template_functions[$_name]['parameter'])) {
+ foreach ($compiler->smarty->template_functions[$_name]['parameter'] as $_key => $_value) {
+ if (!isset($_attr[$_key])) {
+ if (is_int($_key)) {
+ $_paramsArray[] = "$_key=>$_value";
+ } else {
+ $_paramsArray[] = "'$_key'=>$_value";
+ }
+ }
+ }
+ }
+ //varibale name?
+ if (!(strpos($_name, '$') === false)) {
+ $call_cache = $_name;
+ $call_function = '$tmp = "smarty_template_function_".' . $_name . '; $tmp';
+ } else {
+ $_name = trim($_name, "'\"");
+ $call_cache = "'{$_name}'";
+ $call_function = 'smarty_template_function_' . $_name;
+ }
+
+ $_params = 'array(' . implode(",", $_paramsArray) . ')';
+ $_hash = str_replace('-', '_', $compiler->template->properties['nocache_hash']);
+ // was there an assign attribute
+ if (isset($_assign)) {
+ if ($compiler->template->caching) {
+ $_output = "<?php ob_start(); Smarty_Internal_Function_Call_Handler::call ({$call_cache},\$_smarty_tpl,{$_params},'{$_hash}',{$_nocache}); \$_smarty_tpl->assign({$_assign}, ob_get_clean());?>\n";
+ } else {
+ $_output = "<?php ob_start(); {$call_function}(\$_smarty_tpl,{$_params}); \$_smarty_tpl->assign({$_assign}, ob_get_clean());?>\n";
+ }
+ } else {
+ if ($compiler->template->caching) {
+ $_output = "<?php Smarty_Internal_Function_Call_Handler::call ({$call_cache},\$_smarty_tpl,{$_params},'{$_hash}',{$_nocache});?>\n";
+ } else {
+ $_output = "<?php {$call_function}(\$_smarty_tpl,{$_params});?>\n";
+ }
+ }
+ return $_output;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_capture.php b/includes/Smarty/sysplugins/smarty_internal_compile_capture.php
deleted file mode 100644
index 9a58785..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_capture.php
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Compile Capture
-*
-* Compiles the {capture} tag
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Capture Class
-*/
-class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {capture} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->optional_attributes = array('name', 'assign', 'append');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- $buffer = isset($_attr['name']) ? $_attr['name'] : "'default'";
- $assign = isset($_attr['assign']) ? $_attr['assign'] : null;
- $append = isset($_attr['append']) ? $_attr['append'] : null;
-
- $this->compiler->_capture_stack[] = array($buffer, $assign, $append);
-
- $_output = "<?php ob_start(); ?>";
-
- return $_output;
- }
-}
-
-/**
-* Smarty Internal Plugin Compile Captureclose Class
-*/
-class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {/capture} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- list($buffer, $assign, $append) = array_pop($this->compiler->_capture_stack);
-
- $_output = "<?php ";
- if (isset($assign)) {
- $_output .= " \$_smarty_tpl->assign($assign, ob_get_contents());";
- }
- if (isset($append)) {
- $_output .= " \$_smarty_tpl->append($append, ob_get_contents());";
- }
- $_output .= " \$_smarty_tpl->smarty->_smarty_vars['capture'][$buffer]=ob_get_clean(); ?>";
- return $_output;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_config_load.php b/includes/Smarty/sysplugins/smarty_internal_compile_config_load.php
deleted file mode 100644
index 0dd1ba8..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_config_load.php
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Compile Config Load
-*
-* Compiles the {config load} tag
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Config Load Class
-*/
-class Smarty_Internal_Compile_Config_Load extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {config_load} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->required_attributes = array('file');
- $this->optional_attributes = array('section', 'scope');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
- // save posible attributes
- $conf_file = $_attr['file'];
- if (isset($_attr['section'])) {
- $section = $_attr['section'];
- } else {
- $section = 'null';
- }
- $scope = '$_smarty_tpl->smarty';
- if (isset($_attr['scope'])) {
- if ($_attr['scope'] == '\'local\'') {
- $scope = '$_smarty_tpl';
- } elseif ($_attr['scope'] == '\'parent\'') {
- $scope = '$_smarty_tpl->parent';
- }
- }
-
- // create config object
- $_output = "<?php \$_config = new Smarty_Internal_Config($conf_file, \$_smarty_tpl->smarty, \$_smarty_tpl);";
- $_output .= "\$_config->loadConfigVars($section, $scope); ?>";
- return $_output;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_continue.php b/includes/Smarty/sysplugins/smarty_internal_compile_continue.php
new file mode 100755
index 0000000..4082a93
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_compile_continue.php
@@ -0,0 +1,78 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Continue
+ *
+ * Compiles the {continue} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Continue Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Continue extends Smarty_Internal_CompileBase {
+
+ /**
+ * Attribute definition: Overwrites base class.
+ *
+ * @var array
+ * @see Smarty_Internal_CompileBase
+ */
+ public $optional_attributes = array('levels');
+ /**
+ * Attribute definition: Overwrites base class.
+ *
+ * @var array
+ * @see Smarty_Internal_CompileBase
+ */
+ public $shorttag_order = array('levels');
+
+ /**
+ * Compiles code for the {continue} tag
+ *
+ * @param array $args array with attributes from parser
+ * @param object $compiler compiler object
+ * @param array $parameter array with compilation parameter
+ * @return string compiled code
+ */
+ public function compile($args, $compiler, $parameter)
+ {
+ static $_is_loopy = array('for' => true, 'foreach' => true, 'while' => true, 'section' => true);
+ // check and get attributes
+ $_attr = $this->getAttributes($compiler, $args);
+
+ if ($_attr['nocache'] === true) {
+ $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);
+ }
+
+ if (isset($_attr['levels'])) {
+ if (!is_numeric($_attr['levels'])) {
+ $compiler->trigger_template_error('level attribute must be a numeric constant', $compiler->lex->taglineno);
+ }
+ $_levels = $_attr['levels'];
+ } else {
+ $_levels = 1;
+ }
+ $level_count = $_levels;
+ $stack_count = count($compiler->_tag_stack) - 1;
+ while ($level_count > 0 && $stack_count >= 0) {
+ if (isset($_is_loopy[$compiler->_tag_stack[$stack_count][0]])) {
+ $level_count--;
+ }
+ $stack_count--;
+ }
+ if ($level_count != 0) {
+ $compiler->trigger_template_error("cannot continue {$_levels} level(s)", $compiler->lex->taglineno);
+ }
+ $compiler->has_code = true;
+ return "<?php continue {$_levels}?>";
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_debug.php b/includes/Smarty/sysplugins/smarty_internal_compile_debug.php
deleted file mode 100644
index 8ff9671..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_debug.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Compile Debug
-*
-* Compiles the {debug} tag
-* It opens a window the the Smarty Debugging Console
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Debug Class
-*/
-class Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {debug} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- // display debug template
- $_output = "<?php \$_smarty_tpl->smarty->loadPlugin('Smarty_Internal_Debug'); Smarty_Internal_Debug::display_debug(\$_smarty_tpl->smarty); ?>";
- return $_output;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_eval.php b/includes/Smarty/sysplugins/smarty_internal_compile_eval.php
deleted file mode 100644
index c94a1aa..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_eval.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Compile Eval
-*
-* Compiles the {eval} tag
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Eval Class
-*/
-class Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {eval} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->required_attributes = array('var');
- $this->optional_attributes = array('assign');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
- if (isset($_attr['assign'])) {
- // output will be stored in a smarty variable instead of beind displayed
- $_assign = $_attr['assign'];
- }
-
- // create template object
- $_output = "\$_template = new Smarty_Template ('string:'.".$_attr['var'].", \$_smarty_tpl->smarty, \$_smarty_tpl);";
- //was there an assign attribute?
- if (isset($_assign)) {
- $_output .= "\$_smarty_tpl->assign($_assign,\$_template->getRenderedTemplate());";
- } else {
- $_output .= "echo \$_template->getRenderedTemplate();";
- }
- return "<?php $_output ?>";
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_extends.php b/includes/Smarty/sysplugins/smarty_internal_compile_extends.php
deleted file mode 100644
index 75c7890..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_extends.php
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Compile extend
-*
-* Compiles the {extends} tag
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile extend Class
-*/
-class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {extends} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->smarty =$compiler->smarty;
- $this->required_attributes = array('file');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
- $_smarty_tpl = $compiler->template;
- // $include_file = '';
- eval('$include_file = ' . $_attr['file'] . ';');
- // create template object
- $_template = new Smarty_Template ($include_file, $this->smarty, $compiler->template);
- // save file dependency
- $compiler->template->properties['file_dependency']['F'.abs(crc32($_template->getTemplateFilepath()))] = array($_template->getTemplateFilepath(), $_template->getTemplateTimestamp());
- $_old_source = $compiler->template->template_source;
- if (preg_match_all('/(' . $this->smarty->left_delimiter . 'block(.+?)' . $this->smarty->right_delimiter . ')/', $_old_source, $s, PREG_OFFSET_CAPTURE) !=
- preg_match_all('/(' . $this->smarty->left_delimiter . '\/block(.*?)' . $this->smarty->right_delimiter . ')/', $_old_source, $c, PREG_OFFSET_CAPTURE)) {
- $this->compiler->trigger_template_error(" unmatched {block} {/block} pairs");
- }
- $block_count = count($s[0]);
- for ($i = 0; $i < $block_count; $i++) {
- $block_content = str_replace($this->smarty->left_delimiter . '$smarty.parent' . $this->smarty->right_delimiter, '%%%%SMARTY_PARENT%%%%',
- substr($_old_source, $s[0][$i][1] + strlen($s[0][$i][0]), $c[0][$i][1] - $s[0][$i][1] - strlen($s[0][$i][0])));
- $this->saveBlockData($block_content, $s[0][$i][0],$compiler->template);
- }
- $compiler->template->template_source = $_template->getTemplateSource();
- $compiler->abort_and_recompile = true;
- return ' ';
- }
-
- protected function saveBlockData($block_content, $block_tag,$template)
- {
- if (0 == preg_match('/(.?)(name=)([^ ]*)/', $block_tag, $_match)) {
- $this->compiler->trigger_template_error("\"" . $block_tag . "\" missing name attribute");
- } else {
- // compile block content
- $_tpl = $this->smarty->createTemplate('string:' . $block_content,null,null,$template);
- $_tpl->template_filepath = $this->compiler->template->getTemplateFilepath();
- $_tpl->forceNocache= true;
- $_compiled_content = $_tpl->getCompiledTemplate();
- unset($_tpl);
- $_name = trim($_match[3], "\"'}");
-
- if (isset($this->smarty->block_data[$_name])) {
- if (strpos($this->smarty->block_data[$_name]['compiled'], '%%%%SMARTY_PARENT%%%%') !== false) {
- $this->smarty->block_data[$_name]['compiled'] =
- str_replace('%%%%SMARTY_PARENT%%%%', $_compiled_content, $this->smarty->block_data[$_name]['compiled']);
- } elseif ($this->smarty->block_data[$_name]['mode'] == 'prepend') {
- $this->smarty->block_data[$_name]['compiled'] .= $_compiled_content;
- } elseif ($this->smarty->block_data[$_name]['mode'] == 'append') {
- $this->smarty->block_data[$_name]['compiled'] = $_compiled_content . $this->smarty->block_data[$_name]['compiled'];
- }
- } else {
- $this->smarty->block_data[$_name]['compiled'] = $_compiled_content;
- }
- if (preg_match('/(.?)(append=true)(.*)/', $block_tag, $_match) != 0) {
- $this->smarty->block_data[$_name]['mode'] = 'append';
- } elseif (preg_match('/(.?)(prepend=true)(.*)/', $block_tag, $_match) != 0) {
- $this->smarty->block_data[$_name]['mode'] = 'prepend';
- } else {
- $this->smarty->block_data[$_name]['mode'] = 'replace';
- }
- }
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_for.php b/includes/Smarty/sysplugins/smarty_internal_compile_for.php
deleted file mode 100644
index 1fe3c4d..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_for.php
+++ /dev/null
@@ -1,109 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Compile For
-*
-* Compiles the {for} {forelse} {/for} tags
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile For Class
-*/
-class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {for} tag
- *
- * Smarty 3 does implement two different sytaxes:
- *
- * - {for $var in $array}
- * For looping over arrays or iterators
- *
- * - {for $x=0; $x<$y; $x++}
- * For general loops
- *
- * The parser is gereration different sets of attribute by which this compiler can
- * determin which syntax is used.
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- // {for $x=0; $x<$y; $x++} syntax
- $this->required_attributes = array('ifexp', 'start', 'loop', 'varloop');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- $this->_open_tag('for', array('for',$this->compiler->nocache));
- // maybe nocache because of nocache variables
- $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
-
- $output = "<?php ";
- foreach ($_attr['start'] as $_statement) {
- $output .= " \$_smarty_tpl->tpl_vars[$_statement[var]] = new Smarty_Variable;";
- $output .= " \$_smarty_tpl->tpl_vars[$_statement[var]]->value = $_statement[value];\n";
- }
- $output .= " if ($_attr[ifexp]){ for (\$_foo=true;$_attr[ifexp]; \$_smarty_tpl->tpl_vars[$_attr[varloop]]->value$_attr[loop]){\n";
- $output .= "?>";
- // return compiled code
- return $output;
- }
-}
-
-/**
-* Smarty Internal Plugin Compile Forelse Class
-*/
-class Smarty_Internal_Compile_Forelse extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {forelse} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- list($_open_tag, $nocache) = $this->_close_tag(array('for'));
- $this->_open_tag('forelse',array('forelse', $nocache));
- return "<?php }} else { ?>";
- }
-}
-
-/**
-* Smarty Internal Plugin Compile Forclose Class
-*/
-class Smarty_Internal_Compile_Forclose extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {/for} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- // check and get attributes
- $_attr = $this->_get_attributes($args);
- // must endblock be nocache?
- if ($this->compiler->nocache) {
- $this->compiler->tag_nocache = true;
- }
-
- list($_open_tag, $this->compiler->nocache) = $this->_close_tag(array('for', 'forelse'));
- if ($_open_tag == 'forelse')
- return "<?php } ?>";
- else
- return "<?php }} ?>";
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_foreach.php b/includes/Smarty/sysplugins/smarty_internal_compile_foreach.php
deleted file mode 100644
index 09801fd..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_foreach.php
+++ /dev/null
@@ -1,192 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Compile Foreach
-*
-* Compiles the {foreach} {foreachelse} {/foreach} tags
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Foreach Class
-*/
-class Smarty_Internal_Compile_Foreach extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {foreach} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->required_attributes = array('from', 'item');
- $this->optional_attributes = array('name', 'key');
- $tpl = $compiler->template;
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- $this->_open_tag('foreach', array('foreach',$this->compiler->nocache));
- // maybe nocache because of nocache variables
- $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
-
- $from = $_attr['from'];
- $item = $_attr['item'];
-
- if (isset($_attr['key'])) {
- $key = $_attr['key'];
- } else {
- $key = null;
- }
-
- if (isset($_attr['name'])) {
- $name = $_attr['name'];
- $has_name = true;
- $SmartyVarName = '$smarty.foreach.' . trim($name,'\'"') . '.';
- } else {
- $name = null;
- $has_name = false;
- }
- $ItemVarName = '$' . trim($item,'\'"') . '@';
- // evaluates which Smarty variables and properties have to be computed
- if ($has_name) {
- $usesSmartyFirst = strpos($tpl->template_source, $SmartyVarName . 'first') !== false;
- $usesSmartyLast = strpos($tpl->template_source, $SmartyVarName . 'last') !== false;
- $usesSmartyIndex = strpos($tpl->template_source, $SmartyVarName . 'index') !== false;
- $usesSmartyIteration = strpos($tpl->template_source, $SmartyVarName . 'iteration') !== false;
- $usesSmartyShow = strpos($tpl->template_source, $SmartyVarName . 'show') !== false;
- $usesSmartyTotal = $usesSmartyLast || strpos($tpl->template_source, $SmartyVarName . 'total') !== false;
- } else {
- $usesSmartyFirst = false;
- $usesSmartyLast = false;
- $usesSmartyTotal = false;
- }
-
- $usesPropFirst = $usesSmartyFirst || strpos($tpl->template_source, $ItemVarName . 'first') !== false;
- $usesPropLast = $usesSmartyLast || strpos($tpl->template_source, $ItemVarName . 'last') !== false;
- $usesPropIndex = $usesPropFirst || strpos($tpl->template_source, $ItemVarName . 'index') !== false;
- $usesPropIteration = $usesPropLast || strpos($tpl->template_source, $ItemVarName . 'iteration') !== false;
- $usesPropShow = strpos($tpl->template_source, $ItemVarName . 'show') !== false;
- $usesPropTotal = $usesSmartyTotal || $usesPropLast || strpos($tpl->template_source, $ItemVarName . 'total') !== false;
- // generate output code
- $output = "<?php ";
- $output .= " \$_smarty_tpl->tpl_vars[$item] = new Smarty_Variable;\n";
- if ($key != null) {
- $output .= " \$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable;\n";
- }
- $output .= " \$_from = $from; if (!is_array(\$_from) && !is_object(\$_from)) { settype(\$_from, 'array');}\n";
- if ($usesPropTotal) {
- $output .= " \$_smarty_tpl->tpl_vars[$item]->total=count(\$_from);\n";
- }
- if ($usesPropIteration) {
- $output .= " \$_smarty_tpl->tpl_vars[$item]->iteration=0;\n";
- }
- if ($usesPropIndex) {
- $output .= " \$_smarty_tpl->tpl_vars[$item]->index=-1;\n";
- }
- if ($has_name) {
- if ($usesSmartyTotal) {
- $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['total'] = \$_smarty_tpl->tpl_vars[$item]->total;\n";
- }
- if ($usesSmartyIteration) {
- $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['iteration']=0;\n";
- }
- if ($usesSmartyIndex) {
- $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['index']=-1;\n";
- }
- }
- $output .= "if (count(\$_from) > 0){\n";
- $output .= " foreach (\$_from as \$_smarty_tpl->tpl_vars[$item]->key => \$_smarty_tpl->tpl_vars[$item]->value){\n";
- if ($key != null) {
- $output .= " \$_smarty_tpl->tpl_vars[$key]->value = \$_smarty_tpl->tpl_vars[$item]->key;\n";
- }
- if ($usesPropIteration) {
- $output .= " \$_smarty_tpl->tpl_vars[$item]->iteration++;\n";
- }
- if ($usesPropIndex) {
- $output .= " \$_smarty_tpl->tpl_vars[$item]->index++;\n";
- }
- if ($usesPropFirst) {
- $output .= " \$_smarty_tpl->tpl_vars[$item]->first = \$_smarty_tpl->tpl_vars[$item]->index === 0;\n";
- }
- if ($usesPropLast) {
- $output .= " \$_smarty_tpl->tpl_vars[$item]->last = \$_smarty_tpl->tpl_vars[$item]->iteration === \$_smarty_tpl->tpl_vars[$item]->total;\n";
- }
- if ($has_name) {
- if ($usesSmartyFirst) {
- $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['first'] = \$_smarty_tpl->tpl_vars[$item]->first;\n";
- }
- if ($usesSmartyIteration) {
- $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['iteration']++;\n";
- }
- if ($usesSmartyIndex) {
- $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['index']++;\n";
- }
- if ($usesSmartyLast) {
- $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['last'] = \$_smarty_tpl->tpl_vars[$item]->last;\n";
- }
- }
- $output .= "?>";
-
- return $output;
- }
-}
-
-/**
-* Smarty Internal Plugin Compile Foreachelse Class
-*/
-class Smarty_Internal_Compile_Foreachelse extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {foreachelse} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- list($_open_tag, $nocache) = $this->_close_tag(array('foreach'));
- $this->_open_tag('foreachelse',array('foreachelse', $nocache));
-
- return "<?php }} else { ?>";
- }
-}
-
-/**
-* Smarty Internal Plugin Compile Foreachclose Class
-*/
-class Smarty_Internal_Compile_Foreachclose extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {/foreach} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- // must endblock be nocache?
- if ($this->compiler->nocache) {
- $this->compiler->tag_nocache = true;
- }
-
- list($_open_tag, $this->compiler->nocache) = $this->_close_tag(array('foreach', 'foreachelse'));
-
- if ($_open_tag == 'foreachelse')
- return "<?php } ?>";
- else
- return "<?php }} ?>";
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_function.php b/includes/Smarty/sysplugins/smarty_internal_compile_function.php
deleted file mode 100644
index 56f451b..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_function.php
+++ /dev/null
@@ -1,79 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Compile Function
-*
-* Compiles the {function} {/function} tags
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Function Class
-*/
-class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {function} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return boolean true
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->required_attributes = array('name');
- $this->optional_attributes = array('_any');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
- $save = array($_attr, $compiler->template->extracted_compiled_code, $compiler->template->extract_code);
- $this->_open_tag('function', $save);
- $_name = trim($_attr['name'], "'");
- foreach ($_attr as $_key => $_data) {
- $compiler->template->properties['function'][$_name]['parameter'][$_key] = $_data;
- }
- // make function known for recursive calls
- $this->compiler->smarty->template_functions[$_name]['compiled'] = '';
- $compiler->template->extract_code = true;
- $compiler->template->extracted_compiled_code = '';
- $compiler->template->has_code = false;
- return true;
- }
-}
-
-/**
-* Smarty Internal Plugin Compile Functionclose Class
-*/
-class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {/function} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return boolean true
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->compiler->has_code = false;
- // turn off block code extraction
- $compiler->template->extract_code = false;
- // check and get attributes
- $this->optional_attributes = array('name');
- $_attr = $this->_get_attributes($args);
- $saved_data = $this->_close_tag(array('function'));
- // if name does match to opening tag
- if (isset($_attr['name']) && $saved_data[0]['name'] != $_attr['name']) {
- $this->compiler->trigger_template_error('mismatching name attributes "' . $saved_data[0]['name'] . '" and "' . $_attr['name'] . '"');
- }
- $_name = trim($saved_data[0]['name'], "'");
- $compiler->template->properties['function'][$_name]['compiled'] = str_replace("\n",'_%n',$compiler->template->extracted_compiled_code);
- $this->compiler->smarty->template_functions[$_name]['compiled'] = $compiler->template->extracted_compiled_code;
- $this->compiler->smarty->template_functions[$_name]['parameter'] = $compiler->template->properties['function'][$_name]['parameter'];
- $compiler->template->extracted_compiled_code = $saved_data[1];
- $compiler->template->extract_code = $saved_data[2];
- return true;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_function_call.php b/includes/Smarty/sysplugins/smarty_internal_compile_function_call.php
deleted file mode 100644
index 18371f2..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_function_call.php
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Compile Function_Call
-*
-* Compiles the calls of user defined tags defined by {function}
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Function_Call Class
-*/
-class Smarty_Internal_Compile_Function_Call extends Smarty_Internal_CompileBase {
- /**
- * Compiles the calls of user defined tags defined by {function}
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->required_attributes = array('name');
- $this->optional_attributes = array('_any');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
- // save posible attributes
- if (isset($_attr['assign'])) {
- // output will be stored in a smarty variable instead of beind displayed
- $_assign = $_attr['assign'];
- }
- $_name = trim($_attr['name'], "'");
- // create template object
- $_output = "<?php \$_template = new Smarty_Template ('string:', \$_smarty_tpl->smarty, \$_smarty_tpl);\n";
- // assign default paramter
- if (isset($this->smarty->template_functions[$_name]['parameter'])) {
- // function is already compiled
- foreach ($this->smarty->template_functions[$_name]['parameter'] as $_key => $_value) {
- if (!isset($_attr[$_key])) {
- $_output .= "\$_template->assign('$_key',$_value);\n";
- }
- }
- }
- if (isset($compiler->template->properties['function'][$_name]['parameter'])) {
- // for recursive call during function compilation
- foreach ($compiler->template->properties['function'][$_name]['parameter'] as $_key => $_value) {
- if (!isset($_attr[$_key])) {
- $_output .= "\$_template->assign('$_key',$_value);\n";
- }
- }
- }
- // delete {include} standard attributes
- unset($_attr['name'], $_attr['assign']);
- // remaining attributes must be assigned as smarty variable
- if (!empty($_attr)) {
- // create variables
- foreach ($_attr as $_key => $_value) {
- $_output .= "\$_template->assign('$_key',$_value);\n";
- }
- }
- // load compiled function
- $_output .= "\$_template->compiled_template = \$this->smarty->template_functions['$_name']['compiled'];\n\$_template->mustCompile = false;\n";
- // was there an assign attribute
- if (isset($_assign)) {
- $_output .= "\$_smarty_tpl->assign($_assign,\$_template->getRenderedTemplate()); ?>";
- } else {
- $_output .= "echo \$_template->getRenderedTemplate(); ?>";
- }
- return $_output;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_function_plugin.php b/includes/Smarty/sysplugins/smarty_internal_compile_function_plugin.php
deleted file mode 100644
index 8d9ffab..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_function_plugin.php
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Compile Function Plugin
-*
-* Compiles code for the execution of function plugin
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Function Plugin Class
-*/
-class Smarty_Internal_Compile_Function_Plugin extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the execution of function plugin
- *
- * @param array $args array with attributes from parser
- * @param string $tag name of function
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler, $tag)
- {
- $this->compiler = $compiler;
- // This tag does create output
- $this->compiler->has_output = true;
-
- $this->required_attributes = array();
- $this->optional_attributes = array('_any');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
- // not cachable?
- if (isset($this->compiler->smarty->registered_plugins[$tag]) && !$this->compiler->smarty->registered_plugins[$tag][2]) {
- $this->compiler->tag_nocache = true;
- }
- // convert attributes into parameter array string
- $_paramsArray = array();
- foreach ($_attr as $_key => $_value) {
- if (is_int($_key)) {
- $_paramsArray[] = "$_key=>$_value";
- } else {
- $_paramsArray[] = "'$_key'=>$_value";
- }
- }
- $_params = 'array(' . implode(",", $_paramsArray) . ')';
- // compile code
- $output = '<?php echo $_smarty_tpl->smarty->plugin_handler->' . $tag . '(array(' . $_params . ',$_smarty_tpl->smarty,$_smarty_tpl),\'function\');?>';
-
- return $output;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_if.php b/includes/Smarty/sysplugins/smarty_internal_compile_if.php
deleted file mode 100644
index fd0f1d7..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_if.php
+++ /dev/null
@@ -1,114 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Compile If
-*
-* Compiles the {if} {else} {elseif} {/if} tags
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile If Class
-*/
-class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {if} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->required_attributes = array('if condition');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
- $this->_open_tag('if',array(1,$compiler->tag_nocache));
- if (is_array($args['if condition'])) {
- $_output = "<?php if (!isset(\$_smarty_tpl->tpl_vars[".$args['if condition']['var']."])) \$_smarty_tpl->tpl_vars[".$args['if condition']['var']."] = new Smarty_Variable;";
- $_output .= "if (\$_smarty_tpl->tpl_vars[".$args['if condition']['var']."]->value = ".$args['if condition']['value']."){?>";
- return $_output;
- } else {
- return '<?php if (' . $args['if condition'] . '){?>';
- }
- }
-}
-
-/**
-* Smarty Internal Plugin Compile Else Class
-*/
-class Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {else} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- list($nesting, $compiler->tag_nocache) = $this->_close_tag(array('if', 'elseif'));
- $this->_open_tag('else',array($nesting,$compiler->tag_nocache));
-
- return '<?php }else{ ?>';
- }
-}
-
-/**
-* Smarty Internal Plugin Compile ElseIf Class
-*/
-class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {elseif} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->required_attributes = array('if condition');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- list($nesting, $compiler->tag_nocache) = $this->_close_tag(array('if', 'elseif'));
-
- if (empty($this->compiler->prefix_code)) {
- $this->_open_tag('elseif', array($nesting, $compiler->tag_nocache));
- return '<?php }elseif(' . $args['if condition'] . '){?>';
- } else {
- $tmp = '';
- foreach ($this->compiler->prefix_code as $code) $tmp .= $code;
- $this->compiler->prefix_code = array();
- $this->_open_tag('elseif', array($nesting + 1, $compiler->tag_nocache));
- return '<?php }else{?>' . $tmp . '<?php if (' . $args['if condition'] . '){?>';
- }
- }
-}
-
-/**
-* Smarty Internal Plugin Compile Ifclose Class
-*/
-class Smarty_Internal_Compile_Ifclose extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {/if} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- list($nesting, $compiler->tag_nocache) = $this->_close_tag(array('if', 'else', 'elseif'));
- $tmp = '';
- for ($i = 0; $i < $nesting ; $i++) $tmp .= '}';
- return "<?php $tmp?>";
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_include.php b/includes/Smarty/sysplugins/smarty_internal_compile_include.php
deleted file mode 100644
index baa7340..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_include.php
+++ /dev/null
@@ -1,174 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Compile Include
-*
-* Compiles the {include} tag
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Include Class
-*/
-class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {include} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->required_attributes = array('file');
- $this->optional_attributes = array('_any');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
- // save posible attributes
- $include_file = $_attr['file'];
- $has_compiled_template = false;
- if ($compiler->smarty->merge_compiled_includes) {
- // check if compiled code can be merged (contains no variable part)
- if (!$compiler->has_variable_string && (substr_count($include_file, '"') == 2 or substr_count($include_file, "'") == 2) and substr_count($include_file, '(') == 0) {
- eval("\$tmp = $include_file;");
- if ($this->compiler->template->template_resource != $tmp) {
- $tpl = $compiler->smarty->createTemplate ($tmp, $compiler->template->cache_id, $compiler->template->compile_id, $compiler->template);
- if ($tpl->usesCompiler() && $tpl->isExisting()) {
- do {
- $must_compile = false;
- $prop = array();
- $compiled_tpl = $tpl->getCompiledTemplate();
- preg_match('/(\<\?php \$_smarty_tpl-\>decodeProperties\(\')(.*)(\'.*\?\>)/', $compiled_tpl, $matches);
- $compiled_tpl = preg_replace(array('/(\<\?php \$_smarty_tpl-\>decodeProperties\(\')(.*)(\'.*\?\>.*\n)/', '/(\<\?php if\(\!defined\(\'SMARTY_DIR\'\)\))(.*)(\?\>.*\n)/'), '', $compiled_tpl);
- // var_dump($matches, $compiled_tpl);
- if (isset($matches[2])) {
- $prop = unserialize($matches[2]);
- foreach ($prop['file_dependency'] as $_file_to_check) {
- If (is_file($_file_to_check[0])) {
- $mtime = filemtime($_file_to_check[0]);
- } else {
- $tpl->parseResourceName($_file_to_check[0], $resource_type, $resource_name, $resource_handler);
- if ($resource_type == 'file') {
- $must_compile = true; // subtemplate no longer existing
- break;
- }
- $mtime = $resource_handler->getTemplateTimestampTypeName($resource_type, $resource_name);
- }
-// If ($mtime != $_file_to_check[1]) {
- If ($mtime > $_file_to_check[1]) {
- $must_compile = true;
- break;
- }
- }
- if ($must_compile) {
- // recompile
- $tpl->compileTemplateSource();
- }
- }
- } while ($must_compile);
- if (isset($prop['file_dependency'])) {
- $compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $prop['file_dependency']);
- }
- if (isset($prop['function'])) {
- if (isset($compiler->template->properties['function'])) {
- $compiler->template->properties['function'] = array_merge((array)$compiler->template->properties['function'], $prop['function']);
- } else {
- $compiler->template->properties['function'] = $prop['function'];
- }
- }
- $has_compiled_template = true;
- }
- }
- }
- }
-
- if (isset($_attr['assign'])) {
- // output will be stored in a smarty variable instead of beind displayed
- $_assign = $_attr['assign'];
- }
-
- $_parent_scope = SMARTY_LOCAL_SCOPE;
- if (isset($_attr['scope'])) {
- if ($_attr['scope'] == '\'parent\'') {
- $_parent_scope = SMARTY_PARENT_SCOPE;
- } elseif ($_attr['scope'] == '\'root\'') {
- $_parent_scope = SMARTY_ROOT_SCOPE;
- } elseif ($_attr['scope'] == '\'global\'') {
- $_parent_scope = SMARTY_GLOBAL_SCOPE;
- }
- }
- // default for included templates
- if ($this->compiler->template->caching && !$this->compiler->nocache) {
- $_caching = 9999;
- } else {
- $_caching = SMARTY_CACHING_OFF;
- }
- /*
- * if the {include} tag provides individual parameter for caching
- * it will not be included into the common cache file and treated like
- * a nocache section
- */
- if (isset($_attr['cache_lifetime'])) {
- $_cache_lifetime = $_attr['cache_lifetime'];
- $this->compiler->tag_nocache = true;
- $_caching = SMARTY_CACHING_LIFETIME_CURRENT;
- }
- if (isset($_attr['nocache'])) {
- if ($_attr['nocache'] == 'true') {
- $this->compiler->tag_nocache = true;
- $_caching = SMARTY_CACHING_OFF;
- }
- }
- if (isset($_attr['caching'])) {
- if ($_attr['caching'] == 'true') {
- $_caching = SMARTY_CACHING_LIFETIME_CURRENT;
- } else {
- $this->compiler->tag_nocache = true;
- $_caching = SMARTY_CACHING_OFF;
- }
- }
- // create template object
- $_output = "<?php \$_template = new Smarty_Template ($include_file, \$_smarty_tpl->smarty, \$_smarty_tpl, \$_smarty_tpl->cache_id, \$_smarty_tpl->compile_id);";
- // delete {include} standard attributes
- unset($_attr['file'], $_attr['assign'], $_attr['cache_lifetime'], $_attr['nocache'], $_attr['caching'], $_attr['scope']);
- // remaining attributes must be assigned as smarty variable
- if (!empty($_attr)) {
- if ($_parent_scope == SMARTY_LOCAL_SCOPE) {
- // create variables
- foreach ($_attr as $_key => $_value) {
- $_output .= "\$_template->assign('$_key',$_value);";
- }
- } else {
- $this->compiler->trigger_template_error('variable passing not allowed in parent/global scope');
- }
- }
- // add caching parameter if required
- if (isset($_cache_lifetime)) {
- $_output .= "\$_template->cache_lifetime = $_cache_lifetime;";
- $_caching = SMARTY_CACHING_LIFETIME_CURRENT;
- }
- $_output .= "\$_template->caching = $_caching;";
- // was there an assign attribute
- if (isset($_assign)) {
- $_output .= "\$_smarty_tpl->assign($_assign,\$_template->getRenderedTemplate()); ?>";
- } else {
- if ($has_compiled_template && !($compiler->template->caching && ($this->compiler->tag_nocache || $this->compiler->nocache))) {
- $_output .= " \$_tpl_stack[] = \$_smarty_tpl; \$_smarty_tpl = \$_template;?>\n";
- $_output .= $compiled_tpl . "<?php /* End of included template \"" . $tpl->getTemplateFilepath() . "\" */ ?>";
- $_output .= "<?php \$_smarty_tpl = array_pop(\$_tpl_stack);?>";
- } else {
- $_output .= " echo \$_template->getRenderedTemplate(); ?>";
- }
- }
- if ($_parent_scope != SMARTY_LOCAL_SCOPE) {
- $_output .= "<?php \$_template->updateParentVariables($_parent_scope); ?>";
- }
- $_output .= "<?php unset(\$_template); ?>";
- return $_output;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_include_php.php b/includes/Smarty/sysplugins/smarty_internal_compile_include_php.php
deleted file mode 100644
index 96b3ebe..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_include_php.php
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Compile Include PHP
-*
-* Compiles the {include_php} tag
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Insert Class
-*/
-class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {include_php} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->required_attributes = array('file');
- $this->optional_attributes = array('once', 'assign');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- $_output = '<?php ';
-
- $_smarty_tpl = $compiler->template;
- eval('$_file = ' . $_attr['file'] . ';');
-
- $_file = realpath($_file);
-
- if ($this->compiler->smarty->security) {
- $this->compiler->smarty->security_handler->isTrustedPHPDir($_file);
- }
-
- if ($_file === false) {
- $this->compiler->trigger_template_error('include_php: file "' . $_attr['file'] . '" is not readable');
- }
-
- if ($this->compiler->smarty->security) {
- $this->compiler->smarty->security_handler->isTrustedPHPDir($_file);
- }
- if (isset($_attr['assign'])) {
- // output will be stored in a smarty variable instead of being displayed
- $_assign = $_attr['assign'];
- }
- $_once = '_once';
- if (isset($_attr['once'])) {
- if ($_attr['once'] == 'false') {
- $_once = '';
- }
- }
-
- $_output = '<?php ';
- if (isset($_assign)) {
- $_output .= 'ob_start(); include' . $_once . ' (\'' . $_file . '\'); $_smarty_tpl->assign(' . $_assign . ',ob_get_contents()); ob_end_clean();?>';
- } else {
- $_output .= 'include' . $_once . ' (\'' . $_file . '\');?>';
- }
- return $_output;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_insert.php b/includes/Smarty/sysplugins/smarty_internal_compile_insert.php
deleted file mode 100644
index 9e1da87..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_insert.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Compile Insert
-*
-* Compiles the {insert} tag
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Insert Class
-*/
-class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {insert} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->required_attributes = array('name');
- $this->optional_attributes = array('_any');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
- // this tag must not be cached
- $this->compiler->tag_nocache = true;
-
- $_output = '<?php ';
- // save posible attributes
- $_name = 'insert_' . trim($_attr['name'], "'\"");
- if (isset($_attr['assign'])) {
- // output will be stored in a smarty variable instead of beind displayed
- $_assign = $_attr['assign'];
- // create variable to make shure that the compiler knows about its nocache status
- $this->compiler->template->tpl_vars[trim($_attr['assign'], "'")] = new Smarty_Variable(null, true);
- }
- if (isset($_attr['script'])) {
- // script which must be included
- $_smarty_tpl = $compiler->template;
- eval('$_script = ' . $_attr['script'] . ';');
- if (!file_exists($_script)) {
- $this->compiler->trigger_template_error('missing file "' . $_script . '"');
- }
- // code for script file loading
- $_output .= 'require once ' . $_script . ';';
- } else {
- if (!is_callable($_name)) {
- $this->compiler->trigger_template_error('function "' . $_name . '" is not callable');
- }
- }
- // delete {insert} standard attributes
- unset($_attr['name'], $_attr['assign'], $_attr['script']);
- // convert attributes into parameter array string
- $_paramsArray = array();
- foreach ($_attr as $_key => $_value) {
- $_paramsArray[] = "'$_key'=>$_value";
- }
- $_params = 'array(' . implode(",", $_paramsArray) . ')';
- // call insert
- if (isset($_assign)) {
- $_output .= '$_smarty_tpl->assign(' . $_assign . ',' . $_name . '(' . $_params . '),true); ?>';
- } else {
- $this->compiler->has_output = true;
- $_output .= 'echo ' . $_name . '(' . $_params . '); ?>';
- }
- return $_output;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_ldelim.php b/includes/Smarty/sysplugins/smarty_internal_compile_ldelim.php
deleted file mode 100644
index c809990..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_ldelim.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Compile Ldelim
-*
-* Compiles the {ldelim} tag
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Ldelim Class
-*/
-class Smarty_Internal_Compile_Ldelim extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {ldelim} tag
- *
- * This tag does output the left delimiter
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $_attr = $this->_get_attributes($args);
- // this tag does not return compiled code
- $this->compiler->has_code = true;
- return $this->compiler->smarty->left_delimiter;
- }
-}
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_nocache.php b/includes/Smarty/sysplugins/smarty_internal_compile_nocache.php
deleted file mode 100644
index ebeef9d..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_nocache.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Compile Nocache
-*
-* Compiles the {nocache} {/nocache} tags
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Nocache Class
-*/
-class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {nocache} tag
- *
- * This tag does not generate compiled output. It only sets a compiler flag
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $_attr = $this->_get_attributes($args);
- // enter nocache mode
- $this->compiler->nocache = true;
- // this tag does not return compiled code
- $this->compiler->has_code = false;
- return true;
- }
-}
-
-/**
-* Smarty Internal Plugin Compile Nocacheclose Class
-*/
-class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {/nocache} tag
- *
- * This tag does not generate compiled output. It only sets a compiler flag
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $_attr = $this->_get_attributes($args);
- // leave nocache mode
- $this->compiler->nocache = false;
- // this tag does not return compiled code
- $this->compiler->has_code = false;
- return true;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_object_block_function.php b/includes/Smarty/sysplugins/smarty_internal_compile_object_block_function.php
deleted file mode 100644
index 75a1a7d..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_object_block_function.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Compile Object Block Function
-*
-* Compiles code for registered objects as block function
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Object Block Function Class
-*/
-class Smarty_Internal_Compile_Object_Block_Function extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the execution of block plugin
- *
- * @param array $args array with attributes from parser
- * @param string $tag name of block function
- * @param string $methode name of methode to call
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler, $tag, $methode)
- {
- $this->compiler = $compiler;
- if (strlen($tag) < 5 || substr_compare($tag, 'close', -5, 5) != 0) {
- // opening tag of block plugin
- $this->required_attributes = array();
- $this->optional_attributes = array('_any');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
- // convert attributes into parameter array string
- $_paramsArray = array();
- foreach ($_attr as $_key => $_value) {
- if (is_int($_key)) {
- $_paramsArray[] = "$_key=>$_value";
- } else {
- $_paramsArray[] = "'$_key'=>$_value";
- }
- }
- $_params = 'array(' . implode(",", $_paramsArray) . ')';
-
- $this->_open_tag($tag . '->' . $methode, $_params);
- // compile code
- $output = '<?php $_block_repeat=true; $_smarty_tpl->smarty->registered_objects[\'' . $tag . '\'][0]->' . $methode . '(' . $_params . ', null, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl);while ($_block_repeat) { ob_start();?>';
- } else {
- // closing tag of block plugin
- $_params = $this->_close_tag(substr($tag, 0, -5) . '->' . $methode);
- // This tag does create output
- $this->compiler->has_output = true;
- // compile code
- $output = '<?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false; echo $_smarty_tpl->smarty->registered_objects[\'' . substr($tag, 0, -5) . '\'][0]->' . $methode . '(' . $_params . ', $_block_content, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl); }?>';
- }
- return $output;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_object_function.php b/includes/Smarty/sysplugins/smarty_internal_compile_object_function.php
deleted file mode 100644
index e0962ca..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_object_function.php
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Compile Object Funtion
-*
-* Compiles code for registered objects as function
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Object Function Class
-*/
-class Smarty_Internal_Compile_Object_Function extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the execution of function plugin
- *
- * @param array $args array with attributes from parser
- * @param string $tag name of function
- * @param string $methode name of methode to call
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler, $tag, $methode)
- {
- $this->compiler = $compiler;
- // This tag does create output
- $this->compiler->has_output = true;
-
- $this->required_attributes = array();
- $this->optional_attributes = array('_any');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
- // convert attributes into parameter array string
- $_paramsArray = array();
- foreach ($_attr as $_key => $_value) {
- if (is_int($_key)) {
- $_paramsArray[] = "$_key=>$_value";
- } else {
- $_paramsArray[] = "'$_key'=>$_value";
- }
- }
- $_params = 'array(' . implode(",", $_paramsArray) . ')';
- // compile code
- $output = '<?php echo $_smarty_tpl->smarty->registered_objects[\''.$tag.'\'][0]->' . $methode . '(' . $_params . ',$_smarty_tpl->smarty,$_smarty_tpl);?>';
-
- return $output;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_print_expression.php b/includes/Smarty/sysplugins/smarty_internal_compile_print_expression.php
deleted file mode 100644
index 57ed85d..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_print_expression.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Compile Print Expression
-*
-* Compiles any tag which will output an expression or variable
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Print Expression Class
-*/
-class Smarty_Internal_Compile_Print_Expression extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for gererting output from any expression
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->required_attributes = array('value');
- $this->optional_attributes = array('assign', 'nocache', 'filter', 'nofilter');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- if (isset($_attr['nocache'])) {
- if ($_attr['nocache'] == 'true') {
- $this->compiler->tag_nocache = true;
- }
- }
-
- if (!isset($_attr['filter'])) {
- $_attr['filter'] = 'null';
- }
- if (isset($_attr['nofilter'])) {
- if ($_attr['nofilter'] == 'true') {
- $_attr['filter'] = 'false';
- }
- }
-
- if (isset($_attr['assign'])) {
- // assign output to variable
- $output = '<?php $_smarty_tpl->assign(' . $_attr['assign'] . ',' . $_attr['value'] . ');?>';
- } else {
- // display value
- $this->compiler->has_output = true;
- if (isset($this->compiler->smarty->registered_filters['variable'])) {
- $output = '<?php echo $this->smarty->filter_handler->execute(\'variable\', ' . $_attr['value'] . ',' . $_attr['filter'] . ');?>';
- } else {
- $output = '<?php echo ' . $_attr['value'] . ';?>';
- }
- }
- return $output;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_private_block_plugin.php b/includes/Smarty/sysplugins/smarty_internal_compile_private_block_plugin.php
new file mode 100755
index 0000000..5288f45
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_compile_private_block_plugin.php
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Block Plugin
+ *
+ * Compiles code for the execution of block plugin
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Block Plugin Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_CompileBase {
+
+ /**
+ * Attribute definition: Overwrites base class.
+ *
+ * @var array
+ * @see Smarty_Internal_CompileBase
+ */
+ public $optional_attributes = array('_any');
+
+ /**
+ * Compiles code for the execution of block plugin
+ *
+ * @param array $args array with attributes from parser
+ * @param object $compiler compiler object
+ * @param array $parameter array with compilation parameter
+ * @param string $tag name of block plugin
+ * @param string $function PHP function name
+ * @return string compiled code
+ */
+ public function compile($args, $compiler, $parameter, $tag, $function)
+ {
+ if (!isset($tag[5]) || substr($tag, -5) != 'close') {
+ // opening tag of block plugin
+ // check and get attributes
+ $_attr = $this->getAttributes($compiler, $args);
+ if ($_attr['nocache'] === true) {
+ $compiler->tag_nocache = true;
+ }
+ unset($_attr['nocache']);
+ // convert attributes into parameter array string
+ $_paramsArray = array();
+ foreach ($_attr as $_key => $_value) {
+ if (is_int($_key)) {
+ $_paramsArray[] = "$_key=>$_value";
+ } else {
+ $_paramsArray[] = "'$_key'=>$_value";
+ }
+ }
+ $_params = 'array(' . implode(",", $_paramsArray) . ')';
+
+ $this->openTag($compiler, $tag, array($_params, $compiler->nocache));
+ // maybe nocache because of nocache variables or nocache plugin
+ $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
+ // compile code
+ $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
+ } else {
+ // must endblock be nocache?
+ if ($compiler->nocache) {
+ $compiler->tag_nocache = true;
+ }
+ // closing tag of block plugin, restore nocache
+ list($_params, $compiler->nocache) = $this->closeTag($compiler, substr($tag, 0, -5));
+ // This tag does create output
+ $compiler->has_output = true;
+ // compile code
+ if (!isset($parameter['modifier_list'])) {
+ $mod_pre = $mod_post ='';
+ } else {
+ $mod_pre = ' ob_start(); ';
+ $mod_post = 'echo '.$compiler->compileTag('private_modifier',array(),array('modifierlist'=>$parameter['modifier_list'],'value'=>'ob_get_clean()')).';';
+ }
+ $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false;".$mod_pre." echo {$function}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); ".$mod_post." } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
+ }
+ return $output . "\n";
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_private_function_plugin.php b/includes/Smarty/sysplugins/smarty_internal_compile_private_function_plugin.php
new file mode 100755
index 0000000..70e7643
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_compile_private_function_plugin.php
@@ -0,0 +1,73 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Function Plugin
+ *
+ * Compiles code for the execution of function plugin
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Function Plugin Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_CompileBase {
+
+ /**
+ * Attribute definition: Overwrites base class.
+ *
+ * @var array
+ * @see Smarty_Internal_CompileBase
+ */
+ public $required_attributes = array();
+ /**
+ * Attribute definition: Overwrites base class.
+ *
+ * @var array
+ * @see Smarty_Internal_CompileBase
+ */
+ public $optional_attributes = array('_any');
+
+ /**
+ * Compiles code for the execution of function plugin
+ *
+ * @param array $args array with attributes from parser
+ * @param object $compiler compiler object
+ * @param array $parameter array with compilation parameter
+ * @param string $tag name of function plugin
+ * @param string $function PHP function name
+ * @return string compiled code
+ */
+ public function compile($args, $compiler, $parameter, $tag, $function)
+ {
+ // This tag does create output
+ $compiler->has_output = true;
+
+ // check and get attributes
+ $_attr = $this->getAttributes($compiler, $args);
+ if ($_attr['nocache'] === true) {
+ $compiler->tag_nocache = true;
+ }
+ unset($_attr['nocache']);
+ // convert attributes into parameter array string
+ $_paramsArray = array();
+ foreach ($_attr as $_key => $_value) {
+ if (is_int($_key)) {
+ $_paramsArray[] = "$_key=>$_value";
+ } else {
+ $_paramsArray[] = "'$_key'=>$_value";
+ }
+ }
+ $_params = 'array(' . implode(",", $_paramsArray) . ')';
+ // compile code
+ $output = "<?php echo {$function}({$_params},\$_smarty_tpl);?>\n";
+ return $output;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_private_modifier.php b/includes/Smarty/sysplugins/smarty_internal_compile_private_modifier.php
new file mode 100755
index 0000000..d9383a8
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_compile_private_modifier.php
@@ -0,0 +1,132 @@
+<?php
+
+/**
+ * Smarty Internal Plugin Compile Modifier
+ *
+ * Compiles code for modifier execution
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Modifier Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBase {
+
+ /**
+ * Compiles code for modifier execution
+ *
+ * @param array $args array with attributes from parser
+ * @param object $compiler compiler object
+ * @param array $parameter array with compilation parameter
+ * @return string compiled code
+ */
+ public function compile($args, $compiler, $parameter) {
+ // check and get attributes
+ $_attr = $this->getAttributes($compiler, $args);
+ $output = $parameter['value'];
+ // loop over list of modifiers
+ foreach ($parameter['modifierlist'] as $single_modifier) {
+ $modifier = $single_modifier[0];
+ $single_modifier[0] = $output;
+ $params = implode(',', $single_modifier);
+ // check if we know already the type of modifier
+ if (isset($compiler->known_modifier_type[$modifier])) {
+ $modifier_types = array($compiler->known_modifier_type[$modifier]);
+ } else {
+ $modifier_types = array(1, 2, 3, 4, 5, 6);
+ }
+ foreach ($modifier_types as $type) {
+ switch ($type) {
+ case 1:
+ // registered modifier
+ if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][$modifier])) {
+ $function = $compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][$modifier][0];
+ if (!is_array($function)) {
+ $output = "{$function}({$params})";
+ } else {
+ if (is_object($function[0])) {
+ $output = '$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][\'' . $modifier . '\'][0][0]->' . $function[1] . '(' . $params . ')';
+ } else {
+ $output = $function[0] . '::' . $function[1] . '(' . $params . ')';
+ }
+ }
+ $compiler->known_modifier_type[$modifier] = $type;
+ break 2;
+ }
+ break;
+ case 2:
+ // registered modifier compiler
+ if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIERCOMPILER][$modifier][0])) {
+ $output = call_user_func($compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIERCOMPILER][$modifier][0], $single_modifier, $compiler->smarty);
+ $compiler->known_modifier_type[$modifier] = $type;
+ break 2;
+ }
+ break;
+ case 3:
+ // modifiercompiler plugin
+ if ($compiler->smarty->loadPlugin('smarty_modifiercompiler_' . $modifier)) {
+ // check if modifier allowed
+ if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)) {
+ $plugin = 'smarty_modifiercompiler_' . $modifier;
+ $output = $plugin($single_modifier, $compiler);
+ }
+ $compiler->known_modifier_type[$modifier] = $type;
+ break 2;
+ }
+ break;
+ case 4:
+ // modifier plugin
+ if ($function = $compiler->getPlugin($modifier, Smarty::PLUGIN_MODIFIER)) {
+ // check if modifier allowed
+ if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)) {
+ $output = "{$function}({$params})";
+ }
+ $compiler->known_modifier_type[$modifier] = $type;
+ break 2;
+ }
+ break;
+ case 5:
+ // PHP function
+ if (is_callable($modifier)) {
+ // check if modifier allowed
+ if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedPhpModifier($modifier, $compiler)) {
+ $output = "{$modifier}({$params})";
+ }
+ $compiler->known_modifier_type[$modifier] = $type;
+ break 2;
+ }
+ break;
+ case 6:
+ // default plugin handler
+ if (isset($compiler->default_handler_plugins[Smarty::PLUGIN_MODIFIER][$modifier]) || (is_callable($compiler->smarty->default_plugin_handler_func) && $compiler->getPluginFromDefaultHandler($modifier, Smarty::PLUGIN_MODIFIER))) {
+ $function = $compiler->default_handler_plugins[Smarty::PLUGIN_MODIFIER][$modifier][0];
+ // check if modifier allowed
+ if (!is_object($compiler->smarty->security_policy) || $compiler->smarty->security_policy->isTrustedModifier($modifier, $compiler)) {
+ $output = "{$function}({$params})";
+ }
+ if (isset($compiler->template->required_plugins['nocache'][$modifier][Smarty::PLUGIN_MODIFIER]['file']) || isset($compiler->template->required_plugins['compiled'][$modifier][Smarty::PLUGIN_MODIFIER]['file'])) {
+ // was a plugin
+ $compiler->known_modifier_type[$modifier] = 4;
+ } else {
+ $compiler->known_modifier_type[$modifier] = $type;
+ }
+ break 2;
+ }
+ }
+ }
+ if (!isset($compiler->known_modifier_type[$modifier])) {
+ $compiler->trigger_template_error("unknown modifier \"" . $modifier . "\"", $compiler->lex->taglineno);
+ }
+ }
+ return $output;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_private_object_block_function.php b/includes/Smarty/sysplugins/smarty_internal_compile_private_object_block_function.php
new file mode 100755
index 0000000..cca924d
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_compile_private_object_block_function.php
@@ -0,0 +1,88 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Object Block Function
+ *
+ * Compiles code for registered objects as block function
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Object Block Function Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Internal_CompileBase {
+
+ /**
+ * Attribute definition: Overwrites base class.
+ *
+ * @var array
+ * @see Smarty_Internal_CompileBase
+ */
+ public $optional_attributes = array('_any');
+
+ /**
+ * Compiles code for the execution of block plugin
+ *
+ * @param array $args array with attributes from parser
+ * @param object $compiler compiler object
+ * @param array $parameter array with compilation parameter
+ * @param string $tag name of block object
+ * @param string $method name of method to call
+ * @return string compiled code
+ */
+ public function compile($args, $compiler, $parameter, $tag, $method)
+ {
+ if (!isset($tag[5]) || substr($tag, -5) != 'close') {
+ // opening tag of block plugin
+ // check and get attributes
+ $_attr = $this->getAttributes($compiler, $args);
+ if ($_attr['nocache'] === true) {
+ $compiler->tag_nocache = true;
+ }
+ unset($_attr['nocache']);
+ // convert attributes into parameter array string
+ $_paramsArray = array();
+ foreach ($_attr as $_key => $_value) {
+ if (is_int($_key)) {
+ $_paramsArray[] = "$_key=>$_value";
+ } else {
+ $_paramsArray[] = "'$_key'=>$_value";
+ }
+ }
+ $_params = 'array(' . implode(",", $_paramsArray) . ')';
+
+ $this->openTag($compiler, $tag . '->' . $method, array($_params, $compiler->nocache));
+ // maybe nocache because of nocache variables or nocache plugin
+ $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
+ // compile code
+ $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}->{$method}', {$_params}); \$_block_repeat=true; echo \$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
+ } else {
+ $base_tag = substr($tag, 0, -5);
+ // must endblock be nocache?
+ if ($compiler->nocache) {
+ $compiler->tag_nocache = true;
+ }
+ // closing tag of block plugin, restore nocache
+ list($_params, $compiler->nocache) = $this->closeTag($compiler, $base_tag . '->' . $method);
+ // This tag does create output
+ $compiler->has_output = true;
+ // compile code
+ if (!isset($parameter['modifier_list'])) {
+ $mod_pre = $mod_post = '';
+ } else {
+ $mod_pre = ' ob_start(); ';
+ $mod_post = 'echo ' . $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifier_list'], 'value' => 'ob_get_clean()')) . ';';
+ }
+ $output = "<?php \$_block_content = ob_get_contents(); ob_end_clean(); \$_block_repeat=false;" . $mod_pre . " echo \$_smarty_tpl->smarty->registered_objects['{$base_tag}'][0]->{$method}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); " . $mod_post . " } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
+ }
+ return $output . "\n";
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_private_object_function.php b/includes/Smarty/sysplugins/smarty_internal_compile_private_object_function.php
new file mode 100755
index 0000000..f649084
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_compile_private_object_function.php
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Object Funtion
+ *
+ * Compiles code for registered objects as function
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Object Function Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_CompileBase {
+
+ /**
+ * Attribute definition: Overwrites base class.
+ *
+ * @var array
+ * @see Smarty_Internal_CompileBase
+ */
+ public $optional_attributes = array('_any');
+
+ /**
+ * Compiles code for the execution of function plugin
+ *
+ * @param array $args array with attributes from parser
+ * @param object $compiler compiler object
+ * @param array $parameter array with compilation parameter
+ * @param string $tag name of function
+ * @param string $method name of method to call
+ * @return string compiled code
+ */
+ public function compile($args, $compiler, $parameter, $tag, $method)
+ {
+ // check and get attributes
+ $_attr = $this->getAttributes($compiler, $args);
+ if ($_attr['nocache'] === true) {
+ $compiler->tag_nocache = true;
+ }
+ unset($_attr['nocache']);
+ $_assign = null;
+ if (isset($_attr['assign'])) {
+ $_assign = $_attr['assign'];
+ unset($_attr['assign']);
+ }
+ // convert attributes into parameter array string
+ if ($compiler->smarty->registered_objects[$tag][2]) {
+ $_paramsArray = array();
+ foreach ($_attr as $_key => $_value) {
+ if (is_int($_key)) {
+ $_paramsArray[] = "$_key=>$_value";
+ } else {
+ $_paramsArray[] = "'$_key'=>$_value";
+ }
+ }
+ $_params = 'array(' . implode(",", $_paramsArray) . ')';
+ $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params},\$_smarty_tpl)";
+ } else {
+ $_params = implode(",", $_attr);
+ $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params})";
+ }
+ if (empty($_assign)) {
+ // This tag does create output
+ $compiler->has_output = true;
+ $output = "<?php echo {$return};?>\n";
+ } else {
+ $output = "<?php \$_smarty_tpl->assign({$_assign},{$return});?>\n";
+ }
+ return $output;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_private_print_expression.php b/includes/Smarty/sysplugins/smarty_internal_compile_private_print_expression.php
new file mode 100755
index 0000000..a371195
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_compile_private_print_expression.php
@@ -0,0 +1,156 @@
+<?php
+/**
+* Smarty Internal Plugin Compile Print Expression
+*
+* Compiles any tag which will output an expression or variable
+*
+* @package Smarty
+* @subpackage Compiler
+* @author Uwe Tews
+*/
+
+/**
+* Smarty Internal Plugin Compile Print Expression Class
+*
+* @package Smarty
+* @subpackage Compiler
+*/
+class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_CompileBase {
+
+ /**
+ * Attribute definition: Overwrites base class.
+ *
+ * @var array
+ * @see Smarty_Internal_CompileBase
+ */
+ public $optional_attributes = array('assign');
+ /**
+ * Attribute definition: Overwrites base class.
+ *
+ * @var array
+ * @see Smarty_Internal_CompileBase
+ */
+ public $option_flags = array('nocache', 'nofilter');
+
+ /**
+ * Compiles code for gererting output from any expression
+ *
+ * @param array $args array with attributes from parser
+ * @param object $compiler compiler object
+ * @param array $parameter array with compilation parameter
+ * @return string compiled code
+ */
+ public function compile($args, $compiler, $parameter)
+ {
+ // check and get attributes
+ $_attr = $this->getAttributes($compiler, $args);
+ // nocache option
+ if ($_attr['nocache'] === true) {
+ $compiler->tag_nocache = true;
+ }
+ // filter handling
+ if ($_attr['nofilter'] === true) {
+ $_filter = 'false';
+ } else {
+ $_filter = 'true';
+ }
+ if (isset($_attr['assign'])) {
+ // assign output to variable
+ $output = "<?php \$_smarty_tpl->assign({$_attr['assign']},{$parameter['value']});?>";
+ } else {
+ // display value
+ $output = $parameter['value'];
+ // tag modifier
+ if (!empty($parameter['modifierlist'])) {
+ $output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifierlist'], 'value' => $output));
+ }
+ if (!$_attr['nofilter']) {
+ // default modifier
+ if (!empty($compiler->smarty->default_modifiers)) {
+ if (empty($compiler->default_modifier_list)) {
+ $modifierlist = array();
+ foreach ($compiler->smarty->default_modifiers as $key => $single_default_modifier) {
+ preg_match_all('/(\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'|"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|:|[^:]+)/', $single_default_modifier, $mod_array);
+ for ($i = 0, $count = count($mod_array[0]);$i < $count;$i++) {
+ if ($mod_array[0][$i] != ':') {
+ $modifierlist[$key][] = $mod_array[0][$i];
+ }
+ }
+ }
+ $compiler->default_modifier_list = $modifierlist;
+ }
+ $output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => $compiler->default_modifier_list, 'value' => $output));
+ }
+ // autoescape html
+ if ($compiler->template->smarty->escape_html) {
+ $output = "htmlspecialchars({$output}, ENT_QUOTES, '" . addslashes(Smarty::$_CHARSET) . "')";
+ }
+ // loop over registerd filters
+ if (!empty($compiler->template->smarty->registered_filters[Smarty::FILTER_VARIABLE])) {
+ foreach ($compiler->template->smarty->registered_filters[Smarty::FILTER_VARIABLE] as $key => $function) {
+ if (!is_array($function)) {
+ $output = "{$function}({$output},\$_smarty_tpl)";
+ } else if (is_object($function[0])) {
+ $output = "\$_smarty_tpl->smarty->registered_filters[Smarty::FILTER_VARIABLE][{$key}][0]->{$function[1]}({$output},\$_smarty_tpl)";
+ } else {
+ $output = "{$function[0]}::{$function[1]}({$output},\$_smarty_tpl)";
+ }
+ }
+ }
+ // auto loaded filters
+ if (isset($compiler->smarty->autoload_filters[Smarty::FILTER_VARIABLE])) {
+ foreach ((array)$compiler->template->smarty->autoload_filters[Smarty::FILTER_VARIABLE] as $name) {
+ $result = $this->compile_output_filter($compiler, $name, $output);
+ if ($result !== false) {
+ $output = $result;
+ } else {
+ // not found, throw exception
+ throw new SmartyException("Unable to load filter '{$name}'");
+ }
+ }
+ }
+ if (isset($compiler->template->variable_filters)) {
+ foreach ($compiler->template->variable_filters as $filter) {
+ if (count($filter) == 1 && ($result = $this->compile_output_filter($compiler, $filter[0], $output)) !== false) {
+ $output = $result;
+ } else {
+ $output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => array($filter), 'value' => $output));
+ }
+ }
+ }
+ }
+
+ $compiler->has_output = true;
+ $output = "<?php echo {$output};?>";
+ }
+ return $output;
+ }
+
+ /**
+ * @param object $compiler compiler object
+ * @param string $name name of variable filter
+ * @param type $output embedded output
+ * @return string
+ */
+ private function compile_output_filter($compiler, $name, $output)
+ {
+ $plugin_name = "smarty_variablefilter_{$name}";
+ $path = $compiler->smarty->loadPlugin($plugin_name, false);
+ if ($path) {
+ if ($compiler->template->caching) {
+ $compiler->template->required_plugins['nocache'][$name][Smarty::FILTER_VARIABLE]['file'] = $path;
+ $compiler->template->required_plugins['nocache'][$name][Smarty::FILTER_VARIABLE]['function'] = $plugin_name;
+ } else {
+ $compiler->template->required_plugins['compiled'][$name][Smarty::FILTER_VARIABLE]['file'] = $path;
+ $compiler->template->required_plugins['compiled'][$name][Smarty::FILTER_VARIABLE]['function'] = $plugin_name;
+ }
+ } else {
+ // not found
+ return false;
+ }
+ return "{$plugin_name}({$output},\$_smarty_tpl)";
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_private_registered_block.php b/includes/Smarty/sysplugins/smarty_internal_compile_private_registered_block.php
new file mode 100755
index 0000000..9fed36c
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_compile_private_registered_block.php
@@ -0,0 +1,113 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Registered Block
+ *
+ * Compiles code for the execution of a registered block function
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Registered Block Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_CompileBase {
+
+ /**
+ * Attribute definition: Overwrites base class.
+ *
+ * @var array
+ * @see Smarty_Internal_CompileBase
+ */
+ public $optional_attributes = array('_any');
+
+ /**
+ * Compiles code for the execution of a block function
+ *
+ * @param array $args array with attributes from parser
+ * @param object $compiler compiler object
+ * @param array $parameter array with compilation parameter
+ * @param string $tag name of block function
+ * @return string compiled code
+ */
+ public function compile($args, $compiler, $parameter, $tag)
+ {
+ if (!isset($tag[5]) || substr($tag,-5) != 'close') {
+ // opening tag of block plugin
+ // check and get attributes
+ $_attr = $this->getAttributes($compiler, $args);
+ if ($_attr['nocache']) {
+ $compiler->tag_nocache = true;
+ }
+ unset($_attr['nocache']);
+ if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$tag])) {
+ $tag_info = $compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$tag];
+ } else {
+ $tag_info = $compiler->default_handler_plugins[Smarty::PLUGIN_BLOCK][$tag];
+ }
+ // convert attributes into parameter array string
+ $_paramsArray = array();
+ foreach ($_attr as $_key => $_value) {
+ if (is_int($_key)) {
+ $_paramsArray[] = "$_key=>$_value";
+ } elseif ($compiler->template->caching && in_array($_key,$tag_info[2])) {
+ $_value = str_replace("'","^#^",$_value);
+ $_paramsArray[] = "'$_key'=>^#^.var_export($_value,true).^#^";
+ } else {
+ $_paramsArray[] = "'$_key'=>$_value";
+ }
+ }
+ $_params = 'array(' . implode(",", $_paramsArray) . ')';
+
+ $this->openTag($compiler, $tag, array($_params, $compiler->nocache));
+ // maybe nocache because of nocache variables or nocache plugin
+ $compiler->nocache = !$tag_info[1] | $compiler->nocache | $compiler->tag_nocache;
+ $function = $tag_info[0];
+ // compile code
+ if (!is_array($function)) {
+ $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
+ } else if (is_object($function[0])) {
+ $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo \$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0][0]->{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
+ } else {
+ $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function[0]}::{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
+ }
+ } else {
+ // must endblock be nocache?
+ if ($compiler->nocache) {
+ $compiler->tag_nocache = true;
+ }
+ $base_tag = substr($tag, 0, -5);
+ // closing tag of block plugin, restore nocache
+ list($_params, $compiler->nocache) = $this->closeTag($compiler, $base_tag);
+ // This tag does create output
+ $compiler->has_output = true;
+ if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$base_tag])) {
+ $function = $compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$base_tag][0];
+ } else {
+ $function = $compiler->default_handler_plugins[Smarty::PLUGIN_BLOCK][$base_tag][0];
+ }
+ // compile code
+ if (!isset($parameter['modifier_list'])) {
+ $mod_pre = $mod_post ='';
+ } else {
+ $mod_pre = ' ob_start(); ';
+ $mod_post = 'echo '.$compiler->compileTag('private_modifier',array(),array('modifierlist'=>$parameter['modifier_list'],'value'=>'ob_get_clean()')).';';
+ }
+ if (!is_array($function)) {
+ $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false;".$mod_pre." echo {$function}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat);".$mod_post." } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
+ } else if (is_object($function[0])) {
+ $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false;".$mod_pre." echo \$_smarty_tpl->smarty->registered_plugins['block']['{$base_tag}'][0][0]->{$function[1]}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); ".$mod_post."} array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
+ } else {
+ $output = "<?php \$_block_content = ob_get_clean(); \$_block_repeat=false;".$mod_pre." echo {$function[0]}::{$function[1]}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); ".$mod_post."} array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
+ }
+ }
+ return $output . "\n";
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_private_registered_function.php b/includes/Smarty/sysplugins/smarty_internal_compile_private_registered_function.php
new file mode 100755
index 0000000..5058bfb
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_compile_private_registered_function.php
@@ -0,0 +1,81 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Registered Function
+ *
+ * Compiles code for the execution of a registered function
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Registered Function Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Internal_CompileBase {
+
+ /**
+ * Attribute definition: Overwrites base class.
+ *
+ * @var array
+ * @see Smarty_Internal_CompileBase
+ */
+ public $optional_attributes = array('_any');
+
+ /**
+ * Compiles code for the execution of a registered function
+ *
+ * @param array $args array with attributes from parser
+ * @param object $compiler compiler object
+ * @param array $parameter array with compilation parameter
+ * @param string $tag name of function
+ * @return string compiled code
+ */
+ public function compile($args, $compiler, $parameter, $tag)
+ {
+ // This tag does create output
+ $compiler->has_output = true;
+ // check and get attributes
+ $_attr = $this->getAttributes($compiler, $args);
+ if ($_attr['nocache']) {
+ $compiler->tag_nocache = true;
+ }
+ unset($_attr['nocache']);
+ if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION][$tag])) {
+ $tag_info = $compiler->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION][$tag];
+ } else {
+ $tag_info = $compiler->default_handler_plugins[Smarty::PLUGIN_FUNCTION][$tag];
+ }
+ // not cachable?
+ $compiler->tag_nocache = $compiler->tag_nocache || !$tag_info[1];
+ // convert attributes into parameter array string
+ $_paramsArray = array();
+ foreach ($_attr as $_key => $_value) {
+ if (is_int($_key)) {
+ $_paramsArray[] = "$_key=>$_value";
+ } elseif ($compiler->template->caching && in_array($_key,$tag_info[2])) {
+ $_value = str_replace("'","^#^",$_value);
+ $_paramsArray[] = "'$_key'=>^#^.var_export($_value,true).^#^";
+ } else {
+ $_paramsArray[] = "'$_key'=>$_value";
+ }
+ }
+ $_params = 'array(' . implode(",", $_paramsArray) . ')';
+ $function = $tag_info[0];
+ // compile code
+ if (!is_array($function)) {
+ $output = "<?php echo {$function}({$_params},\$_smarty_tpl);?>\n";
+ } else if (is_object($function[0])) {
+ $output = "<?php echo \$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['{$tag}'][0][0]->{$function[1]}({$_params},\$_smarty_tpl);?>\n";
+ } else {
+ $output = "<?php echo {$function[0]}::{$function[1]}({$_params},\$_smarty_tpl);?>\n";
+ }
+ return $output;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_private_special_variable.php b/includes/Smarty/sysplugins/smarty_internal_compile_private_special_variable.php
new file mode 100755
index 0000000..4760dbe
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_compile_private_special_variable.php
@@ -0,0 +1,107 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Special Smarty Variable
+ *
+ * Compiles the special $smarty variables
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile special Smarty Variable Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_CompileBase {
+
+ /**
+ * Compiles code for the speical $smarty variables
+ *
+ * @param array $args array with attributes from parser
+ * @param object $compiler compiler object
+ * @return string compiled code
+ */
+ public function compile($args, $compiler, $parameter)
+ {
+ $_index = preg_split("/\]\[/",substr($parameter, 1, strlen($parameter)-2));
+ $compiled_ref = ' ';
+ $variable = trim($_index[0], "'");
+ switch ($variable) {
+ case 'foreach':
+ return "\$_smarty_tpl->getVariable('smarty')->value$parameter";
+ case 'section':
+ return "\$_smarty_tpl->getVariable('smarty')->value$parameter";
+ case 'capture':
+ return "Smarty::\$_smarty_vars$parameter";
+ case 'now':
+ return 'time()';
+ case 'cookies':
+ if (isset($compiler->smarty->security_policy) && !$compiler->smarty->security_policy->allow_super_globals) {
+ $compiler->trigger_template_error("(secure mode) super globals not permitted");
+ break;
+ }
+ $compiled_ref = '$_COOKIE';
+ break;
+
+ case 'get':
+ case 'post':
+ case 'env':
+ case 'server':
+ case 'session':
+ case 'request':
+ if (isset($compiler->smarty->security_policy) && !$compiler->smarty->security_policy->allow_super_globals) {
+ $compiler->trigger_template_error("(secure mode) super globals not permitted");
+ break;
+ }
+ $compiled_ref = '$_'.strtoupper($variable);
+ break;
+
+ case 'template':
+ return 'basename($_smarty_tpl->source->filepath)';
+
+ case 'template_object':
+ return '$_smarty_tpl';
+
+ case 'current_dir':
+ return 'dirname($_smarty_tpl->source->filepath)';
+
+ case 'version':
+ $_version = Smarty::SMARTY_VERSION;
+ return "'$_version'";
+
+ case 'const':
+ if (isset($compiler->smarty->security_policy) && !$compiler->smarty->security_policy->allow_constants) {
+ $compiler->trigger_template_error("(secure mode) constants not permitted");
+ break;
+ }
+ return '@' . trim($_index[1], "'");
+
+ case 'config':
+ return "\$_smarty_tpl->getConfigVariable($_index[1])";
+ case 'ldelim':
+ $_ldelim = $compiler->smarty->left_delimiter;
+ return "'$_ldelim'";
+
+ case 'rdelim':
+ $_rdelim = $compiler->smarty->right_delimiter;
+ return "'$_rdelim'";
+
+ default:
+ $compiler->trigger_template_error('$smarty.' . trim($_index[0], "'") . ' is invalid');
+ break;
+ }
+ if (isset($_index[1])) {
+ array_shift($_index);
+ foreach ($_index as $_ind) {
+ $compiled_ref = $compiled_ref . "[$_ind]";
+ }
+ }
+ return $compiled_ref;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_rdelim.php b/includes/Smarty/sysplugins/smarty_internal_compile_rdelim.php
deleted file mode 100644
index 88c4e1e..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_rdelim.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Compile Rdelim
-*
-* Compiles the {rdelim} tag
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Rdelim Class
-*/
-class Smarty_Internal_Compile_Rdelim extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {rdelim} tag
- *
- * This tag does output the right delimiter
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $_attr = $this->_get_attributes($args);
- // this tag does not return compiled code
- $this->compiler->has_code = true;
- return $this->compiler->smarty->right_delimiter;
- }
-}
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_section.php b/includes/Smarty/sysplugins/smarty_internal_compile_section.php
deleted file mode 100644
index 0de506a..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_section.php
+++ /dev/null
@@ -1,170 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Compile Section
-*
-* Compiles the {section} {sectionelse} {/section} tags
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Section Class
-*/
-class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {section} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->required_attributes = array('name', 'loop');
- $this->optional_attributes = array('start', 'step', 'max', 'show');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- $this->_open_tag('section', array('section',$this->compiler->nocache));
- // maybe nocache because of nocache variables
- $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
-
- $output = "<?php ";
-
- $section_name = $_attr['name'];
-
- $output .= "unset(\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name]);\n";
- $section_props = "\$_smarty_tpl->tpl_vars['smarty']->value['section'][$section_name]";
-
- foreach ($_attr as $attr_name => $attr_value) {
- switch ($attr_name) {
- case 'loop':
- $output .= "{$section_props}['loop'] = is_array(\$_loop=$attr_value) ? count(\$_loop) : max(0, (int)\$_loop); unset(\$_loop);\n";
- break;
-
- case 'show':
- if (is_bool($attr_value))
- $show_attr_value = $attr_value ? 'true' : 'false';
- else
- $show_attr_value = "(bool)$attr_value";
- $output .= "{$section_props}['show'] = $show_attr_value;\n";
- break;
-
- case 'name':
- $output .= "{$section_props}['$attr_name'] = $attr_value;\n";
- break;
-
- case 'max':
- case 'start':
- $output .= "{$section_props}['$attr_name'] = (int)$attr_value;\n";
- break;
-
- case 'step':
- $output .= "{$section_props}['$attr_name'] = ((int)$attr_value) == 0 ? 1 : (int)$attr_value;\n";
- break;
- }
- }
-
- if (!isset($_attr['show']))
- $output .= "{$section_props}['show'] = true;\n";
-
- if (!isset($_attr['loop']))
- $output .= "{$section_props}['loop'] = 1;\n";
-
- if (!isset($_attr['max']))
- $output .= "{$section_props}['max'] = {$section_props}['loop'];\n";
- else
- $output .= "if ({$section_props}['max'] < 0)\n" . " {$section_props}['max'] = {$section_props}['loop'];\n";
-
- if (!isset($_attr['step']))
- $output .= "{$section_props}['step'] = 1;\n";
-
- if (!isset($_attr['start']))
- $output .= "{$section_props}['start'] = {$section_props}['step'] > 0 ? 0 : {$section_props}['loop']-1;\n";
- else {
- $output .= "if ({$section_props}['start'] < 0)\n" . " {$section_props}['start'] = max({$section_props}['step'] > 0 ? 0 : -1, {$section_props}['loop'] + {$section_props}['start']);\n" . "else\n" . " {$section_props}['start'] = min({$section_props}['start'], {$section_props}['step'] > 0 ? {$section_props}['loop'] : {$section_props}['loop']-1);\n";
- }
-
- $output .= "if ({$section_props}['show']) {\n";
- if (!isset($_attr['start']) && !isset($_attr['step']) && !isset($_attr['max'])) {
- $output .= " {$section_props}['total'] = {$section_props}['loop'];\n";
- } else {
- $output .= " {$section_props}['total'] = min(ceil(({$section_props}['step'] > 0 ? {$section_props}['loop'] - {$section_props}['start'] : {$section_props}['start']+1)/abs({$section_props}['step'])), {$section_props}['max']);\n";
- }
- $output .= " if ({$section_props}['total'] == 0)\n" . " {$section_props}['show'] = false;\n" . "} else\n" . " {$section_props}['total'] = 0;\n";
-
- $output .= "if ({$section_props}['show']):\n";
- $output .= "
- for ({$section_props}['index'] = {$section_props}['start'], {$section_props}['iteration'] = 1;
- {$section_props}['iteration'] <= {$section_props}['total'];
- {$section_props}['index'] += {$section_props}['step'], {$section_props}['iteration']++):\n";
- $output .= "{$section_props}['rownum'] = {$section_props}['iteration'];\n";
- $output .= "{$section_props}['index_prev'] = {$section_props}['index'] - {$section_props}['step'];\n";
- $output .= "{$section_props}['index_next'] = {$section_props}['index'] + {$section_props}['step'];\n";
- $output .= "{$section_props}['first'] = ({$section_props}['iteration'] == 1);\n";
- $output .= "{$section_props}['last'] = ({$section_props}['iteration'] == {$section_props}['total']);\n";
-
- $output .= "?>";
- return $output;
- }
-}
-
-/**
-* Smarty Internal Plugin Compile Sectionelse Class
-*/
-class Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {sectionelse} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- list($_open_tag, $nocache) = $this->_close_tag(array('section'));
- $this->_open_tag('sectionelse',array('sectionelse', $nocache));
-
- return "<?php endfor; else: ?>";
- }
-}
-
-/**
-* Smarty Internal Plugin Compile Sectionclose Class
-*/
-class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {/section} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- // must endblock be nocache?
- if ($this->compiler->nocache) {
- $this->compiler->tag_nocache = true;
- }
-
- list($_open_tag, $this->compiler->nocache) = $this->_close_tag(array('section', 'sectionelse'));
-
- if ($_open_tag == 'sectionelse')
- return "<?php endif; ?>";
- else
- return "<?php endfor; endif; ?>";
- }
-}
-
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_setfilter.php b/includes/Smarty/sysplugins/smarty_internal_compile_setfilter.php
new file mode 100755
index 0000000..d1dd90c
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_compile_setfilter.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Smarty Internal Plugin Compile Setfilter
+ *
+ * Compiles code for setfilter tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Setfilter Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Setfilter extends Smarty_Internal_CompileBase {
+
+ /**
+ * Compiles code for setfilter tag
+ *
+ * @param array $args array with attributes from parser
+ * @param object $compiler compiler object
+ * @param array $parameter array with compilation parameter
+ * @return string compiled code
+ */
+ public function compile($args, $compiler, $parameter)
+ {
+ $compiler->variable_filter_stack[] = $compiler->template->variable_filters;
+ $compiler->template->variable_filters = $parameter['modifier_list'];
+ // this tag does not return compiled code
+ $compiler->has_code = false;
+ return true;
+ }
+
+}
+
+/**
+ * Smarty Internal Plugin Compile Setfilterclose Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Compile_Setfilterclose extends Smarty_Internal_CompileBase {
+
+ /**
+ * Compiles code for the {/setfilter} tag
+ *
+ * This tag does not generate compiled output. It resets variable filter.
+ *
+ * @param array $args array with attributes from parser
+ * @param object $compiler compiler object
+ * @return string compiled code
+ */
+ public function compile($args, $compiler)
+ {
+ $_attr = $this->getAttributes($compiler, $args);
+ // reset variable filter to previous state
+ if (count($compiler->variable_filter_stack)) {
+ $compiler->template->variable_filters = array_pop($compiler->variable_filter_stack);
+ } else {
+ $compiler->template->variable_filters = array();
+ }
+ // this tag does not return compiled code
+ $compiler->has_code = false;
+ return true;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_special_smarty_variable.php b/includes/Smarty/sysplugins/smarty_internal_compile_special_smarty_variable.php
deleted file mode 100644
index 3b05323..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_special_smarty_variable.php
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Compile Special Smarty Variable
-*
-* Compiles the special $smarty variables
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile special Smarty Variable Class
-*/
-class Smarty_Internal_Compile_Special_Smarty_Variable extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the speical $smarty variables
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $_index = explode(',', str_replace(array(']['), array(','), substr($args,1,strlen($args)-2)));
- $compiled_ref = ' ';
- switch (trim($_index[0], "'")) {
- case 'foreach':
- return "\$_smarty_tpl->getVariable('smarty')->value$args";
- case 'section':
- return "\$_smarty_tpl->getVariable('smarty')->value$args";
- case 'capture':
- return "\$_smarty_tpl->smarty->_smarty_vars$args";
- case 'now':
- return 'time()';
-
- case 'get':
- $compiled_ref = "\$_GET";
- break;
-
- case 'post':
- $compiled_ref = "\$_POST";
- break;
-
- case 'cookies':
- $compiled_ref = "\$_COOKIE";
- break;
-
- case 'env':
- $compiled_ref = "\$_ENV";
- break;
-
- case 'server':
- $compiled_ref = "\$_SERVER";
- break;
-
- case 'session':
- $compiled_ref = "\$_SESSION";
- break;
-
- case 'request':
- $compiled_ref = "\$_REQUEST";
- break;
-
- case 'template':
- $_template_name = basename($compiler->template->getTemplateFilepath());
- return "'$_template_name'";
-
- case 'current_dir':
- $_template_dir_name = dirname($compiler->template->getTemplateFilepath());
- return "'$_template_dir_name'";
-
- case 'version':
- $_version = Smarty::$_version;
- return "'$_version'";
-
- case 'const':
- if ($compiler->smarty->security && !$compiler->smarty->security_policy->allow_constants) {
- $compiler->trigger_template_error("(secure mode) constants not permitted");
- break;
- }
- return '@' . trim($_index[1], "'");
-
- case 'config':
- return "\$_smarty_tpl->getConfigVariable($_index[1])";
- case 'ldelim':
- $_ldelim = $compiler->smarty->left_delimiter;
- return "'$_ldelim'";
-
- case 'rdelim':
- $_rdelim = $compiler->smarty->right_delimiter;
- return "'$_rdelim'";
-
- default:
- $compiler->trigger_template_error('$smarty.' . trim($_index[0], "'") . ' is an unknown reference');
- break;
- }
- if (isset($_index[1])) {
- array_shift($_index);
- foreach ($_index as $_ind) {
- $compiled_ref = $compiled_ref . "[$_ind]";
- }
- }
- return $compiled_ref;
- }
-}
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_strip.php b/includes/Smarty/sysplugins/smarty_internal_compile_strip.php
deleted file mode 100644
index a6b2a6f..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_strip.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Compile Strip
-*
-* Compiles the {strip} {/strip} tags
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Strip Class
-*/
-class Smarty_Internal_Compile_Strip extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {strip} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- $this->_open_tag('strip');
-
- $_output = "<?php ob_start(); ?>";
-
- return $_output;
- }
-}
-
-/**
-* Smarty Internal Plugin Compile Stripclose Class
-*/
-class Smarty_Internal_Compile_Stripclose extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {/strip} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- // check and get attributes
- $_attr = $this->_get_attributes($args);
-
- $saved_attr = $this->_close_tag(array('strip'));
-
- $_output = "<?php echo preg_replace('![\t ]*[\r\n]+[\t ]*!', '', ob_get_clean()); ?>\n";
- return $_output;
- }
-}
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compile_while.php b/includes/Smarty/sysplugins/smarty_internal_compile_while.php
deleted file mode 100644
index 6dc1804..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compile_while.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Compile While
-*
-* Compiles the {while} tag
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile While Class
-*/
-class Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {while} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->required_attributes = array('if condition');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
- $this->_open_tag('while', $this->compiler->nocache);
-
- // maybe nocache because of nocache variables
- $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
-
-
- if (is_array($args['if condition'])) {
- $_output = " <?php if (!isset(\$_smarty_tpl->tpl_vars[".$args['if condition']['var']."])) \$_smarty_tpl->tpl_vars[".$args['if condition']['var']."] = new Smarty_Variable;\n";
- $_output .= " while (\$_smarty_tpl->tpl_vars[".$args['if condition']['var']."]->value = ".$args['if condition']['value'].") {\n ?>";
- return $_output;
- } else {
- return '<?php while (' . $args['if condition'] . ') { ?>';
- }
- }
-}
-
-/**
-* Smarty Internal Plugin Compile Whileclose Class
-*/
-class Smarty_Internal_Compile_Whileclose extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the {/while} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- // must endblock be nocache?
- if ($this->compiler->nocache) {
- $this->compiler->tag_nocache = true;
- }
- $this->compiler->nocache = $this->_close_tag(array('while'));
- return "<?php }?>";
- }
-}
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_compilebase.php b/includes/Smarty/sysplugins/smarty_internal_compilebase.php
deleted file mode 100644
index 6109642..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_compilebase.php
+++ /dev/null
@@ -1,109 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin CompileBase
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-
-/*
-interface TagCompilerInterface {
- public function compile($args, $compiler);
-}
-*/
-
-/**
-* This class does extend all internal compile plugins
-*/
-//abstract class Smarty_Internal_CompileBase implements TagCompilerInterface
-abstract class Smarty_Internal_CompileBase
-{
- function __construct()
- {
- // initialize valid attributes
- $this->required_attributes = array();
- $this->optional_attributes = array();
- }
-
- /**
- * This function checks if the attributes passed are valid
- *
- * The attributes passed for the tag to compile are checked against the list of required and
- * optional attributes. Required attributes must be present. Optional attributes are check against
- * against the corresponding list. The keyword '_any' specifies that any attribute will be accepted
- * as valid
- *
- * @todo More generallized handling of the nocache attributes in compile plugins
- * @param array $args attributes applied to the tag
- * @return array attributes for further processing
- */
- function _get_attributes ($args)
- {
- // check if all required attributes present
- foreach ($this->required_attributes as $attr) {
- if (!array_key_exists($attr, $args)) {
- $this->compiler->trigger_template_error("missing \"" . $attr . "\" attribute");
- }
- }
- // check for unallowed attributes
- if ($this->optional_attributes != array('_any')) {
- $tmp_array = array_merge($this->required_attributes, $this->optional_attributes);
- foreach ($args as $key => $dummy) {
- if (!in_array($key, $tmp_array) && $key !== 0) {
- $this->compiler->trigger_template_error("unexpected \"" . $key . "\" attribute");
- }
- }
- }
-
- return $args;
- }
-
- /**
- * Push opening tag name on stack
- *
- * Optionally additional data can be saved on stack
- *
- * @param string $open_tag the opening tag's name
- * @param anytype $data optional data which shall be saved on stack
- */
- function _open_tag($open_tag, $data = null)
- {
- array_push($this->compiler->_tag_stack, array($open_tag, $data));
- }
-
- /**
- * Pop closing tag
- *
- * Raise an error if this stack-top doesn't match with expected opening tags
- *
- * @param array $ |string $expected_tag the expected opening tag names
- * @return anytype the opening tag's name or saved data
- */
- function _close_tag($expected_tag)
- {
- if (count($this->compiler->_tag_stack) > 0) {
- // get stacked info
- list($_open_tag, $_data) = array_pop($this->compiler->_tag_stack);
- // open tag must match with the expected ones
- if (in_array($_open_tag, (array)$expected_tag)) {
- if (is_null($_data)) {
- // return opening tag
- return $_open_tag;
- } else {
- // return restored data
- return $_data;
- }
- }
- // wrong nesting of tags
- $this->compiler->trigger_template_error("unclosed {" . $_open_tag . "} tag");
- return;
- }
- // wrong nesting of tags
- $this->compiler->trigger_template_error("unexpected closing tag");
- return;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_config.php b/includes/Smarty/sysplugins/smarty_internal_config.php
deleted file mode 100644
index 8e188de..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_config.php
+++ /dev/null
@@ -1,249 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Config
-*
-* Main class for config variables
-*
-* @ignore
-* @package Smarty
-* @subpackage Config
-* @author Uwe Tews
-*/
-class Smarty_Internal_Config {
- static $config_objects = array();
-
- public function __construct($config_resource, $smarty, $template = null)
- {
- $this->template = $template;
- $this->smarty = $smarty;
- $this->config_resource = $config_resource;
- $this->config_resource_type = null;
- $this->config_resource_name = null;
- $this->config_filepath = null;
- $this->config_timestamp = null;
- $this->config_source = null;
- $this->compiled_config = null;
- $this->compiled_filepath = null;
- $this->compiled_timestamp = null;
- $this->mustCompile = null;
- $this->compiler_object = null;
- // parse config resource name
- if (!$this->parseConfigResourceName ($config_resource)) {
- throw new Exception ("Unable to parse config resource '{$config_resource}'");
- }
- }
-
- public function getConfigFilepath ()
- {
- return $this->config_filepath === null ?
- $this->config_filepath = $this->buildConfigFilepath() :
- $this->config_filepath;
- }
-
- public function getTimestamp ()
- {
- return $this->config_timestamp === null ?
- $this->config_timestamp = filemtime($this->getConfigFilepath()) :
- $this->config_timestamp;
- }
-
- private function parseConfigResourceName($config_resource)
- {
- if (empty($config_resource))
- return false;
- if (strpos($config_resource, ':') === false) {
- // no resource given, use default
- $this->config_resource_type = $this->smarty->default_config_type;
- $this->config_resource_name = $config_resource;
- } else {
- // get type and name from path
- list($this->config_resource_type, $this->config_resource_name) = explode(':', $config_resource, 2);
- if (strlen($this->config_resource_type) == 1) {
- // 1 char is not resource type, but part of filepath
- $this->config_resource_type = $this->smarty->default_config_type;
- $this->config_resource_name = $config_resource;
- } else {
- $this->config_resource_type = strtolower($this->config_resource_type);
- }
- }
- return true;
- }
-
- /*
- * get system filepath to config
- */
- public function buildConfigFilepath ()
- {
- foreach((array)$this->smarty->config_dir as $_config_dir) {
- if (strpos('/\\', substr($_config_dir, -1)) === false) {
- $_config_dir .= DS;
- }
-
- $_filepath = $_config_dir . $this->config_resource_name;
- if (file_exists($_filepath))
- return $_filepath;
- }
- // no tpl file found
- throw new Exception("Unable to load config file \"{$this->config_resource_name}\"");
- return false;
- }
- /**
- * Read config file source
- *
- * @return string content of source file
- */
- /**
- * Returns the template source code
- *
- * The template source is being read by the actual resource handler
- *
- * @return string the template source
- */
- public function getConfigSource ()
- {
- if ($this->config_source === null) {
- if ($this->readConfigSource($this) === false) {
- throw new Exception("Unable to load config file \"{$this->config_resource_name}\"");
- }
- }
- return $this->config_source;
- }
- public function readConfigSource()
- {
- // read source file
- if (file_exists($this->getConfigFilepath())) {
- $this->config_source = file_get_contents($this->getConfigFilepath());
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Returns the compiled filepath
- *
- * @return string the compiled filepath
- */
- public function getCompiledFilepath ()
- {
- return $this->compiled_filepath === null ?
- ($this->compiled_filepath = $this->buildCompiledFilepath()) :
- $this->compiled_filepath;
- }
- public function buildCompiledFilepath()
- {
- $_flag = (int)$this->smarty->config_read_hidden + (int)$this->smarty->config_booleanize * 2 +
- (int)$this->smarty->config_overwrite * 4;
- $_filepath = (string)abs(crc32($this->config_resource_name . $_flag));
- // if use_sub_dirs, break file into directories
- if ($this->smarty->use_sub_dirs) {
- $_filepath = substr($_filepath, 0, 2) . DS
- . substr($_filepath, 2, 2) . DS
- . substr($_filepath, 4, 2) . DS
- . $_filepath;
- }
- $_compile_dir = $this->smarty->compile_dir;
- if (substr($_compile_dir, -1) != DS) {
- $_compile_dir .= DS;
- }
- return $_compile_dir . $_filepath . '.' . basename($this->config_resource_name) . '.config' . '.php';
- }
- /**
- * Returns the timpestamp of the compiled file
- *
- * @return integer the file timestamp
- */
- public function getCompiledTimestamp ()
- {
- return $this->compiled_timestamp === null ?
- ($this->compiled_timestamp = (file_exists($this->getCompiledFilepath())) ? filemtime($this->getCompiledFilepath()) : false) :
- $this->compiled_timestamp;
- }
- /**
- * Returns if the current config file must be compiled
- *
- * It does compare the timestamps of config source and the compiled config and checks the force compile configuration
- *
- * @return boolean true if the file must be compiled
- */
- public function mustCompile ()
- {
- return $this->mustCompile === null ?
- $this->mustCompile = ($this->smarty->force_compile || $this->getCompiledTimestamp () !== $this->getTimestamp ()):
- $this->mustCompile;
- }
- /**
- * Returns the compiled config file
- *
- * It checks if the config file must be compiled or just read the compiled version
- *
- * @return string the compiled config file
- */
- public function getCompiledConfig ()
- {
- if ($this->compiled_config === null) {
- // see if template needs compiling.
- if ($this->mustCompile()) {
- $this->compileConfigSource();
- } else {
- $this->compiled_config = file_get_contents($this->getCompiledFilepath());
- }
- }
- return $this->compiled_config;
- }
-
- /**
- * Compiles the config files
- */
- public function compileConfigSource ()
- {
- // compile template
- if (!is_object($this->compiler_object)) {
- // load compiler
- $this->compiler_object = new Smarty_Internal_Config_File_Compiler($this->smarty);
- }
- // call compiler
- if ($this->compiler_object->compileSource($this)) {
- // compiling succeded
- // write compiled template
- Smarty_Internal_Write_File::writeFile($this->getCompiledFilepath(), $this->getCompiledConfig(), $this->smarty);
- // make template and compiled file timestamp match
- touch($this->getCompiledFilepath(), $this->getTimestamp());
- } else {
- // error compiling template
- throw new Exception("Error compiling template {$this->getConfigFilepath ()}");
- return false;
- }
- }
-
- /*
- * load config variables
- *
- * @param mixed $sections array of section names, single section or null
- * @param object $scope global,parent or local
- */
- public function loadConfigVars ($sections = null, $scope)
- {
- if (isset($this->template)) {
- $this->template->properties['file_dependency']['F' . abs(crc32($this->getConfigFilepath()))] = array($this->getConfigFilepath(), $this->getTimestamp());
- } else {
- $this->smarty->properties['file_dependency']['F' . abs(crc32($this->getConfigFilepath()))] = array($this->getConfigFilepath(), $this->getTimestamp());
- }
- $config_data = unserialize($this->getCompiledConfig());
- // var_dump($config_data);
- // copy global config vars
- foreach ($config_data['vars'] as $variable => $value) {
- $scope->config_vars[$variable] = $value;
- }
- // scan sections
- foreach ($config_data['sections'] as $this_section => $dummy) {
- if ($sections == null || in_array($this_section, (array)$sections)) {
- foreach ($config_data['sections'][$this_section]['vars'] as $variable => $value) {
- $scope->config_vars[$variable] = $value;
- }
- }
- }
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_config_file_compiler.php b/includes/Smarty/sysplugins/smarty_internal_config_file_compiler.php
deleted file mode 100644
index 8c53010..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_config_file_compiler.php
+++ /dev/null
@@ -1,116 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Config File Compiler
-*
-* This is the config file compiler class. It calls the lexer and parser to
-* perform the compiling.
-*
-* @package Smarty
-* @subpackage Config
-* @author Uwe Tews
-*/
-/**
-* Main config file compiler class
-*/
-class Smarty_Internal_Config_File_Compiler {
- public $compile_error= false;
- /**
- * Initialize compiler
- */
- public function __construct($smarty)
- {
- $this->smarty = $smarty;
- // get required plugins
- $this->smarty->loadPlugin('Smarty_Internal_Configfilelexer');
- $this->smarty->loadPlugin('Smarty_Internal_Configfileparser');
- $this->config_data['sections'] = array();
- $this->config_data['vars'] = array();
- }
-
- /**
- * Methode to compile a Smarty template
- *
- * @param $template template object to compile
- * @return bool true if compiling succeeded, false if it failed
- */
- public function compileSource($config)
- {
- /* here is where the compiling takes place. Smarty
- tags in the templates are replaces with PHP code,
- then written to compiled files. */
- $this->config = $config;
- // get config file source
- $_content = $config->getConfigSource()."\n";
- // on empty template just return
- if ($_content == '') {
- return true;
- }
- // init the lexer/parser to compile the config file
- $lex = new Smarty_Internal_Configfilelexer($_content, $this->smarty);
- $parser = new Smarty_Internal_Configfileparser($lex, $this);
- // $parser->PrintTrace();
- // get tokens from lexer and parse them
- while ($lex->yylex()) {
- // echo "<br>Parsing {$parser->yyTokenName[$lex->token]} Token {$lex->value} Line {$lex->line} \n";
- $parser->doParse($lex->token, $lex->value);
- }
- // finish parsing process
- $parser->doParse(0, 0);
-
- $config->compiled_config = serialize($this->config_data);
- if (!$this->compile_error) {
- return true;
- } else {
- // compilation error
- return false;
- }
- }
- /**
- * display compiler error messages without dying
- *
- * If parameter $args is empty it is a parser detected syntax error.
- * In this case the parser is called to obtain information about exspected tokens.
- *
- * If parameter $args contains a string this is used as error message
- *
- * @todo output exact position of parse error in source line
- * @param $args string individual error message or null
- */
- public function trigger_config_file_error($args = null)
- {
- $this->lex = Smarty_Internal_Configfilelexer::instance();
- $this->parser = Smarty_Internal_Configfileparser::instance();
- // get template source line which has error
- $line = $this->lex->line;
- if (isset($args)) {
-// $line--;
- }
- $match = preg_split("/\n/", $this->lex->data);
- $error_text = 'Syntax Error in config file "' . $this->config->getConfigFilepath() . '" on line ' . $line . ' "'. $match[$line-1].'" ';
- if (isset($args)) {
- // individual error message
- $error_text .= $args;
- } else {
- // exspected token from parser
- foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {
- $exp_token = $this->parser->yyTokenName[$token];
- if (isset($this->lex->smarty_token_names[$exp_token])) {
- // token type from lexer
- $expect[] = '"' . $this->lex->smarty_token_names[$exp_token] . '"';
- } else {
- // otherwise internal token name
- $expect[] = $this->parser->yyTokenName[$token];
- }
- }
- // output parser error message
- $error_text .= ' - Unexpected "' . $this->lex->value . '", expected one of: ' . implode(' , ', $expect);
- }
- throw new Exception($error_text);
- // set error flag
- $this->compile_error = true;
- }
-
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_configfilelexer.php b/includes/Smarty/sysplugins/smarty_internal_configfilelexer.php
deleted file mode 100644
index 0e685a6..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_configfilelexer.php
+++ /dev/null
@@ -1,261 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Configfilelexer
-*
-* This is the lexer to break the config file source into tokens
-* @package Smarty
-* @subpackage Config
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Configfilelexer
-*/
-class Smarty_Internal_Configfilelexer
-{
-
- public $data;
- public $counter;
- public $token;
- public $value;
- public $node;
- public $line;
- private $state = 1;
- public $smarty_token_names = array ( // Text for parser error messages
- );
-
-
- function __construct($data, $smarty)
- {
- // set instance object
- self::instance($this);
- $this->data = $data;
- $this->counter = 0;
- $this->line = 1;
- $this->smarty = $smarty;
- }
- public static function &instance($new_instance = null)
- {
- static $instance = null;
- if (isset($new_instance) && is_object($new_instance))
- $instance = $new_instance;
- return $instance;
- }
-
-
-
- private $_yy_state = 1;
- private $_yy_stack = array();
-
- function yylex()
- {
- return $this->{'yylex' . $this->_yy_state}();
- }
-
- function yypushstate($state)
- {
- array_push($this->_yy_stack, $this->_yy_state);
- $this->_yy_state = $state;
- }
-
- function yypopstate()
- {
- $this->_yy_state = array_pop($this->_yy_stack);
- }
-
- function yybegin($state)
- {
- $this->_yy_state = $state;
- }
-
-
-
- function yylex1()
- {
- $tokenMap = array (
- 1 => 0,
- 2 => 0,
- 3 => 0,
- 4 => 0,
- 5 => 0,
- 6 => 0,
- 7 => 0,
- 8 => 1,
- 10 => 0,
- 11 => 0,
- 12 => 0,
- 13 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/^(#)|^('[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*')|^(\"\"\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\"\"\")|^(\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\")|^(\\[)|^(])|^(\\s*=\\s*)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)/";
-
- do {
- if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {
- $yysubmatches = $yymatches;
- $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
- if (!count($yymatches)) {
- throw new Exception('Error: lexing failed because a rule matched' .
- 'an empty string. Input "' . substr($this->data,
- $this->counter, 5) . '... state START');
- }
- next($yymatches); // skip global match
- $this->token = key($yymatches); // token number
- if ($tokenMap[$this->token]) {
- // extract sub-patterns for passing to lex function
- $yysubmatches = array_slice($yysubmatches, $this->token + 1,
- $tokenMap[$this->token]);
- } else {
- $yysubmatches = array();
- }
- $this->value = current($yymatches); // token value
- $r = $this->{'yy_r1_' . $this->token}($yysubmatches);
- if ($r === null) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- // accept this token
- return true;
- } elseif ($r === true) {
- // we have changed state
- // process this token in the new state
- return $this->yylex();
- } elseif ($r === false) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- // skip this token
- continue;
- } else { $yy_yymore_patterns = array(
- 1 => array(0, "^('[^'\\\\\\\\]*(?:\\\\\\\\.[^'\\\\\\\\]*)*')|^(\"\"\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\"\"\")|^(\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\")|^(\\[)|^(])|^(\\s*=\\s*)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"),
- 2 => array(0, "^(\"\"\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\"\"\")|^(\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\")|^(\\[)|^(])|^(\\s*=\\s*)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"),
- 3 => array(0, "^(\"[^\"\\\\\\\\]*(?:\\\\\\\\.[^\"\\\\\\\\]*)*\")|^(\\[)|^(])|^(\\s*=\\s*)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"),
- 4 => array(0, "^(\\[)|^(])|^(\\s*=\\s*)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"),
- 5 => array(0, "^(])|^(\\s*=\\s*)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"),
- 6 => array(0, "^(\\s*=\\s*)|^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"),
- 7 => array(0, "^((\n|\r\n))|^([\s]+)|^(\\.)|^(\\w+)|^(.)"),
- 8 => array(1, "^([\s]+)|^(\\.)|^(\\w+)|^(.)"),
- 10 => array(1, "^(\\.)|^(\\w+)|^(.)"),
- 11 => array(1, "^(\\w+)|^(.)"),
- 12 => array(1, "^(.)"),
- 13 => array(1, ""),
- );
-
- // yymore is needed
- do {
- if (!strlen($yy_yymore_patterns[$this->token][1])) {
- throw new Exception('cannot do yymore for the last token');
- }
- $yysubmatches = array();
- if (preg_match('/' . $yy_yymore_patterns[$this->token][1] . '/',
- substr($this->data, $this->counter), $yymatches)) {
- $yysubmatches = $yymatches;
- $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
- next($yymatches); // skip global match
- $this->token += key($yymatches) + $yy_yymore_patterns[$this->token][0]; // token number
- $this->value = current($yymatches); // token value
- $this->line = substr_count($this->value, "\n");
- if ($tokenMap[$this->token]) {
- // extract sub-patterns for passing to lex function
- $yysubmatches = array_slice($yysubmatches, $this->token + 1,
- $tokenMap[$this->token]);
- } else {
- $yysubmatches = array();
- }
- }
- $r = $this->{'yy_r1_' . $this->token}($yysubmatches);
- } while ($r !== null && !is_bool($r));
- if ($r === true) {
- // we have changed state
- // process this token in the new state
- return $this->yylex();
- } elseif ($r === false) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- // skip this token
- continue;
- } else {
- // accept
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- return true;
- }
- }
- } else {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const START = 1;
- function yy_r1_1($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Configfileparser::TPC_COMMENTSTART;
- }
- function yy_r1_2($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Configfileparser::TPC_SI_QSTR;
- }
- function yy_r1_3($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Configfileparser::TPC_ML_QSTR;
- }
- function yy_r1_4($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Configfileparser::TPC_DO_QSTR;
- }
- function yy_r1_5($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Configfileparser::TPC_OPENB;
- }
- function yy_r1_6($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Configfileparser::TPC_CLOSEB;
- }
- function yy_r1_7($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Configfileparser::TPC_EQUAL;
- }
- function yy_r1_8($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Configfileparser::TPC_EOL;
- }
- function yy_r1_10($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Configfileparser::TPC_SPACE;
- }
- function yy_r1_11($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Configfileparser::TPC_DOT;
- }
- function yy_r1_12($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Configfileparser::TPC_ID;
- }
- function yy_r1_13($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Configfileparser::TPC_OTHER;
- }
-
-}
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_configfileparser.php b/includes/Smarty/sysplugins/smarty_internal_configfileparser.php
deleted file mode 100644
index 97683f8..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_configfileparser.php
+++ /dev/null
@@ -1,1159 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Templateparser
-*
-* This is the template parser.
-* It is generated from the internal.templateparser.y file
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-
-/**
- * This can be used to store both the string representation of
- * a token, and any useful meta-data associated with the token.
- *
- * meta-data should be stored as an array
- */
-class TPC_yyToken implements ArrayAccess
-{
- public $string = '';
- public $metadata = array();
-
- function __construct($s, $m = array())
- {
- if ($s instanceof TPC_yyToken) {
- $this->string = $s->string;
- $this->metadata = $s->metadata;
- } else {
- $this->string = (string) $s;
- if ($m instanceof TPC_yyToken) {
- $this->metadata = $m->metadata;
- } elseif (is_array($m)) {
- $this->metadata = $m;
- }
- }
- }
-
- function __toString()
- {
- return $this->_string;
- }
-
- function offsetExists($offset)
- {
- return isset($this->metadata[$offset]);
- }
-
- function offsetGet($offset)
- {
- return $this->metadata[$offset];
- }
-
- function offsetSet($offset, $value)
- {
- if ($offset === null) {
- if (isset($value[0])) {
- $x = ($value instanceof TPC_yyToken) ?
- $value->metadata : $value;
- $this->metadata = array_merge($this->metadata, $x);
- return;
- }
- $offset = count($this->metadata);
- }
- if ($value === null) {
- return;
- }
- if ($value instanceof TPC_yyToken) {
- if ($value->metadata) {
- $this->metadata[$offset] = $value->metadata;
- }
- } elseif ($value) {
- $this->metadata[$offset] = $value;
- }
- }
-
- function offsetUnset($offset)
- {
- unset($this->metadata[$offset]);
- }
-}
-
-/** The following structure represents a single element of the
- * parser's stack. Information stored includes:
- *
- * + The state number for the parser at this level of the stack.
- *
- * + The value of the token stored at this level of the stack.
- * (In other words, the "major" token.)
- *
- * + The semantic value stored at this level of the stack. This is
- * the information used by the action routines in the grammar.
- * It is sometimes called the "minor" token.
- */
-class TPC_yyStackEntry
-{
- public $stateno; /* The state-number */
- public $major; /* The major token value. This is the code
- ** number for the token at this stack level */
- public $minor; /* The user-supplied minor token value. This
- ** is the value of the token */
-};
-
-// code external to the class is included here
-
-// declare_class is output here
-#line 12 "smarty_internal_configfileparser.y"
-class Smarty_Internal_Configfileparser#line 109 "smarty_internal_configfileparser.php"
-{
-/* First off, code is included which follows the "include_class" declaration
-** in the input file. */
-#line 14 "smarty_internal_configfileparser.y"
-
- // states whether the parse was successful or not
- public $successful = true;
- public $retvalue = 0;
- private $lex;
- private $internalError = false;
-
- function __construct($lex, $compiler) {
- // set instance object
- self::instance($this);
- $this->lex = $lex;
- $this->smarty = $compiler->smarty;
- $this->compiler = $compiler;
- $this->current_section = null;
- $this->hidden_section = false;
- }
- public static function &instance($new_instance = null)
- {
- static $instance = null;
- if (isset($new_instance) && is_object($new_instance))
- $instance = $new_instance;
- return $instance;
- }
-
-#line 139 "smarty_internal_configfileparser.php"
-
-/* Next is all token values, as class constants
-*/
-/*
-** These constants (all generated automatically by the parser generator)
-** specify the various kinds of tokens (terminals) that the parser
-** understands.
-**
-** Each symbol here is a terminal symbol in the grammar.
-*/
- const TPC_OTHER = 1;
- const TPC_COMMENTSTART = 2;
- const TPC_OPENB = 3;
- const TPC_CLOSEB = 4;
- const TPC_DOT = 5;
- const TPC_BOOLEANTRUE = 6;
- const TPC_BOOLEANFALSE = 7;
- const TPC_SI_QSTR = 8;
- const TPC_DO_QSTR = 9;
- const TPC_EQUAL = 10;
- const TPC_SPACE = 11;
- const TPC_ID = 12;
- const TPC_EOL = 13;
- const TPC_ML_QSTR = 14;
- const YY_NO_ACTION = 47;
- const YY_ACCEPT_ACTION = 46;
- const YY_ERROR_ACTION = 45;
-
-/* Next are that tables used to determine what action to take based on the
-** current state and lookahead token. These tables are used to implement
-** functions that take a state number and lookahead value and return an
-** action integer.
-**
-** Suppose the action integer is N. Then the action is determined as
-** follows
-**
-** 0 <= N < self::YYNSTATE Shift N. That is,
-** push the lookahead
-** token onto the stack
-** and goto state N.
-**
-** self::YYNSTATE <= N < self::YYNSTATE+self::YYNRULE Reduce by rule N-YYNSTATE.
-**
-** N == self::YYNSTATE+self::YYNRULE A syntax error has occurred.
-**
-** N == self::YYNSTATE+self::YYNRULE+1 The parser accepts its
-** input. (and concludes parsing)
-**
-** N == self::YYNSTATE+self::YYNRULE+2 No such action. Denotes unused
-** slots in the yy_action[] table.
-**
-** The action table is constructed as a single large static array $yy_action.
-** Given state S and lookahead X, the action is computed as
-**
-** self::$yy_action[self::$yy_shift_ofst[S] + X ]
-**
-** If the index value self::$yy_shift_ofst[S]+X is out of range or if the value
-** self::$yy_lookahead[self::$yy_shift_ofst[S]+X] is not equal to X or if
-** self::$yy_shift_ofst[S] is equal to self::YY_SHIFT_USE_DFLT, it means that
-** the action is not in the table and that self::$yy_default[S] should be used instead.
-**
-** The formula above is for computing the action when the lookahead is
-** a terminal symbol. If the lookahead is a non-terminal (as occurs after
-** a reduce action) then the static $yy_reduce_ofst array is used in place of
-** the static $yy_shift_ofst array and self::YY_REDUCE_USE_DFLT is used in place of
-** self::YY_SHIFT_USE_DFLT.
-**
-** The following are the tables generated in this section:
-**
-** self::$yy_action A single table containing all actions.
-** self::$yy_lookahead A table containing the lookahead for each entry in
-** yy_action. Used to detect hash collisions.
-** self::$yy_shift_ofst For each state, the offset into self::$yy_action for
-** shifting terminals.
-** self::$yy_reduce_ofst For each state, the offset into self::$yy_action for
-** shifting non-terminals after a reduce.
-** self::$yy_default Default action for each state.
-*/
- const YY_SZ_ACTTAB = 36;
-static public $yy_action = array(
- /* 0 */ 3, 9, 7, 6, 15, 46, 4, 17, 10, 26,
- /* 10 */ 11, 14, 26, 2, 15, 12, 23, 13, 8, 25,
- /* 20 */ 27, 22, 5, 18, 26, 19, 20, 1, 22, 24,
- /* 30 */ 42, 21, 42, 42, 16, 20,
- );
- static public $yy_lookahead = array(
- /* 0 */ 2, 3, 20, 21, 22, 16, 17, 18, 5, 1,
- /* 10 */ 12, 13, 1, 21, 22, 12, 19, 12, 4, 8,
- /* 20 */ 9, 13, 4, 19, 1, 14, 22, 10, 13, 19,
- /* 30 */ 23, 19, 23, 23, 18, 22,
-);
- const YY_SHIFT_USE_DFLT = -3;
- const YY_SHIFT_MAX = 13;
- static public $yy_shift_ofst = array(
- /* 0 */ -2, 11, 8, 23, -2, 15, 23, 15, 15, 3,
- /* 10 */ 5, 17, 14, 18,
-);
- const YY_REDUCE_USE_DFLT = -19;
- const YY_REDUCE_MAX = 8;
- static public $yy_reduce_ofst = array(
- /* 0 */ -11, -18, 4, -8, 16, 12, 13, 10, -3,
-);
- static public $yyExpectedTokens = array(
- /* 0 */ array(2, 3, 12, 13, ),
- /* 1 */ array(1, 8, 9, 14, ),
- /* 2 */ array(1, 13, ),
- /* 3 */ array(1, ),
- /* 4 */ array(2, 3, 12, 13, ),
- /* 5 */ array(13, ),
- /* 6 */ array(1, ),
- /* 7 */ array(13, ),
- /* 8 */ array(13, ),
- /* 9 */ array(5, 12, ),
- /* 10 */ array(12, ),
- /* 11 */ array(10, ),
- /* 12 */ array(4, ),
- /* 13 */ array(4, ),
- /* 14 */ array(),
- /* 15 */ array(),
- /* 16 */ array(),
- /* 17 */ array(),
- /* 18 */ array(),
- /* 19 */ array(),
- /* 20 */ array(),
- /* 21 */ array(),
- /* 22 */ array(),
- /* 23 */ array(),
- /* 24 */ array(),
- /* 25 */ array(),
- /* 26 */ array(),
- /* 27 */ array(),
-);
- static public $yy_default = array(
- /* 0 */ 45, 45, 41, 45, 28, 41, 36, 41, 41, 45,
- /* 10 */ 45, 45, 45, 45, 34, 43, 30, 29, 35, 39,
- /* 20 */ 42, 32, 40, 31, 33, 37, 44, 38,
-);
-/* The next thing included is series of defines which control
-** various aspects of the generated parser.
-** self::YYNOCODE is a number which corresponds
-** to no legal terminal or nonterminal number. This
-** number is used to fill in empty slots of the hash
-** table.
-** self::YYFALLBACK If defined, this indicates that one or more tokens
-** have fall-back values which should be used if the
-** original value of the token will not parse.
-** self::YYSTACKDEPTH is the maximum depth of the parser's stack.
-** self::YYNSTATE the combined number of states.
-** self::YYNRULE the number of rules in the grammar
-** self::YYERRORSYMBOL is the code number of the error symbol. If not
-** defined, then do no error processing.
-*/
- const YYNOCODE = 24;
- const YYSTACKDEPTH = 100;
- const YYNSTATE = 28;
- const YYNRULE = 17;
- const YYERRORSYMBOL = 15;
- const YYERRSYMDT = 'yy0';
- const YYFALLBACK = 1;
- /** The next table maps tokens into fallback tokens. If a construct
- * like the following:
- *
- * %fallback ID X Y Z.
- *
- * appears in the grammer, then ID becomes a fallback token for X, Y,
- * and Z. Whenever one of the tokens X, Y, or Z is input to the parser
- * but it does not parse, the type of the token is changed to ID and
- * the parse is retried before an error is thrown.
- */
- static public $yyFallback = array(
- 0, /* $ => nothing */
- 0, /* OTHER => nothing */
- 1, /* COMMENTSTART => OTHER */
- 1, /* OPENB => OTHER */
- 1, /* CLOSEB => OTHER */
- 1, /* DOT => OTHER */
- 1, /* BOOLEANTRUE => OTHER */
- 1, /* BOOLEANFALSE => OTHER */
- 1, /* SI_QSTR => OTHER */
- 1, /* DO_QSTR => OTHER */
- 1, /* EQUAL => OTHER */
- 1, /* SPACE => OTHER */
- 1, /* ID => OTHER */
- 0, /* EOL => nothing */
- 0, /* ML_QSTR => nothing */
- );
- /**
- * Turn parser tracing on by giving a stream to which to write the trace
- * and a prompt to preface each trace message. Tracing is turned off
- * by making either argument NULL
- *
- * Inputs:
- *
- * - A stream resource to which trace output should be written.
- * If NULL, then tracing is turned off.
- * - A prefix string written at the beginning of every
- * line of trace output. If NULL, then tracing is
- * turned off.
- *
- * Outputs:
- *
- * - None.
- * @param resource
- * @param string
- */
- static function Trace($TraceFILE, $zTracePrompt)
- {
- if (!$TraceFILE) {
- $zTracePrompt = 0;
- } elseif (!$zTracePrompt) {
- $TraceFILE = 0;
- }
- self::$yyTraceFILE = $TraceFILE;
- self::$yyTracePrompt = $zTracePrompt;
- }
-
- /**
- * Output debug information to output (php://output stream)
- */
- static function PrintTrace()
- {
- self::$yyTraceFILE = fopen('php://output', 'w');
- self::$yyTracePrompt = '<br>';
- }
-
- /**
- * @var resource|0
- */
- static public $yyTraceFILE;
- /**
- * String to prepend to debug output
- * @var string|0
- */
- static public $yyTracePrompt;
- /**
- * @var int
- */
- public $yyidx; /* Index of top element in stack */
- /**
- * @var int
- */
- public $yyerrcnt; /* Shifts left before out of the error */
- /**
- * @var array
- */
- public $yystack = array(); /* The parser's stack */
-
- /**
- * For tracing shifts, the names of all terminals and nonterminals
- * are required. The following table supplies these names
- * @var array
- */
- public $yyTokenName = array(
- '$', 'OTHER', 'COMMENTSTART', 'OPENB',
- 'CLOSEB', 'DOT', 'BOOLEANTRUE', 'BOOLEANFALSE',
- 'SI_QSTR', 'DO_QSTR', 'EQUAL', 'SPACE',
- 'ID', 'EOL', 'ML_QSTR', 'error',
- 'start', 'config', 'config_element', 'opteol',
- 'value', 'text', 'textelement',
- );
-
- /**
- * For tracing reduce actions, the names of all rules are required.
- * @var array
- */
- static public $yyRuleName = array(
- /* 0 */ "start ::= config",
- /* 1 */ "config ::= config_element",
- /* 2 */ "config ::= config config_element",
- /* 3 */ "config_element ::= OPENB ID CLOSEB opteol",
- /* 4 */ "config_element ::= OPENB DOT ID CLOSEB opteol",
- /* 5 */ "config_element ::= ID EQUAL value opteol",
- /* 6 */ "config_element ::= EOL",
- /* 7 */ "config_element ::= COMMENTSTART text opteol",
- /* 8 */ "value ::= text",
- /* 9 */ "value ::= SI_QSTR",
- /* 10 */ "value ::= DO_QSTR",
- /* 11 */ "value ::= ML_QSTR",
- /* 12 */ "opteol ::= EOL",
- /* 13 */ "opteol ::=",
- /* 14 */ "text ::= text textelement",
- /* 15 */ "text ::= textelement",
- /* 16 */ "textelement ::= OTHER",
- );
-
- /**
- * This function returns the symbolic name associated with a token
- * value.
- * @param int
- * @return string
- */
- function tokenName($tokenType)
- {
- if ($tokenType === 0) {
- return 'End of Input';
- }
- if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) {
- return $this->yyTokenName[$tokenType];
- } else {
- return "Unknown";
- }
- }
-
- /**
- * The following function deletes the value associated with a
- * symbol. The symbol can be either a terminal or nonterminal.
- * @param int the symbol code
- * @param mixed the symbol's value
- */
- static function yy_destructor($yymajor, $yypminor)
- {
- switch ($yymajor) {
- /* Here is inserted the actions which take place when a
- ** terminal or non-terminal is destroyed. This can happen
- ** when the symbol is popped from the stack during a
- ** reduce or during error processing or when a parser is
- ** being destroyed before it is finished parsing.
- **
- ** Note: during a reduce, the only symbols destroyed are those
- ** which appear on the RHS of the rule, but which are not used
- ** inside the C code.
- */
- default: break; /* If no destructor action specified: do nothing */
- }
- }
-
- /**
- * Pop the parser's stack once.
- *
- * If there is a destructor routine associated with the token which
- * is popped from the stack, then call it.
- *
- * Return the major token number for the symbol popped.
- * @param TPC_yyParser
- * @return int
- */
- function yy_pop_parser_stack()
- {
- if (!count($this->yystack)) {
- return;
- }
- $yytos = array_pop($this->yystack);
- if (self::$yyTraceFILE && $this->yyidx >= 0) {
- fwrite(self::$yyTraceFILE,
- self::$yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] .
- "\n");
- }
- $yymajor = $yytos->major;
- self::yy_destructor($yymajor, $yytos->minor);
- $this->yyidx--;
- return $yymajor;
- }
-
- /**
- * Deallocate and destroy a parser. Destructors are all called for
- * all stack elements before shutting the parser down.
- */
- function __destruct()
- {
- while ($this->yyidx >= 0) {
- $this->yy_pop_parser_stack();
- }
- if (is_resource(self::$yyTraceFILE)) {
- fclose(self::$yyTraceFILE);
- }
- }
-
- /**
- * Based on the current state and parser stack, get a list of all
- * possible lookahead tokens
- * @param int
- * @return array
- */
- function yy_get_expected_tokens($token)
- {
- $state = $this->yystack[$this->yyidx]->stateno;
- $expected = self::$yyExpectedTokens[$state];
- if (in_array($token, self::$yyExpectedTokens[$state], true)) {
- return $expected;
- }
- $stack = $this->yystack;
- $yyidx = $this->yyidx;
- do {
- $yyact = $this->yy_find_shift_action($token);
- if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
- // reduce action
- $done = 0;
- do {
- if ($done++ == 100) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- // too much recursion prevents proper detection
- // so give up
- return array_unique($expected);
- }
- $yyruleno = $yyact - self::YYNSTATE;
- $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];
- $nextstate = $this->yy_find_reduce_action(
- $this->yystack[$this->yyidx]->stateno,
- self::$yyRuleInfo[$yyruleno]['lhs']);
- if (isset(self::$yyExpectedTokens[$nextstate])) {
- $expected += self::$yyExpectedTokens[$nextstate];
- if (in_array($token,
- self::$yyExpectedTokens[$nextstate], true)) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- return array_unique($expected);
- }
- }
- if ($nextstate < self::YYNSTATE) {
- // we need to shift a non-terminal
- $this->yyidx++;
- $x = new TPC_yyStackEntry;
- $x->stateno = $nextstate;
- $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];
- $this->yystack[$this->yyidx] = $x;
- continue 2;
- } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- // the last token was just ignored, we can't accept
- // by ignoring input, this is in essence ignoring a
- // syntax error!
- return array_unique($expected);
- } elseif ($nextstate === self::YY_NO_ACTION) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- // input accepted, but not shifted (I guess)
- return $expected;
- } else {
- $yyact = $nextstate;
- }
- } while (true);
- }
- break;
- } while (true);
- return array_unique($expected);
- }
-
- /**
- * Based on the parser state and current parser stack, determine whether
- * the lookahead token is possible.
- *
- * The parser will convert the token value to an error token if not. This
- * catches some unusual edge cases where the parser would fail.
- * @param int
- * @return bool
- */
- function yy_is_expected_token($token)
- {
- if ($token === 0) {
- return true; // 0 is not part of this
- }
- $state = $this->yystack[$this->yyidx]->stateno;
- if (in_array($token, self::$yyExpectedTokens[$state], true)) {
- return true;
- }
- $stack = $this->yystack;
- $yyidx = $this->yyidx;
- do {
- $yyact = $this->yy_find_shift_action($token);
- if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
- // reduce action
- $done = 0;
- do {
- if ($done++ == 100) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- // too much recursion prevents proper detection
- // so give up
- return true;
- }
- $yyruleno = $yyact - self::YYNSTATE;
- $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];
- $nextstate = $this->yy_find_reduce_action(
- $this->yystack[$this->yyidx]->stateno,
- self::$yyRuleInfo[$yyruleno]['lhs']);
- if (isset(self::$yyExpectedTokens[$nextstate]) &&
- in_array($token, self::$yyExpectedTokens[$nextstate], true)) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- return true;
- }
- if ($nextstate < self::YYNSTATE) {
- // we need to shift a non-terminal
- $this->yyidx++;
- $x = new TPC_yyStackEntry;
- $x->stateno = $nextstate;
- $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];
- $this->yystack[$this->yyidx] = $x;
- continue 2;
- } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- if (!$token) {
- // end of input: this is valid
- return true;
- }
- // the last token was just ignored, we can't accept
- // by ignoring input, this is in essence ignoring a
- // syntax error!
- return false;
- } elseif ($nextstate === self::YY_NO_ACTION) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- // input accepted, but not shifted (I guess)
- return true;
- } else {
- $yyact = $nextstate;
- }
- } while (true);
- }
- break;
- } while (true);
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- return true;
- }
-
- /**
- * Find the appropriate action for a parser given the terminal
- * look-ahead token iLookAhead.
- *
- * If the look-ahead token is YYNOCODE, then check to see if the action is
- * independent of the look-ahead. If it is, return the action, otherwise
- * return YY_NO_ACTION.
- * @param int The look-ahead token
- */
- function yy_find_shift_action($iLookAhead)
- {
- $stateno = $this->yystack[$this->yyidx]->stateno;
-
- /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */
- if (!isset(self::$yy_shift_ofst[$stateno])) {
- // no shift actions
- return self::$yy_default[$stateno];
- }
- $i = self::$yy_shift_ofst[$stateno];
- if ($i === self::YY_SHIFT_USE_DFLT) {
- return self::$yy_default[$stateno];
- }
- if ($iLookAhead == self::YYNOCODE) {
- return self::YY_NO_ACTION;
- }
- $i += $iLookAhead;
- if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
- self::$yy_lookahead[$i] != $iLookAhead) {
- if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback)
- && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) {
- if (self::$yyTraceFILE) {
- fwrite(self::$yyTraceFILE, self::$yyTracePrompt . "FALLBACK " .
- $this->yyTokenName[$iLookAhead] . " => " .
- $this->yyTokenName[$iFallback] . "\n");
- }
- return $this->yy_find_shift_action($iFallback);
- }
- return self::$yy_default[$stateno];
- } else {
- return self::$yy_action[$i];
- }
- }
-
- /**
- * Find the appropriate action for a parser given the non-terminal
- * look-ahead token $iLookAhead.
- *
- * If the look-ahead token is self::YYNOCODE, then check to see if the action is
- * independent of the look-ahead. If it is, return the action, otherwise
- * return self::YY_NO_ACTION.
- * @param int Current state number
- * @param int The look-ahead token
- */
- function yy_find_reduce_action($stateno, $iLookAhead)
- {
- /* $stateno = $this->yystack[$this->yyidx]->stateno; */
-
- if (!isset(self::$yy_reduce_ofst[$stateno])) {
- return self::$yy_default[$stateno];
- }
- $i = self::$yy_reduce_ofst[$stateno];
- if ($i == self::YY_REDUCE_USE_DFLT) {
- return self::$yy_default[$stateno];
- }
- if ($iLookAhead == self::YYNOCODE) {
- return self::YY_NO_ACTION;
- }
- $i += $iLookAhead;
- if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
- self::$yy_lookahead[$i] != $iLookAhead) {
- return self::$yy_default[$stateno];
- } else {
- return self::$yy_action[$i];
- }
- }
-
- /**
- * Perform a shift action.
- * @param int The new state to shift in
- * @param int The major token to shift in
- * @param mixed the minor token to shift in
- */
- function yy_shift($yyNewState, $yyMajor, $yypMinor)
- {
- $this->yyidx++;
- if ($this->yyidx >= self::YYSTACKDEPTH) {
- $this->yyidx--;
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sStack Overflow!\n", self::$yyTracePrompt);
- }
- while ($this->yyidx >= 0) {
- $this->yy_pop_parser_stack();
- }
- /* Here code is inserted which will execute if the parser
- ** stack ever overflows */
- return;
- }
- $yytos = new TPC_yyStackEntry;
- $yytos->stateno = $yyNewState;
- $yytos->major = $yyMajor;
- $yytos->minor = $yypMinor;
- array_push($this->yystack, $yytos);
- if (self::$yyTraceFILE && $this->yyidx > 0) {
- fprintf(self::$yyTraceFILE, "%sShift %d\n", self::$yyTracePrompt,
- $yyNewState);
- fprintf(self::$yyTraceFILE, "%sStack:", self::$yyTracePrompt);
- for($i = 1; $i <= $this->yyidx; $i++) {
- fprintf(self::$yyTraceFILE, " %s",
- $this->yyTokenName[$this->yystack[$i]->major]);
- }
- fwrite(self::$yyTraceFILE,"\n");
- }
- }
-
- /**
- * The following table contains information about every rule that
- * is used during the reduce.
- *
- * <pre>
- * array(
- * array(
- * int $lhs; Symbol on the left-hand side of the rule
- * int $nrhs; Number of right-hand side symbols in the rule
- * ),...
- * );
- * </pre>
- */
- static public $yyRuleInfo = array(
- array( 'lhs' => 16, 'rhs' => 1 ),
- array( 'lhs' => 17, 'rhs' => 1 ),
- array( 'lhs' => 17, 'rhs' => 2 ),
- array( 'lhs' => 18, 'rhs' => 4 ),
- array( 'lhs' => 18, 'rhs' => 5 ),
- array( 'lhs' => 18, 'rhs' => 4 ),
- array( 'lhs' => 18, 'rhs' => 1 ),
- array( 'lhs' => 18, 'rhs' => 3 ),
- array( 'lhs' => 20, 'rhs' => 1 ),
- array( 'lhs' => 20, 'rhs' => 1 ),
- array( 'lhs' => 20, 'rhs' => 1 ),
- array( 'lhs' => 20, 'rhs' => 1 ),
- array( 'lhs' => 19, 'rhs' => 1 ),
- array( 'lhs' => 19, 'rhs' => 0 ),
- array( 'lhs' => 21, 'rhs' => 2 ),
- array( 'lhs' => 21, 'rhs' => 1 ),
- array( 'lhs' => 22, 'rhs' => 1 ),
- );
-
- /**
- * The following table contains a mapping of reduce action to method name
- * that handles the reduction.
- *
- * If a rule is not set, it has no handler.
- */
- static public $yyReduceMap = array(
- 0 => 0,
- 1 => 1,
- 8 => 1,
- 15 => 1,
- 16 => 1,
- 2 => 2,
- 14 => 2,
- 3 => 3,
- 4 => 4,
- 5 => 5,
- 6 => 6,
- 7 => 6,
- 9 => 9,
- 10 => 10,
- 11 => 10,
- );
- /* Beginning here are the reduction cases. A typical example
- ** follows:
- ** #line <lineno> <grammarfile>
- ** function yy_r0($yymsp){ ... } // User supplied code
- ** #line <lineno> <thisfile>
- */
-#line 67 "smarty_internal_configfileparser.y"
- function yy_r0(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }
-#line 839 "smarty_internal_configfileparser.php"
-#line 73 "smarty_internal_configfileparser.y"
- function yy_r1(){$this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }
-#line 842 "smarty_internal_configfileparser.php"
-#line 75 "smarty_internal_configfileparser.y"
- function yy_r2(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
-#line 845 "smarty_internal_configfileparser.php"
-#line 81 "smarty_internal_configfileparser.y"
- function yy_r3(){ $this->hidden_section = false; $this->current_section = $this->yystack[$this->yyidx + -2]->minor; $this->_retvalue =''; }
-#line 848 "smarty_internal_configfileparser.php"
-#line 83 "smarty_internal_configfileparser.y"
- function yy_r4(){ if ($this->smarty->config_read_hidden) {
- $this->hidden_section = false; $this->current_section = $this->yystack[$this->yyidx + -2]->minor;
- } else {$this->hidden_section = true; } $this->_retvalue =''; }
-#line 853 "smarty_internal_configfileparser.php"
-#line 87 "smarty_internal_configfileparser.y"
- function yy_r5(){if (!$this->hidden_section) {
- $value=$this->yystack[$this->yyidx + -1]->minor;
- if ($this->smarty->config_booleanize) {
- if (in_array(strtolower($value),array('on','yes','true')))
- $value = true;
- else if (in_array(strtolower($value),array('off','no','false')))
- $value = false;
- }
- if ($this->current_section == null) {
- if ($this->smarty->config_overwrite) {
- $this->compiler->config_data['vars'][$this->yystack[$this->yyidx + -3]->minor]=$value;
- } else {
- settype($this->compiler->config_data['vars'][$this->yystack[$this->yyidx + -3]->minor], 'array');
- $this->compiler->config_data['vars'][$this->yystack[$this->yyidx + -3]->minor][]=$value;
- }
- } else {
- if ($this->smarty->config_overwrite) {
- $this->compiler->config_data['sections'][$this->current_section]['vars'][$this->yystack[$this->yyidx + -3]->minor]=$value;
- } else {
- settype($this->compiler->config_data['sections'][$this->current_section]['vars'][$this->yystack[$this->yyidx + -3]->minor], 'array');
- $this->compiler->config_data['sections'][$this->current_section]['vars'][$this->yystack[$this->yyidx + -3]->minor][]=$value;
- }
- }} $this->_retvalue =''; }
-#line 878 "smarty_internal_configfileparser.php"
-#line 111 "smarty_internal_configfileparser.y"
- function yy_r6(){ $this->_retvalue =''; }
-#line 881 "smarty_internal_configfileparser.php"
-#line 115 "smarty_internal_configfileparser.y"
- function yy_r9(){$this->_retvalue = trim($this->yystack[$this->yyidx + 0]->minor,"'"); }
-#line 884 "smarty_internal_configfileparser.php"
-#line 116 "smarty_internal_configfileparser.y"
- function yy_r10(){$this->_retvalue = trim($this->yystack[$this->yyidx + 0]->minor,'"'); }
-#line 887 "smarty_internal_configfileparser.php"
-
- /**
- * placeholder for the left hand side in a reduce operation.
- *
- * For a parser with a rule like this:
- * <pre>
- * rule(A) ::= B. { A = 1; }
- * </pre>
- *
- * The parser will translate to something like:
- *
- * <code>
- * function yy_r0(){$this->_retvalue = 1;}
- * </code>
- */
- private $_retvalue;
-
- /**
- * Perform a reduce action and the shift that must immediately
- * follow the reduce.
- *
- * For a rule such as:
- *
- * <pre>
- * A ::= B blah C. { dosomething(); }
- * </pre>
- *
- * This function will first call the action, if any, ("dosomething();" in our
- * example), and then it will pop three states from the stack,
- * one for each entry on the right-hand side of the expression
- * (B, blah, and C in our example rule), and then push the result of the action
- * back on to the stack with the resulting state reduced to (as described in the .out
- * file)
- * @param int Number of the rule by which to reduce
- */
- function yy_reduce($yyruleno)
- {
- //int $yygoto; /* The next state */
- //int $yyact; /* The next action */
- //mixed $yygotominor; /* The LHS of the rule reduced */
- //TPC_yyStackEntry $yymsp; /* The top of the parser's stack */
- //int $yysize; /* Amount to pop the stack */
- $yymsp = $this->yystack[$this->yyidx];
- if (self::$yyTraceFILE && $yyruleno >= 0
- && $yyruleno < count(self::$yyRuleName)) {
- fprintf(self::$yyTraceFILE, "%sReduce (%d) [%s].\n",
- self::$yyTracePrompt, $yyruleno,
- self::$yyRuleName[$yyruleno]);
- }
-
- $this->_retvalue = $yy_lefthand_side = null;
- if (array_key_exists($yyruleno, self::$yyReduceMap)) {
- // call the action
- $this->_retvalue = null;
- $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}();
- $yy_lefthand_side = $this->_retvalue;
- }
- $yygoto = self::$yyRuleInfo[$yyruleno]['lhs'];
- $yysize = self::$yyRuleInfo[$yyruleno]['rhs'];
- $this->yyidx -= $yysize;
- for($i = $yysize; $i; $i--) {
- // pop all of the right-hand side parameters
- array_pop($this->yystack);
- }
- $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto);
- if ($yyact < self::YYNSTATE) {
- /* If we are not debugging and the reduce action popped at least
- ** one element off the stack, then we can push the new element back
- ** onto the stack here, and skip the stack overflow test in yy_shift().
- ** That gives a significant speed improvement. */
- if (!self::$yyTraceFILE && $yysize) {
- $this->yyidx++;
- $x = new TPC_yyStackEntry;
- $x->stateno = $yyact;
- $x->major = $yygoto;
- $x->minor = $yy_lefthand_side;
- $this->yystack[$this->yyidx] = $x;
- } else {
- $this->yy_shift($yyact, $yygoto, $yy_lefthand_side);
- }
- } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) {
- $this->yy_accept();
- }
- }
-
- /**
- * The following code executes when the parse fails
- *
- * Code from %parse_fail is inserted here
- */
- function yy_parse_failed()
- {
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sFail!\n", self::$yyTracePrompt);
- }
- while ($this->yyidx >= 0) {
- $this->yy_pop_parser_stack();
- }
- /* Here code is inserted which will be executed whenever the
- ** parser fails */
- }
-
- /**
- * The following code executes when a syntax error first occurs.
- *
- * %syntax_error code is inserted here
- * @param int The major type of the error token
- * @param mixed The minor type of the error token
- */
- function yy_syntax_error($yymajor, $TOKEN)
- {
-#line 52 "smarty_internal_configfileparser.y"
-
- $this->internalError = true;
- $this->yymajor = $yymajor;
- $this->compiler->trigger_config_file_error();
-#line 1005 "smarty_internal_configfileparser.php"
- }
-
- /**
- * The following is executed when the parser accepts
- *
- * %parse_accept code is inserted here
- */
- function yy_accept()
- {
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sAccept!\n", self::$yyTracePrompt);
- }
- while ($this->yyidx >= 0) {
- $stack = $this->yy_pop_parser_stack();
- }
- /* Here code is inserted which will be executed whenever the
- ** parser accepts */
-#line 44 "smarty_internal_configfileparser.y"
-
- $this->successful = !$this->internalError;
- $this->internalError = false;
- $this->retvalue = $this->_retvalue;
- //echo $this->retvalue."\n\n";
-#line 1030 "smarty_internal_configfileparser.php"
- }
-
- /**
- * The main parser program.
- *
- * The first argument is the major token number. The second is
- * the token value string as scanned from the input.
- *
- * @param int the token number
- * @param mixed the token value
- * @param mixed any extra arguments that should be passed to handlers
- */
- function doParse($yymajor, $yytokenvalue)
- {
-// $yyact; /* The parser action. */
-// $yyendofinput; /* True if we are at the end of input */
- $yyerrorhit = 0; /* True if yymajor has invoked an error */
-
- /* (re)initialize the parser, if necessary */
- if ($this->yyidx === null || $this->yyidx < 0) {
- /* if ($yymajor == 0) return; // not sure why this was here... */
- $this->yyidx = 0;
- $this->yyerrcnt = -1;
- $x = new TPC_yyStackEntry;
- $x->stateno = 0;
- $x->major = 0;
- $this->yystack = array();
- array_push($this->yystack, $x);
- }
- $yyendofinput = ($yymajor==0);
-
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sInput %s\n",
- self::$yyTracePrompt, $this->yyTokenName[$yymajor]);
- }
-
- do {
- $yyact = $this->yy_find_shift_action($yymajor);
- if ($yymajor < self::YYERRORSYMBOL &&
- !$this->yy_is_expected_token($yymajor)) {
- // force a syntax error
- $yyact = self::YY_ERROR_ACTION;
- }
- if ($yyact < self::YYNSTATE) {
- $this->yy_shift($yyact, $yymajor, $yytokenvalue);
- $this->yyerrcnt--;
- if ($yyendofinput && $this->yyidx >= 0) {
- $yymajor = 0;
- } else {
- $yymajor = self::YYNOCODE;
- }
- } elseif ($yyact < self::YYNSTATE + self::YYNRULE) {
- $this->yy_reduce($yyact - self::YYNSTATE);
- } elseif ($yyact == self::YY_ERROR_ACTION) {
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sSyntax Error!\n",
- self::$yyTracePrompt);
- }
- if (self::YYERRORSYMBOL) {
- /* A syntax error has occurred.
- ** The response to an error depends upon whether or not the
- ** grammar defines an error token "ERROR".
- **
- ** This is what we do if the grammar does define ERROR:
- **
- ** * Call the %syntax_error function.
- **
- ** * Begin popping the stack until we enter a state where
- ** it is legal to shift the error symbol, then shift
- ** the error symbol.
- **
- ** * Set the error count to three.
- **
- ** * Begin accepting and shifting new tokens. No new error
- ** processing will occur until three tokens have been
- ** shifted successfully.
- **
- */
- if ($this->yyerrcnt < 0) {
- $this->yy_syntax_error($yymajor, $yytokenvalue);
- }
- $yymx = $this->yystack[$this->yyidx]->major;
- if ($yymx == self::YYERRORSYMBOL || $yyerrorhit ){
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sDiscard input token %s\n",
- self::$yyTracePrompt, $this->yyTokenName[$yymajor]);
- }
- $this->yy_destructor($yymajor, $yytokenvalue);
- $yymajor = self::YYNOCODE;
- } else {
- while ($this->yyidx >= 0 &&
- $yymx != self::YYERRORSYMBOL &&
- ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE
- ){
- $this->yy_pop_parser_stack();
- }
- if ($this->yyidx < 0 || $yymajor==0) {
- $this->yy_destructor($yymajor, $yytokenvalue);
- $this->yy_parse_failed();
- $yymajor = self::YYNOCODE;
- } elseif ($yymx != self::YYERRORSYMBOL) {
- $u2 = 0;
- $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2);
- }
- }
- $this->yyerrcnt = 3;
- $yyerrorhit = 1;
- } else {
- /* YYERRORSYMBOL is not defined */
- /* This is what we do if the grammar does not define ERROR:
- **
- ** * Report an error message, and throw away the input token.
- **
- ** * If the input token is $, then fail the parse.
- **
- ** As before, subsequent error messages are suppressed until
- ** three input tokens have been successfully shifted.
- */
- if ($this->yyerrcnt <= 0) {
- $this->yy_syntax_error($yymajor, $yytokenvalue);
- }
- $this->yyerrcnt = 3;
- $this->yy_destructor($yymajor, $yytokenvalue);
- if ($yyendofinput) {
- $this->yy_parse_failed();
- }
- $yymajor = self::YYNOCODE;
- }
- } else {
- $this->yy_accept();
- $yymajor = self::YYNOCODE;
- }
- } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0);
- }
-}
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_data.php b/includes/Smarty/sysplugins/smarty_internal_data.php
new file mode 100755
index 0000000..5baf3b7
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_data.php
@@ -0,0 +1,551 @@
+<?php
+/**
+ * Smarty Internal Plugin Data
+ *
+ * This file contains the basic classes and methodes for template and variable creation
+ *
+ * @package Smarty
+ * @subpackage Template
+ * @author Uwe Tews
+ */
+
+/**
+ * Base class with template and variable methodes
+ *
+ * @package Smarty
+ * @subpackage Template
+ */
+class Smarty_Internal_Data {
+
+ /**
+ * name of class used for templates
+ *
+ * @var string
+ */
+ public $template_class = 'Smarty_Internal_Template';
+ /**
+ * template variables
+ *
+ * @var array
+ */
+ public $tpl_vars = array();
+ /**
+ * parent template (if any)
+ *
+ * @var Smarty_Internal_Template
+ */
+ public $parent = null;
+ /**
+ * configuration settings
+ *
+ * @var array
+ */
+ public $config_vars = array();
+
+ /**
+ * assigns a Smarty variable
+ *
+ * @param array|string $tpl_var the template variable name(s)
+ * @param mixed $value the value to assign
+ * @param boolean $nocache if true any output of this variable will be not cached
+ * @param boolean $scope the scope the variable will have (local,parent or root)
+ * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+ */
+ public function assign($tpl_var, $value = null, $nocache = false)
+ {
+ if (is_array($tpl_var)) {
+ foreach ($tpl_var as $_key => $_val) {
+ if ($_key != '') {
+ $this->tpl_vars[$_key] = new Smarty_variable($_val, $nocache);
+ }
+ }
+ } else {
+ if ($tpl_var != '') {
+ $this->tpl_vars[$tpl_var] = new Smarty_variable($value, $nocache);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * assigns a global Smarty variable
+ *
+ * @param string $varname the global variable name
+ * @param mixed $value the value to assign
+ * @param boolean $nocache if true any output of this variable will be not cached
+ * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+ */
+ public function assignGlobal($varname, $value = null, $nocache = false)
+ {
+ if ($varname != '') {
+ Smarty::$global_tpl_vars[$varname] = new Smarty_variable($value, $nocache);
+ }
+
+ return $this;
+ }
+ /**
+ * assigns values to template variables by reference
+ *
+ * @param string $tpl_var the template variable name
+ * @param mixed $ &$value the referenced value to assign
+ * @param boolean $nocache if true any output of this variable will be not cached
+ * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+ */
+ public function assignByRef($tpl_var, &$value, $nocache = false)
+ {
+ if ($tpl_var != '') {
+ $this->tpl_vars[$tpl_var] = new Smarty_variable(null, $nocache);
+ $this->tpl_vars[$tpl_var]->value = &$value;
+ }
+
+ return $this;
+ }
+
+ /**
+ * appends values to template variables
+ *
+ * @param array|string $tpl_var the template variable name(s)
+ * @param mixed $value the value to append
+ * @param boolean $merge flag if array elements shall be merged
+ * @param boolean $nocache if true any output of this variable will be not cached
+ * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+ */
+ public function append($tpl_var, $value = null, $merge = false, $nocache = false)
+ {
+ if (is_array($tpl_var)) {
+ // $tpl_var is an array, ignore $value
+ foreach ($tpl_var as $_key => $_val) {
+ if ($_key != '') {
+ if (!isset($this->tpl_vars[$_key])) {
+ $tpl_var_inst = $this->getVariable($_key, null, true, false);
+ if ($tpl_var_inst instanceof Undefined_Smarty_Variable) {
+ $this->tpl_vars[$_key] = new Smarty_variable(null, $nocache);
+ } else {
+ $this->tpl_vars[$_key] = clone $tpl_var_inst;
+ }
+ }
+ if (!(is_array($this->tpl_vars[$_key]->value) || $this->tpl_vars[$_key]->value instanceof ArrayAccess)) {
+ settype($this->tpl_vars[$_key]->value, 'array');
+ }
+ if ($merge && is_array($_val)) {
+ foreach($_val as $_mkey => $_mval) {
+ $this->tpl_vars[$_key]->value[$_mkey] = $_mval;
+ }
+ } else {
+ $this->tpl_vars[$_key]->value[] = $_val;
+ }
+ }
+ }
+ } else {
+ if ($tpl_var != '' && isset($value)) {
+ if (!isset($this->tpl_vars[$tpl_var])) {
+ $tpl_var_inst = $this->getVariable($tpl_var, null, true, false);
+ if ($tpl_var_inst instanceof Undefined_Smarty_Variable) {
+ $this->tpl_vars[$tpl_var] = new Smarty_variable(null, $nocache);
+ } else {
+ $this->tpl_vars[$tpl_var] = clone $tpl_var_inst;
+ }
+ }
+ if (!(is_array($this->tpl_vars[$tpl_var]->value) || $this->tpl_vars[$tpl_var]->value instanceof ArrayAccess)) {
+ settype($this->tpl_vars[$tpl_var]->value, 'array');
+ }
+ if ($merge && is_array($value)) {
+ foreach($value as $_mkey => $_mval) {
+ $this->tpl_vars[$tpl_var]->value[$_mkey] = $_mval;
+ }
+ } else {
+ $this->tpl_vars[$tpl_var]->value[] = $value;
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * appends values to template variables by reference
+ *
+ * @param string $tpl_var the template variable name
+ * @param mixed &$value the referenced value to append
+ * @param boolean $merge flag if array elements shall be merged
+ * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+ */
+ public function appendByRef($tpl_var, &$value, $merge = false)
+ {
+ if ($tpl_var != '' && isset($value)) {
+ if (!isset($this->tpl_vars[$tpl_var])) {
+ $this->tpl_vars[$tpl_var] = new Smarty_variable();
+ }
+ if (!is_array($this->tpl_vars[$tpl_var]->value)) {
+ settype($this->tpl_vars[$tpl_var]->value, 'array');
+ }
+ if ($merge && is_array($value)) {
+ foreach($value as $_key => $_val) {
+ $this->tpl_vars[$tpl_var]->value[$_key] = &$value[$_key];
+ }
+ } else {
+ $this->tpl_vars[$tpl_var]->value[] = &$value;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns a single or all template variables
+ *
+ * @param string $varname variable name or null
+ * @param string $_ptr optional pointer to data object
+ * @param boolean $search_parents include parent templates?
+ * @return string variable value or or array of variables
+ */
+ public function getTemplateVars($varname = null, $_ptr = null, $search_parents = true)
+ {
+ if (isset($varname)) {
+ $_var = $this->getVariable($varname, $_ptr, $search_parents, false);
+ if (is_object($_var)) {
+ return $_var->value;
+ } else {
+ return null;
+ }
+ } else {
+ $_result = array();
+ if ($_ptr === null) {
+ $_ptr = $this;
+ } while ($_ptr !== null) {
+ foreach ($_ptr->tpl_vars AS $key => $var) {
+ if (!array_key_exists($key, $_result)) {
+ $_result[$key] = $var->value;
+ }
+ }
+ // not found, try at parent
+ if ($search_parents) {
+ $_ptr = $_ptr->parent;
+ } else {
+ $_ptr = null;
+ }
+ }
+ if ($search_parents && isset(Smarty::$global_tpl_vars)) {
+ foreach (Smarty::$global_tpl_vars AS $key => $var) {
+ if (!array_key_exists($key, $_result)) {
+ $_result[$key] = $var->value;
+ }
+ }
+ }
+ return $_result;
+ }
+ }
+
+ /**
+ * clear the given assigned template variable.
+ *
+ * @param string|array $tpl_var the template variable(s) to clear
+ * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+ */
+ public function clearAssign($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]);
+ }
+
+ return $this;
+ }
+
+ /**
+ * clear all the assigned template variables.
+ * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+ */
+ public function clearAllAssign()
+ {
+ $this->tpl_vars = array();
+ return $this;
+ }
+
+ /**
+ * load a config file, optionally load just selected sections
+ *
+ * @param string $config_file filename
+ * @param mixed $sections array of section names, single section or null
+ * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+ */
+ public function configLoad($config_file, $sections = null)
+ {
+ // load Config class
+ $config = new Smarty_Internal_Config($config_file, $this->smarty, $this);
+ $config->loadConfigVars($sections);
+ return $this;
+ }
+
+ /**
+ * gets the object of a Smarty variable
+ *
+ * @param string $variable the name of the Smarty variable
+ * @param object $_ptr optional pointer to data object
+ * @param boolean $search_parents search also in parent data
+ * @return object the object of the variable
+ */
+ public function getVariable($variable, $_ptr = null, $search_parents = true, $error_enable = true)
+ {
+ if ($_ptr === null) {
+ $_ptr = $this;
+ } while ($_ptr !== null) {
+ if (isset($_ptr->tpl_vars[$variable])) {
+ // found it, return it
+ return $_ptr->tpl_vars[$variable];
+ }
+ // not found, try at parent
+ if ($search_parents) {
+ $_ptr = $_ptr->parent;
+ } else {
+ $_ptr = null;
+ }
+ }
+ if (isset(Smarty::$global_tpl_vars[$variable])) {
+ // found it, return it
+ return Smarty::$global_tpl_vars[$variable];
+ }
+ if ($this->smarty->error_unassigned && $error_enable) {
+ // force a notice
+ $x = $$variable;
+ }
+ return new Undefined_Smarty_Variable;
+ }
+
+ /**
+ * gets a config variable
+ *
+ * @param string $variable the name of the config variable
+ * @return mixed the value of the config variable
+ */
+ public function getConfigVariable($variable, $error_enable = true)
+ {
+ $_ptr = $this;
+ while ($_ptr !== null) {
+ if (isset($_ptr->config_vars[$variable])) {
+ // found it, return it
+ return $_ptr->config_vars[$variable];
+ }
+ // not found, try at parent
+ $_ptr = $_ptr->parent;
+ }
+ if ($this->smarty->error_unassigned && $error_enable) {
+ // force a notice
+ $x = $$variable;
+ }
+ return null;
+ }
+
+ /**
+ * gets a stream variable
+ *
+ * @param string $variable the stream of the variable
+ * @return mixed the value of the stream variable
+ */
+ public function getStreamVariable($variable)
+ {
+ $_result = '';
+ $fp = fopen($variable, 'r+');
+ if ($fp) {
+ while (!feof($fp) && ($current_line = fgets($fp)) !== false ) {
+ $_result .= $current_line;
+ }
+ fclose($fp);
+ return $_result;
+ }
+
+ if ($this->smarty->error_unassigned) {
+ throw new SmartyException('Undefined stream variable "' . $variable . '"');
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Returns a single or all config variables
+ *
+ * @param string $varname variable name or null
+ * @return string variable value or or array of variables
+ */
+ public function getConfigVars($varname = null, $search_parents = true)
+ {
+ $_ptr = $this;
+ $var_array = array();
+ while ($_ptr !== null) {
+ if (isset($varname)) {
+ if (isset($_ptr->config_vars[$varname])) {
+ return $_ptr->config_vars[$varname];
+ }
+ } else {
+ $var_array = array_merge($_ptr->config_vars, $var_array);
+ }
+ // not found, try at parent
+ if ($search_parents) {
+ $_ptr = $_ptr->parent;
+ } else {
+ $_ptr = null;
+ }
+ }
+ if (isset($varname)) {
+ return '';
+ } else {
+ return $var_array;
+ }
+ }
+
+ /**
+ * Deassigns a single or all config variables
+ *
+ * @param string $varname variable name or null
+ * @return Smarty_Internal_Data current Smarty_Internal_Data (or Smarty or Smarty_Internal_Template) instance for chaining
+ */
+ public function clearConfig($varname = null)
+ {
+ if (isset($varname)) {
+ unset($this->config_vars[$varname]);
+ } else {
+ $this->config_vars = array();
+ }
+ return $this;
+ }
+
+}
+
+/**
+ * class for the Smarty data object
+ *
+ * The Smarty data object will hold Smarty variables in the current scope
+ *
+ * @package Smarty
+ * @subpackage Template
+ */
+class Smarty_Data extends Smarty_Internal_Data {
+
+ /**
+ * Smarty object
+ *
+ * @var Smarty
+ */
+ public $smarty = null;
+
+ /**
+ * create Smarty data object
+ *
+ * @param Smarty|array $_parent parent template
+ * @param Smarty $smarty global smarty instance
+ */
+ public function __construct ($_parent = null, $smarty = null)
+ {
+ $this->smarty = $smarty;
+ if (is_object($_parent)) {
+ // when object set up back pointer
+ $this->parent = $_parent;
+ } elseif (is_array($_parent)) {
+ // set up variable values
+ foreach ($_parent as $_key => $_val) {
+ $this->tpl_vars[$_key] = new Smarty_variable($_val);
+ }
+ } elseif ($_parent != null) {
+ throw new SmartyException("Wrong type for template variables");
+ }
+ }
+
+}
+
+/**
+ * class for the Smarty variable object
+ *
+ * This class defines the Smarty variable object
+ *
+ * @package Smarty
+ * @subpackage Template
+ */
+class Smarty_Variable {
+
+ /**
+ * template variable
+ *
+ * @var mixed
+ */
+ public $value = null;
+ /**
+ * if true any output of this variable will be not cached
+ *
+ * @var boolean
+ */
+ public $nocache = false;
+ /**
+ * the scope the variable will have (local,parent or root)
+ *
+ * @var int
+ */
+ public $scope = Smarty::SCOPE_LOCAL;
+
+ /**
+ * create Smarty variable object
+ *
+ * @param mixed $value the value to assign
+ * @param boolean $nocache if true any output of this variable will be not cached
+ * @param int $scope the scope the variable will have (local,parent or root)
+ */
+ public function __construct($value = null, $nocache = false, $scope = Smarty::SCOPE_LOCAL)
+ {
+ $this->value = $value;
+ $this->nocache = $nocache;
+ $this->scope = $scope;
+ }
+
+ /**
+ * <<magic>> String conversion
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return (string) $this->value;
+ }
+
+}
+
+/**
+ * class for undefined variable object
+ *
+ * This class defines an object for undefined variable handling
+ *
+ * @package Smarty
+ * @subpackage Template
+ */
+class Undefined_Smarty_Variable {
+
+ /**
+ * Returns FALSE for 'nocache' and NULL otherwise.
+ *
+ * @param string $name
+ * @return bool
+ */
+ public function __get($name)
+ {
+ if ($name == 'nocache') {
+ return false;
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Always returns an empty string.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return "";
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_debug.php b/includes/Smarty/sysplugins/smarty_internal_debug.php
deleted file mode 100644
index 9e5f7be..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_debug.php
+++ /dev/null
@@ -1,123 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Debug
-*
-* Class to collect data for the Smarty Debugging Consol
-*
-* @package Smarty
-* @subpackage Debug
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Debug Class
-*/
-class Smarty_Internal_Debug extends Smarty_Internal_TemplateBase {
- // template data
- static $template_data = array();
-
- /**
- * Start logging of compile time
- */
- public static function start_compile($template)
- {
- $key = self::get_key($template);
- self::$template_data[$key]['start_time'] = self::get_time();
- }
-
- /**
- * End logging of compile time
- */
- public static function end_compile($template)
- {
- $key = self::get_key($template);
- self::$template_data[$key]['compile_time'] += self::get_time() - self::$template_data[$key]['start_time'];
- }
-
- /**
- * Start logging of render time
- */
- public static function start_render($template)
- {
- $key = self::get_key($template);
- self::$template_data[$key]['start_time'] = self::get_time();
- }
-
- /**
- * End logging of compile time
- */
- public static function end_render($template)
- {
- $key = self::get_key($template);
- self::$template_data[$key]['render_time'] += self::get_time() - self::$template_data[$key]['start_time'];
- }
-
- /**
- * Start logging of cache time
- */
- public static function start_cache($template)
- {
- $key = self::get_key($template);
- self::$template_data[$key]['start_time'] = self::get_time();
- }
-
- /**
- * End logging of cache time
- */
- public static function end_cache($template)
- {
- $key = self::get_key($template);
- self::$template_data[$key]['cache_time'] += self::get_time() - self::$template_data[$key]['start_time'];
- }
- /**
- * Opens a window for the Smarty Debugging Consol and display the data
- */
- public static function display_debug($smarty)
- {
- // prepare information of assigned variables
- $_assigned_vars = $smarty->tpl_vars;
- ksort($_assigned_vars);
- $_config_vars = $smarty->config_vars;
- ksort($_config_vars);
- $_template = new Smarty_Template ($smarty->debug_tpl, $smarty);
- $_template->caching = false;
- $_template->force_compile = false;
- $_template->security = false;
- $_template->assign('template_data', self::$template_data);
- $_template->assign('assigned_vars', $_assigned_vars);
- $_template->assign('config_vars', $_config_vars);
- $_template->assign('execution_time', $smarty->_get_time() - $smarty->start_time);
- echo $smarty->fetch($_template);
- }
-
- /**
- * get_key
- */
- static function get_key($template)
- {
- $key = 'F' . abs(crc32($template->getTemplateFilepath()));
- if (isset(self::$template_data[$key])) {
- return $key;
- } else {
- self::$template_data[$key]['name'] = $template->getTemplateFilepath();
- self::$template_data[$key]['compile_time'] = 0;
- self::$template_data[$key]['render_time'] = 0;
- self::$template_data[$key]['cache_time'] = 0;
- return $key;
- }
- }
-
- /**
- * return current time
- *
- * @returns double current time
- */
- static function get_time()
- {
- $_mtime = microtime();
- $_mtime = explode(" ", $_mtime);
- return (double)($_mtime[1]) + (double)($_mtime[0]);
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_filter_handler.php b/includes/Smarty/sysplugins/smarty_internal_filter_handler.php
new file mode 100755
index 0000000..c9370e1
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_filter_handler.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ * Smarty Internal Plugin Filter Handler
+ *
+ * Smarty filter handler class
+ *
+ * @package Smarty
+ * @subpackage PluginsInternal
+ * @author Uwe Tews
+ */
+
+/**
+ * Class for filter processing
+ *
+ * @package Smarty
+ * @subpackage PluginsInternal
+ */
+class Smarty_Internal_Filter_Handler {
+
+ /**
+ * Run filters over content
+ *
+ * The filters will be lazy loaded if required
+ * class name format: Smarty_FilterType_FilterName
+ * plugin filename format: filtertype.filtername.php
+ * Smarty2 filter plugins could be used
+ *
+ * @param string $type the type of filter ('pre','post','output') which shall run
+ * @param string $content the content which shall be processed by the filters
+ * @param Smarty_Internal_Template $template template object
+ * @return string the filtered content
+ */
+ public static function runFilter($type, $content, Smarty_Internal_Template $template)
+ {
+ $output = $content;
+ // loop over autoload filters of specified type
+ if (!empty($template->smarty->autoload_filters[$type])) {
+ foreach ((array)$template->smarty->autoload_filters[$type] as $name) {
+ $plugin_name = "Smarty_{$type}filter_{$name}";
+ if ($template->smarty->loadPlugin($plugin_name)) {
+ if (function_exists($plugin_name)) {
+ // use loaded Smarty2 style plugin
+ $output = $plugin_name($output, $template);
+ } elseif (class_exists($plugin_name, false)) {
+ // loaded class of filter plugin
+ $output = call_user_func(array($plugin_name, 'execute'), $output, $template);
+ }
+ } else {
+ // nothing found, throw exception
+ throw new SmartyException("Unable to load filter {$plugin_name}");
+ }
+ }
+ }
+ // loop over registerd filters of specified type
+ if (!empty($template->smarty->registered_filters[$type])) {
+ foreach ($template->smarty->registered_filters[$type] as $key => $name) {
+ if (is_array($template->smarty->registered_filters[$type][$key])) {
+ $output = call_user_func($template->smarty->registered_filters[$type][$key], $output, $template);
+ } else {
+ $output = $template->smarty->registered_filters[$type][$key]($output, $template);
+ }
+ }
+ }
+ // return filtered output
+ return $output;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_function_call_handler.php b/includes/Smarty/sysplugins/smarty_internal_function_call_handler.php
new file mode 100755
index 0000000..010d635
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_function_call_handler.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Smarty Internal Plugin Function Call Handler
+ *
+ * @package Smarty
+ * @subpackage PluginsInternal
+ * @author Uwe Tews
+ */
+
+/**
+ * This class does call function defined with the {function} tag
+ *
+ * @package Smarty
+ * @subpackage PluginsInternal
+ */
+class Smarty_Internal_Function_Call_Handler {
+
+ /**
+ * This function handles calls to template functions defined by {function}
+ * It does create a PHP function at the first call
+ *
+ * @param string $_name template function name
+ * @param Smarty_Internal_Template $_template template object
+ * @param array $_params Smarty variables passed as call parameter
+ * @param string $_hash nocache hash value
+ * @param bool $_nocache nocache flag
+ */
+ public static function call($_name, Smarty_Internal_Template $_template, $_params, $_hash, $_nocache)
+ {
+ if ($_nocache) {
+ $_function = "smarty_template_function_{$_name}_nocache";
+ } else {
+ $_function = "smarty_template_function_{$_hash}_{$_name}";
+ }
+ if (!is_callable($_function)) {
+ $_code = "function {$_function}(\$_smarty_tpl,\$params) {
+ \$saved_tpl_vars = \$_smarty_tpl->tpl_vars;
+ foreach (\$_smarty_tpl->smarty->template_functions['{$_name}']['parameter'] as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);};
+ foreach (\$params as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);}?>";
+ if ($_nocache) {
+ $_code .= preg_replace(array("!<\?php echo \\'/\*%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/|/\*/%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/\\';\?>!",
+ "!\\\'!"), array('', "'"), $_template->smarty->template_functions[$_name]['compiled']);
+ $_template->smarty->template_functions[$_name]['called_nocache'] = true;
+ } else {
+ $_code .= preg_replace("/{$_template->smarty->template_functions[$_name]['nocache_hash']}/", $_template->properties['nocache_hash'], $_template->smarty->template_functions[$_name]['compiled']);
+ }
+ $_code .= "<?php \$_smarty_tpl->tpl_vars = \$saved_tpl_vars;}";
+ eval($_code);
+ }
+ $_function($_template, $_params);
+ }
+
+}
+
+?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_get_include_path.php b/includes/Smarty/sysplugins/smarty_internal_get_include_path.php
new file mode 100755
index 0000000..518c406
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_get_include_path.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Smarty read include path plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsInternal
+ * @author Monte Ohrt
+ */
+
+/**
+ * Smarty Internal Read Include Path Class
+ *
+ * @package Smarty
+ * @subpackage PluginsInternal
+ */
+class Smarty_Internal_Get_Include_Path {
+
+ /**
+ * Return full file path from PHP include_path
+ *
+ * @param string $filepath filepath
+ * @return string|boolean full filepath or false
+ */
+ public static function getIncludePath($filepath)
+ {
+ static $_include_path = null;
+
+ if (function_exists('stream_resolve_include_path')) {
+ // available since PHP 5.3.2
+ return stream_resolve_include_path($filepath);
+ }
+
+ if ($_include_path === null) {
+ $_include_path = explode(PATH_SEPARATOR, get_include_path());
+ }
+
+ foreach ($_include_path as $_path) {
+ if (file_exists($_path . DS . $filepath)) {
+ return $_path . DS . $filepath;
+ }
+ }
+
+ return false;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_nocache_insert.php b/includes/Smarty/sysplugins/smarty_internal_nocache_insert.php
new file mode 100755
index 0000000..faae49a
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_nocache_insert.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Smarty Internal Plugin Nocache Insert
+ *
+ * Compiles the {insert} tag into the cache file
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
+/**
+ * Smarty Internal Plugin Compile Insert Class
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ */
+class Smarty_Internal_Nocache_Insert {
+
+ /**
+ * Compiles code for the {insert} tag into cache file
+ *
+ * @param string $_function insert function name
+ * @param array $_attr array with parameter
+ * @param Smarty_Internal_Template $_template template object
+ * @param string $_script script name to load or 'null'
+ * @param string $_assign optional variable name
+ * @return string compiled code
+ */
+ public static function compile($_function, $_attr, $_template, $_script, $_assign = null)
+ {
+ $_output = '<?php ';
+ if ($_script != 'null') {
+ // script which must be included
+ // code for script file loading
+ $_output .= "require_once '{$_script}';";
+ }
+ // call insert
+ if (isset($_assign)) {
+ $_output .= "\$_smarty_tpl->assign('{$_assign}' , {$_function} (" . var_export($_attr, true) . ",\$_smarty_tpl), true);?>";
+ } else {
+ $_output .= "echo {$_function}(" . var_export($_attr, true) . ",\$_smarty_tpl);?>";
+ }
+ $_tpl = $_template;
+ while ($_tpl->parent instanceof Smarty_Internal_Template) {
+ $_tpl = $_tpl->parent;
+ }
+ return "/*%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/" . $_output . "/*/%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/";
+ }
+
+}
+
+?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_parsetree.php b/includes/Smarty/sysplugins/smarty_internal_parsetree.php
new file mode 100755
index 0000000..c9fb1f7
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_parsetree.php
@@ -0,0 +1,395 @@
+<?php
+/**
+ * Smarty Internal Plugin Templateparser Parsetrees
+ *
+ * These are classes to build parsetrees in the template parser
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Thue Kristensen
+ * @author Uwe Tews
+ */
+
+/**
+ * @package Smarty
+ * @subpackage Compiler
+ * @ignore
+ */
+abstract class _smarty_parsetree {
+
+ /**
+ * Parser object
+ * @var object
+ */
+ public $parser;
+ /**
+ * Buffer content
+ * @var mixed
+ */
+ public $data;
+
+ /**
+ * Return buffer
+ *
+ * @return string buffer content
+ */
+ abstract public function to_smarty_php();
+
+}
+
+/**
+ * A complete smarty tag.
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @ignore
+ */
+class _smarty_tag extends _smarty_parsetree {
+
+ /**
+ * Saved block nesting level
+ * @var int
+ */
+ public $saved_block_nesting;
+
+ /**
+ * Create parse tree buffer for Smarty tag
+ *
+ * @param object $parser parser object
+ * @param string $data content
+ */
+ public function __construct($parser, $data)
+ {
+ $this->parser = $parser;
+ $this->data = $data;
+ $this->saved_block_nesting = $parser->block_nesting_level;
+ }
+
+ /**
+ * Return buffer content
+ *
+ * @return string content
+ */
+ public function to_smarty_php()
+ {
+ return $this->data;
+ }
+
+ /**
+ * Return complied code that loads the evaluated outout of buffer content into a temporary variable
+ *
+ * @return string template code
+ */
+ public function assign_to_var()
+ {
+ $var = sprintf('$_tmp%d', ++$this->parser->prefix_number);
+ $this->parser->compiler->prefix_code[] = sprintf('<?php ob_start();?>%s<?php %s=ob_get_clean();?>', $this->data, $var);
+ return $var;
+ }
+
+}
+
+/**
+ * Code fragment inside a tag.
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @ignore
+ */
+class _smarty_code extends _smarty_parsetree {
+
+
+ /**
+ * Create parse tree buffer for code fragment
+ *
+ * @param object $parser parser object
+ * @param string $data content
+ */
+ public function __construct($parser, $data)
+ {
+ $this->parser = $parser;
+ $this->data = $data;
+ }
+
+ /**
+ * Return buffer content in parentheses
+ *
+ * @return string content
+ */
+ public function to_smarty_php()
+ {
+ return sprintf("(%s)", $this->data);
+ }
+
+}
+
+/**
+ * Double quoted string inside a tag.
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @ignore
+ */
+class _smarty_doublequoted extends _smarty_parsetree {
+
+ /**
+ * Create parse tree buffer for double quoted string subtrees
+ *
+ * @param object $parser parser object
+ * @param _smarty_parsetree $subtree parsetree buffer
+ */
+ public function __construct($parser, _smarty_parsetree $subtree)
+ {
+ $this->parser = $parser;
+ $this->subtrees[] = $subtree;
+ if ($subtree instanceof _smarty_tag) {
+ $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);
+ }
+ }
+
+ /**
+ * Append buffer to subtree
+ *
+ * @param _smarty_parsetree $subtree parsetree buffer
+ */
+ public function append_subtree(_smarty_parsetree $subtree)
+ {
+ $last_subtree = count($this->subtrees) - 1;
+ if ($last_subtree >= 0 && $this->subtrees[$last_subtree] instanceof _smarty_tag && $this->subtrees[$last_subtree]->saved_block_nesting < $this->parser->block_nesting_level) {
+ if ($subtree instanceof _smarty_code) {
+ $this->subtrees[$last_subtree]->data .= '<?php echo ' . $subtree->data . ';?>';
+ } elseif ($subtree instanceof _smarty_dq_content) {
+ $this->subtrees[$last_subtree]->data .= '<?php echo "' . $subtree->data . '";?>';
+ } else {
+ $this->subtrees[$last_subtree]->data .= $subtree->data;
+ }
+ } else {
+ $this->subtrees[] = $subtree;
+ }
+ if ($subtree instanceof _smarty_tag) {
+ $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);
+ }
+ }
+
+ /**
+ * Merge subtree buffer content together
+ *
+ * @return string compiled template code
+ */
+ public function to_smarty_php()
+ {
+ $code = '';
+ foreach ($this->subtrees as $subtree) {
+ if ($code !== "") {
+ $code .= ".";
+ }
+ if ($subtree instanceof _smarty_tag) {
+ $more_php = $subtree->assign_to_var();
+ } else {
+ $more_php = $subtree->to_smarty_php();
+ }
+
+ $code .= $more_php;
+
+ if (!$subtree instanceof _smarty_dq_content) {
+ $this->parser->compiler->has_variable_string = true;
+ }
+ }
+ return $code;
+ }
+
+}
+
+/**
+ * Raw chars as part of a double quoted string.
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @ignore
+ */
+class _smarty_dq_content extends _smarty_parsetree {
+
+
+ /**
+ * Create parse tree buffer with string content
+ *
+ * @param object $parser parser object
+ * @param string $data string section
+ */
+ public function __construct($parser, $data)
+ {
+ $this->parser = $parser;
+ $this->data = $data;
+ }
+
+ /**
+ * Return content as double quoted string
+ *
+ * @return string doubled quoted string
+ */
+ public function to_smarty_php()
+ {
+ return '"' . $this->data . '"';
+ }
+
+}
+
+/**
+ * Template element
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @ignore
+ */
+class _smarty_template_buffer extends _smarty_parsetree {
+
+ /**
+ * Array of template elements
+ *
+ * @var array
+ */
+ public $subtrees = Array();
+
+ /**
+ * Create root of parse tree for template elements
+ *
+ * @param object $parser parse object
+ */
+ public function __construct($parser)
+ {
+ $this->parser = $parser;
+ }
+
+ /**
+ * Append buffer to subtree
+ *
+ * @param _smarty_parsetree $subtree
+ */
+ public function append_subtree(_smarty_parsetree $subtree)
+ {
+ $this->subtrees[] = $subtree;
+ }
+
+ /**
+ * Sanitize and merge subtree buffers together
+ *
+ * @return string template code content
+ */
+ public function to_smarty_php()
+ {
+ $code = '';
+ for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) {
+ if ($key + 2 < $cnt) {
+ if ($this->subtrees[$key] instanceof _smarty_linebreak && $this->subtrees[$key + 1] instanceof _smarty_tag && $this->subtrees[$key + 1]->data == '' && $this->subtrees[$key + 2] instanceof _smarty_linebreak) {
+ $key = $key + 1;
+ continue;
+ }
+ if (substr($this->subtrees[$key]->data, -1) == '<' && $this->subtrees[$key + 1]->data == '' && substr($this->subtrees[$key + 2]->data, -1) == '?') {
+ $key = $key + 2;
+ continue;
+ }
+ }
+ if (substr($code, -1) == '<') {
+ $subtree = $this->subtrees[$key]->to_smarty_php();
+ if (substr($subtree, 0, 1) == '?') {
+ $code = substr($code, 0, strlen($code) - 1) . '<<?php ?>?' . substr($subtree, 1);
+ } elseif ($this->parser->asp_tags && substr($subtree, 0, 1) == '%') {
+ $code = substr($code, 0, strlen($code) - 1) . '<<?php ?>%' . substr($subtree, 1);
+ } else {
+ $code .= $subtree;
+ }
+ continue;
+ }
+ if ($this->parser->asp_tags && substr($code, -1) == '%') {
+ $subtree = $this->subtrees[$key]->to_smarty_php();
+ if (substr($subtree, 0, 1) == '>') {
+ $code = substr($code, 0, strlen($code) - 1) . '%<?php ?>>' . substr($subtree, 1);
+ } else {
+ $code .= $subtree;
+ }
+ continue;
+ }
+ if (substr($code, -1) == '?') {
+ $subtree = $this->subtrees[$key]->to_smarty_php();
+ if (substr($subtree, 0, 1) == '>') {
+ $code = substr($code, 0, strlen($code) - 1) . '?<?php ?>>' . substr($subtree, 1);
+ } else {
+ $code .= $subtree;
+ }
+ continue;
+ }
+ $code .= $this->subtrees[$key]->to_smarty_php();
+ }
+ return $code;
+ }
+
+}
+
+/**
+ * template text
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @ignore
+ */
+class _smarty_text extends _smarty_parsetree {
+
+
+ /**
+ * Create template text buffer
+ *
+ * @param object $parser parser object
+ * @param string $data text
+ */
+ public function __construct($parser, $data)
+ {
+ $this->parser = $parser;
+ $this->data = $data;
+ }
+
+ /**
+ * Return buffer content
+ *
+ * @return strint text
+ */
+ public function to_smarty_php()
+ {
+ return $this->data;
+ }
+
+}
+
+/**
+ * template linebreaks
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @ignore
+ */
+class _smarty_linebreak extends _smarty_parsetree {
+
+ /**
+ * Create buffer with linebreak content
+ *
+ * @param object $parser parser object
+ * @param string $data linebreak string
+ */
+ public function __construct($parser, $data)
+ {
+ $this->parser = $parser;
+ $this->data = $data;
+ }
+
+ /**
+ * Return linebrak
+ *
+ * @return string linebreak
+ */
+ public function to_smarty_php()
+ {
+ return $this->data;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_plugin_handler.php b/includes/Smarty/sysplugins/smarty_internal_plugin_handler.php
deleted file mode 100644
index 367382c..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_plugin_handler.php
+++ /dev/null
@@ -1,104 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Handler
-*
-* @package Smarty
-* @subpackage PluginsInternal
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Handler Class
-*/
-class Smarty_Internal_Plugin_Handler {
- function __construct($smarty)
- {
- $this->smarty = $smarty;
- }
- /**
- * Call a Smarty plugin
- *
- * @param string $name block function name
- * @param array $args $args[0] = array of plugin attributes and $args[1] = plugin types to search for
- */
- public function __call($name, $args)
- {
- if ($this->loadSmartyPlugin($name, $args[1])) {
- // call plugin
- return call_user_func_array($this->smarty->registered_plugins[$name][1], $args[0]);
- } else {
- // plugin not found
- throw new Exception("Unable to load plugin {$name}");
- }
- }
- public function executeModifier($name, $args, $check_array)
- {
- if ($this->loadSmartyPlugin($name, 'modifier')) {
- // call plugin
- if (!$check_array || !is_array($args[0])) {
- return call_user_func_array($this->smarty->registered_plugins[$name][1], $args);
- } else {
- $args0 = $args[0];
- foreach ($args0 as $key => $arg0) {
- $args[0] = $arg0;
- $result[$key] = call_user_func_array($this->smarty->registered_plugins[$name][1], $args);
- }
- return $result;
- }
- } elseif (is_callable($name)) {
- if (!$check_array || !is_array($args[0])) {
- return call_user_func_array($name, $args);
- } else {
- $args0 = $args[0];
- foreach ($args0 as $key => $arg0) {
- $args[0] = $arg0;
- $result[$key] = call_user_func_array($name, $args);
- }
- return $result;
- }
- } else {
- // plugin not found
- throw new Exception("Unable to load plugin {$name}");
- }
- }
- /**
- * Lazy loads plugin files
- * class name format: Smarty_PluginType_FuncName
- * plugin filename format: plugintype.funcname.php
- *
- * @param string $name plugin name
- * @param array $type array of plugin types to search for
- */
- public function loadSmartyPlugin($name, $type)
- {
- // load plugin if missing
- if (isset($this->smarty->registered_plugins[$name])) {
- return true;
- } else {
- foreach ((array)$type as $plugin_type) {
- $plugin = 'smarty_' . $plugin_type . '_' . $name;
- if ($this->smarty->loadPlugin($plugin)) {
- if (class_exists($plugin, false)) {
- $plugin = array(new $plugin, 'execute');
- }
- if (is_callable($plugin)) {
- $this->smarty->registered_plugins[$name] = array($plugin_type, $plugin, true);
- return true;
- } else {
- throw new Exception("Plugin \"{$name}\" not callable");
- }
- }
- }
- }
- if (!empty($this->smarty->default_plugin_handler_func)) {
- if (!is_callable($this->smarty->default_plugin_handler_func)) {
- throw new Exception("Default template handler not callable");
- } else {
- return call_user_func_array($this->smarty->default_plugin_handler_func, array($name, $type, &$this));
- }
- }
- return false;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_resource_eval.php b/includes/Smarty/sysplugins/smarty_internal_resource_eval.php
new file mode 100755
index 0000000..cf2ec3e
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_resource_eval.php
@@ -0,0 +1,94 @@
+<?php
+/**
+ * Smarty Internal Plugin Resource Eval
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Uwe Tews
+ * @author Rodney Rehm
+ */
+
+/**
+ * Smarty Internal Plugin Resource Eval
+ *
+ * Implements the strings as resource for Smarty template
+ *
+ * {@internal unlike string-resources the compiled state of eval-resources is NOT saved for subsequent access}}
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ */
+class Smarty_Internal_Resource_Eval extends Smarty_Resource_Recompiled {
+
+ /**
+ * populate Source Object with meta data from Resource
+ *
+ * @param Smarty_Template_Source $source source object
+ * @param Smarty_Internal_Template $_template template object
+ * @return void
+ */
+ public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
+ {
+ $source->uid = $source->filepath = sha1($source->name);
+ $source->timestamp = false;
+ $source->exists = true;
+ }
+
+ /**
+ * Load template's source from $resource_name into current template object
+ *
+ * @uses decode() to decode base64 and urlencoded template_resources
+ * @param Smarty_Template_Source $source source object
+ * @return string template source
+ */
+ public function getContent(Smarty_Template_Source $source)
+ {
+ return $this->decode($source->name);
+ }
+
+ /**
+ * decode base64 and urlencode
+ *
+ * @param string $string template_resource to decode
+ * @return string decoded template_resource
+ */
+ protected function decode($string)
+ {
+ // decode if specified
+ if (($pos = strpos($string, ':')) !== false) {
+ if (!strncmp($string, 'base64', 6)) {
+ return base64_decode(substr($string, 7));
+ } elseif (!strncmp($string, 'urlencode', 9)) {
+ return urldecode(substr($string, 10));
+ }
+ }
+
+ return $string;
+ }
+
+ /**
+ * modify resource_name according to resource handlers specifications
+ *
+ * @param Smarty $smarty Smarty instance
+ * @param string $resource_name resource_name to make unique
+ * @return string unique resource name
+ */
+ protected function buildUniqueResourceName(Smarty $smarty, $resource_name)
+ {
+ return get_class($this) . '#' .$this->decode($resource_name);
+ }
+
+ /**
+ * Determine basename for compiled filename
+ *
+ * @param Smarty_Template_Source $source source object
+ * @return string resource's basename
+ */
+ protected function getBasename(Smarty_Template_Source $source)
+ {
+ return '';
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_resource_extends.php b/includes/Smarty/sysplugins/smarty_internal_resource_extends.php
deleted file mode 100644
index bfdaefd..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_resource_extends.php
+++ /dev/null
@@ -1,197 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Resource Extends
-*
-* Implements the file system as resource for Smarty which does extend a chain of template files templates
-*
-* @package Smarty
-* @subpackage TemplateResources
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Resource Extends
-*/
-class Smarty_Internal_Resource_Extends {
- public function __construct($smarty)
- {
- $this->smarty = $smarty;
- }
- // classes used for compiling Smarty templates from file resource
- public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler';
- public $template_lexer_class = 'Smarty_Internal_Templatelexer';
- public $template_parser_class = 'Smarty_Internal_Templateparser';
-
- /**
- * Return flag if template source is existing
- *
- * @param object $template template object
- * @return boolean result
- */
- public function isExisting($template)
- {
- if ($template->getTemplateFilepath() === false) {
- return false;
- } else {
- return true;
- }
- }
- /**
- * Get filepath to template source
- *
- * @param object $template template object
- * @return string filepath to template source file
- */
- public function getTemplateFilepath($template)
- {
- $_files = explode('|', $template->resource_name);
- $_filepath = $template->buildTemplateFilepath ($_files[count($_files)-1]);
- if ($_filepath !== false) {
- if ($template->security) {
- $template->smarty->security_handler->isTrustedResourceDir($_filepath);
- }
- }
- return $_filepath;
- }
-
- /**
- * Get timestamp to template source
- *
- * @param object $template template object
- * @return integer timestamp of template source file
- */
- public function getTemplateTimestamp($template)
- {
- return filemtime($template->getTemplateFilepath());
- }
-
- /**
- * Read template source from file
- *
- * @param object $template template object
- * @return string content of template source file
- */
- public function getTemplateSource($template)
- {
- $this->template = $template;
- $_files = explode('|', $template->resource_name);
- $_files = array_reverse($_files);
- foreach ($_files as $_file) {
- $_filepath = $template->buildTemplateFilepath ($_file);
- // read template file
- if ($_filepath === false) {
- throw new Exception("Unable to load template \"file : {$_file}\"");
- }
- if ($_file != $_files[0]) {
- $template->properties['file_dependency']['F' . abs(crc32($_filepath))] = array($_filepath, filemtime($_filepath));
- }
- $_content = file_get_contents($_filepath);
- if ($_file != $_files[count($_files)-1]) {
- if (preg_match_all('/(' . $this->smarty->left_delimiter . 'block(.+?)' . $this->smarty->right_delimiter . ')/', $_content, $_open, PREG_OFFSET_CAPTURE) !=
- preg_match_all('/(' . $this->smarty->left_delimiter . '\/block(.*?)' . $this->smarty->right_delimiter . ')/', $_content, $_close, PREG_OFFSET_CAPTURE)) {
- $this->smarty->trigger_error(" unmatched {block} {/block} pairs");
- }
- $_block_count = count($_open[0]);
- for ($_i = 0; $_i < $_block_count; $_i++) {
- $_block_content = str_replace($this->smarty->left_delimiter . '$smarty.parent' . $this->smarty->right_delimiter, '%%%%SMARTY_PARENT%%%%',
- substr($_content, $_open[0][$_i][1] + strlen($_open[0][$_i][0]), $_close[0][$_i][1] - $_open[0][$_i][1] - strlen($_open[0][$_i][0])));
- $this->saveBlockData($_block_content, $_open[0][$_i][0],$this->template);
- }
- } else {
- $template->template_source = $_content;
- return true;
- }
- }
- }
- protected function saveBlockData($block_content, $block_tag,$template)
- {
- if (0 == preg_match('/(.?)(name=)([^ ]*)/', $block_tag, $_match)) {
- $this->smarty->trigger_error("\"" . $block_tag . "\" missing name attribute");
- } else {
- // compile block content
- $_tpl = $this->smarty->createTemplate('string:' . $block_content,null,null,$template);
- $_tpl->template_filepath = $this->template->getTemplateFilepath();
- $_tpl->forceNocache= true;
- $_compiled_content = $_tpl->getCompiledTemplate();
- unset($_tpl);
- $_name = trim($_match[3], "\"'}");
-
- if (isset($this->smarty->block_data[$_name])) {
- if (strpos($this->smarty->block_data[$_name]['compiled'], '%%%%SMARTY_PARENT%%%%') !== false) {
- $this->smarty->block_data[$_name]['compiled'] =
- str_replace('%%%%SMARTY_PARENT%%%%', $_compiled_content, $this->smarty->block_data[$_name]['compiled']);
- } elseif ($this->smarty->block_data[$_name]['mode'] == 'prepend') {
- $this->smarty->block_data[$_name]['compiled'] .= $_compiled_content;
- } elseif ($this->smarty->block_data[$_name]['mode'] == 'append') {
- $this->smarty->block_data[$_name]['compiled'] = $_compiled_content . $this->smarty->block_data[$_name]['compiled'];
- }
- } else {
- $this->smarty->block_data[$_name]['compiled'] = $_compiled_content;
- }
- if (preg_match('/(.?)(append=true)(.*)/', $block_tag, $_match) != 0) {
- $this->smarty->block_data[$_name]['mode'] = 'append';
- } elseif (preg_match('/(.?)(prepend=true)(.*)/', $block_tag, $_match) != 0) {
- $this->smarty->block_data[$_name]['mode'] = 'prepend';
- } else {
- $this->smarty->block_data[$_name]['mode'] = 'replace';
- }
- }
- }
-
- /**
- * Return flag that this resource uses the compiler
- *
- * @return boolean true
- */
- public function usesCompiler()
- {
- // template has tags, uses compiler
- return true;
- }
-
- /**
- * Return flag that this is not evaluated
- *
- * @return boolean false
- */
- public function isEvaluated()
- {
- // save the compiled file to disk, do not evaluate
- return false;
- }
- /**
- * Get filepath to compiled template
- *
- * @param object $template template object
- * @return string return path to compiled template
- */
- public function getCompiledFilepath($template)
- {
- $_compile_id = isset($template->compile_id) ? preg_replace('![^\w\|]+!','_',$template->compile_id) : null;
- $_files = explode('|', $template->resource_name);
- $_filepath = (string)abs(crc32($template->resource_name));
- // if use_sub_dirs, break file into directories
- if ($template->smarty->use_sub_dirs) {
- $_filepath = substr($_filepath, 0, 2) . DS
- . substr($_filepath, 2, 2) . DS
- . substr($_filepath, 4, 2) . DS
- . $_filepath;
- }
- $_compile_dir_sep = $template->smarty->use_sub_dirs ? DS : '^';
- if (isset($_compile_id)) {
- $_filepath = $_compile_id . $_compile_dir_sep . $_filepath;
- }
- if ($template->caching) {
- $_cache = '.cache';
- } else {
- $_cache = '';
- }
- $_compile_dir = $template->smarty->compile_dir;
- if (substr($_compile_dir, -1) != DS) {
- $_compile_dir .= DS;
- }
- return $_compile_dir . $_filepath . '.' . basename($_files[count($_files)-1]) . $_cache . '.php';
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_resource_file.php b/includes/Smarty/sysplugins/smarty_internal_resource_file.php
deleted file mode 100644
index eafc426..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_resource_file.php
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Resource File
-*
-* Implements the file system as resource for Smarty templates
-*
-* @package Smarty
-* @subpackage TemplateResources
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Resource File
-*/
-class Smarty_Internal_Resource_File {
- public function __construct($smarty)
- {
- $this->smarty = $smarty;
- }
- // classes used for compiling Smarty templates from file resource
- public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler';
- public $template_lexer_class = 'Smarty_Internal_Templatelexer';
- public $template_parser_class = 'Smarty_Internal_Templateparser';
-
- /**
- * Return flag if template source is existing
- *
- * @return boolean true
- */
- public function isExisting($template)
- {
- if ($template->getTemplateFilepath() === false) {
- return false;
- } else {
- return true;
- }
- }
-
- /**
- * Get filepath to template source
- *
- * @param object $_template template object
- * @return string filepath to template source file
- */
- public function getTemplateFilepath($_template)
- {
- $_filepath = $_template->buildTemplateFilepath ();
-
- if ($_filepath !== false) {
- if ($_template->security) {
- $_template->smarty->security_handler->isTrustedResourceDir($_filepath);
- }
- }
- return $_filepath;
- }
-
- /**
- * Get timestamp to template source
- *
- * @param object $_template template object
- * @return integer timestamp of template source file
- */
- public function getTemplateTimestamp($_template)
- {
- return filemtime($_template->getTemplateFilepath());
- }
-
- /**
- * Read template source from file
- *
- * @param object $_template template object
- * @return string content of template source file
- */
- public function getTemplateSource($_template)
- {
- // read template file
- if (file_exists($_template->getTemplateFilepath())) {
- $_template->template_source = file_get_contents($_template->getTemplateFilepath());
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Return flag that this resource uses the compiler
- *
- * @return boolean true
- */
- public function usesCompiler()
- {
- // template has tags, uses compiler
- return true;
- }
-
- /**
- * Return flag that this is not evaluated
- *
- * @return boolean false
- */
- public function isEvaluated()
- {
- // save the compiled file to disk, do not evaluate
- return false;
- }
- /**
- * Get filepath to compiled template
- *
- * @param object $_template template object
- * @return string return path to compiled template
- */
- public function getCompiledFilepath($_template)
- {
- $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w\|]+!','_',$_template->compile_id) : null;
- // $_filepath = md5($_template->resource_name);
- $_filepath = (string)abs(crc32($_template->resource_name));
- // if use_sub_dirs, break file into directories
- if ($_template->smarty->use_sub_dirs) {
- $_filepath = substr($_filepath, 0, 2) . DS
- . substr($_filepath, 2, 2) . DS
- . substr($_filepath, 4, 2) . DS
- . $_filepath;
- }
- $_compile_dir_sep = $_template->smarty->use_sub_dirs ? DS : '^';
- if (isset($_compile_id)) {
- $_filepath = $_compile_id . $_compile_dir_sep . $_filepath;
- }
- if ($_template->caching) {
- $_cache = '.cache';
- } else {
- $_cache = '';
- }
- $_compile_dir = $_template->smarty->compile_dir;
- if (strpos('/\\', substr($_compile_dir, -1)) === false) {
- $_compile_dir .= DS;
- }
- return $_compile_dir . $_filepath . '.' . $_template->resource_type . '.' . basename($_template->resource_name). $_cache . '.php';
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_resource_php.php b/includes/Smarty/sysplugins/smarty_internal_resource_php.php
deleted file mode 100644
index f3ed97d..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_resource_php.php
+++ /dev/null
@@ -1,145 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Resource PHP
-*
-* Implements the file system as resource for PHP templates
-*
-* @package Smarty
-* @subpackage TemplateResources
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Resource PHP
-*/
-class Smarty_Internal_Resource_PHP {
- /**
- * Class constructor, enable short open tags
- */
- public function __construct($smarty)
- {
- $this->smarty = $smarty;
- ini_set('short_open_tag', '1');
- }
-
- /**
- * Return flag if template source is existing
- *
- * @return boolean true
- */
- public function isExisting($template)
- {
- if ($template->getTemplateFilepath() === false) {
- return false;
- } else {
- return true;
- }
- }
-
- /**
- * Get filepath to template source
- *
- * @param object $_template template object
- * @return string filepath to template source file
- */
- public function getTemplateFilepath($_template)
- {
- $_filepath = $_template->buildTemplateFilepath ();
-
- if ($_template->security) {
- $_template->smarty->security_handler->isTrustedResourceDir($_filepath);
- }
-
- return $_filepath;
- }
-
- /**
- * Get timestamp to template source
- *
- * @param object $_template template object
- * @return integer timestamp of template source file
- */
- public function getTemplateTimestamp($_template)
- {
- return filemtime($_template->getTemplateFilepath());
- }
-
- /**
- * Read template source from file
- *
- * @param object $_template template object
- * @return string content of template source file
- */
- public function getTemplateSource($_template)
- {
- if (file_exists($_template->getTemplateFilepath())) {
- $_template->template_source = file_get_contents($_template->getTemplateFilepath());
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Return flag that this resource not use the compiler
- *
- * @return boolean false
- */
- public function usesCompiler()
- {
- // does not use compiler, template is PHP
- return false;
- }
-
- /**
- * Return flag that this is not evaluated
- *
- * @return boolean false
- */
- public function isEvaluated()
- {
- // does not use compiler, must be false
- return false;
- }
-
- /**
- * Get filepath to compiled template
- *
- * @param object $_template template object
- * @return boolean return false as compiled template is not stored
- */
- public function getCompiledFilepath($_template)
- {
- // no filepath for PHP templates
- return false;
- }
-
- /**
- * renders the PHP template
- */
- public function renderUncompiled($_smarty_template)
- {
- if (!$this->smarty->allow_php_templates) {
- throw new Exception("PHP templates are disabled");
- }
- if ($this->getTemplateFilepath($_smarty_template) === false) {
- throw new Exception("Unable to load template \"{$_smarty_template->resource_type} : {$_smarty_template->resource_name}\"");
- }
- // prepare variables
- $_smarty_ptr = $_smarty_template;
- do {
- foreach ($_smarty_ptr->tpl_vars as $_smarty_var => $_smarty_var_object) {
- if (isset($_smarty_var_object->value)) {
- $$_smarty_var = $_smarty_var_object->value;
- }
- }
- $_smarty_ptr = $_smarty_ptr->parent;
- } while ($_smarty_ptr != null);
- unset ($_smarty_var, $_smarty_var_object, $_smarty_ptr);
- // include PHP template
- include($this->getTemplateFilepath($_smarty_template));
- return;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_resource_registered.php b/includes/Smarty/sysplugins/smarty_internal_resource_registered.php
deleted file mode 100644
index e24b5e3..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_resource_registered.php
+++ /dev/null
@@ -1,152 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Resource Registered
-*
-* Implements the registered resource for Smarty template
-*
-* @package Smarty
-* @subpackage TemplateResources
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Resource Registered
-*/
-
-class Smarty_Internal_Resource_Registered {
- public function __construct($smarty)
- {
- $this->smarty = $smarty;
- }
- // classes used for compiling Smarty templates from file resource
- public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler';
- public $template_lexer_class = 'Smarty_Internal_Templatelexer';
- public $template_parser_class = 'Smarty_Internal_Templateparser';
-
- /**
- * Return flag if template source is existing
- *
- * @return boolean true
- */
- public function isExisting($_template)
- {
- if (is_integer($this->getTemplateTimestamp($_template))) {
- return true;
- } else {
- return false;
- }
- }
- /**
- * Get filepath to template source
- *
- * @param object $_template template object
- * @return string return 'string' as template source is not a file
- */
- public function getTemplateFilepath($_template)
- {
- // no filepath for strings
- // return "string" for compiler error messages
- $_filepath = $_template->resource_type .':'.$_template->resource_name;
-
- return $_filepath;
- }
-
- /**
- * Get timestamp to template source
- *
- * @param object $_template template object
- * @return boolean false as string resources have no timestamp
- */
- public function getTemplateTimestamp($_template)
- {
- // return timestamp
- $time_stamp = false;
- call_user_func_array($this->smarty->_plugins['resource'][$_template->resource_type][0][1],
- array($_template->resource_name, &$time_stamp, $this->smarty));
- return is_numeric($time_stamp) ? (int)$time_stamp : $time_stamp;
- }
- /**
- * Get timestamp to template source by type and name
- *
- * @param object $_template template object
- * @return boolean false as string resources have no timestamp
- */
- public function getTemplateTimestampTypeName($_resource_type, $_resource_name)
- {
- // return timestamp
- $time_stamp = false;
- call_user_func_array($this->smarty->_plugins['resource'][$_resource_type][0][1],
- array($_resource_name, &$time_stamp, $this->smarty));
- return is_numeric($time_stamp) ? (int)$time_stamp : $time_stamp;
- }
-
- /**
- * Retuen template source from resource name
- *
- * @param object $_template template object
- * @return string content of template source
- */
- public function getTemplateSource($_template)
- {
- // return template string
- return call_user_func_array($this->smarty->_plugins['resource'][$_template->resource_type][0][0],
- array($_template->resource_name, &$_template->template_source, $this->smarty));
- }
-
- /**
- * Return flag that this resource uses the compiler
- *
- * @return boolean true
- */
- public function usesCompiler()
- {
- // resource string is template, needs compiler
- return true;
- }
-
- /**
- * Return flag that this resource is evaluated
- *
- * @return boolean true
- */
- public function isEvaluated()
- {
- // compiled template is evaluated instead of saved to disk
- return false;
- }
-
- /**
- * Get filepath to compiled template
- *
- * @param object $_template template object
- * @return boolean return false as compiled template is not stored
- */
- public function getCompiledFilepath($_template)
- {
- $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w\|]+!','_',$_template->compile_id) : null;
- $_filepath = (string)abs(crc32($_template->template_resource));
- // if use_sub_dirs, break file into directories
- if ($_template->smarty->use_sub_dirs) {
- $_filepath = substr($_filepath, 0, 2) . DS
- . substr($_filepath, 2, 2) . DS
- . substr($_filepath, 4, 2) . DS
- . $_filepath;
- }
- $_compile_dir_sep = $_template->smarty->use_sub_dirs ? DS : '^';
- if (isset($_compile_id)) {
- $_filepath = $_compile_id . $_compile_dir_sep . $_filepath;
- }
- if ($_template->caching) {
- $_cache = '.cache';
- } else {
- $_cache = '';
- }
- $_compile_dir = $_template->smarty->compile_dir;
- if (strpos('/\\', substr($_compile_dir, -1)) === false) {
- $_compile_dir .= DS;
- }
- return $_compile_dir . $_filepath . '.' . $_template->resource_type . '.' . basename($_template->resource_name) . $_cache . '.php';
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_resource_stream.php b/includes/Smarty/sysplugins/smarty_internal_resource_stream.php
deleted file mode 100644
index 16e5a41..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_resource_stream.php
+++ /dev/null
@@ -1,118 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Resource Stream
-*
-* Implements the streams as resource for Smarty template
-*
-* @package Smarty
-* @subpackage TemplateResources
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Resource Stream
-*/
-
-class Smarty_Internal_Resource_Stream {
- public function __construct($smarty)
- {
- $this->smarty = $smarty;
- }
- // classes used for compiling Smarty templates from file resource
- public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler';
- public $template_lexer_class = 'Smarty_Internal_Templatelexer';
- public $template_parser_class = 'Smarty_Internal_Templateparser';
-
- /**
- * Return flag if template source is existing
- *
- * @return boolean true
- */
- public function isExisting($template)
- {
- if ($template->getTemplateSource() == '') {
- return false;
- } else {
- return true;
- }
- }
- /**
- * Get filepath to template source
- *
- * @param object $_template template object
- * @return string return 'string' as template source is not a file
- */
- public function getTemplateFilepath($_template)
- {
- // no filepath for strings
- // return resource name for compiler error messages
- return str_replace(':', '://', $_template->template_resource);
- }
-
- /**
- * Get timestamp to template source
- *
- * @param object $_template template object
- * @return boolean false as string resources have no timestamp
- */
- public function getTemplateTimestamp($_template)
- {
- // strings must always be compiled and have no timestamp
- return false;
- }
-
- /**
- * Retuen template source from resource name
- *
- * @param object $_template template object
- * @return string content of template source
- */
- public function getTemplateSource($_template)
- {
- // return template string
- $_template->template_source = '';
- $fp = fopen(str_replace(':', '://', $_template->template_resource),'r+');
- while (!feof($fp)) {
- $_template->template_source .= fgets($fp);
- }
- fclose($fp);
-
- return true;
- }
-
- /**
- * Return flag that this resource uses the compiler
- *
- * @return boolean true
- */
- public function usesCompiler()
- {
- // resource string is template, needs compiler
- return true;
- }
-
- /**
- * Return flag that this resource is evaluated
- *
- * @return boolean true
- */
- public function isEvaluated()
- {
- // compiled template is evaluated instead of saved to disk
- return true;
- }
-
- /**
- * Get filepath to compiled template
- *
- * @param object $_template template object
- * @return boolean return false as compiled template is not stored
- */
- public function getCompiledFilepath($_template)
- {
- // no filepath for strings
- return false;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_resource_string.php b/includes/Smarty/sysplugins/smarty_internal_resource_string.php
deleted file mode 100644
index f7b7b85..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_resource_string.php
+++ /dev/null
@@ -1,109 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Resource String
-*
-* Implements the strings as resource for Smarty template
-*
-* @package Smarty
-* @subpackage TemplateResources
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Resource String
-*/
-
-class Smarty_Internal_Resource_String {
- public function __construct($smarty)
- {
- $this->smarty = $smarty;
- }
- // classes used for compiling Smarty templates from file resource
- public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler';
- public $template_lexer_class = 'Smarty_Internal_Templatelexer';
- public $template_parser_class = 'Smarty_Internal_Templateparser';
-
- /**
- * Return flag if template source is existing
- *
- * @return boolean true
- */
- public function isExisting($template)
- {
- return true;
- }
-
- /**
- * Get filepath to template source
- *
- * @param object $_template template object
- * @return string return 'string' as template source is not a file
- */
- public function getTemplateFilepath($_template)
- {
- // no filepath for strings
- // return "string" for compiler error messages
- return 'string';
- }
-
- /**
- * Get timestamp to template source
- *
- * @param object $_template template object
- * @return boolean false as string resources have no timestamp
- */
- public function getTemplateTimestamp($_template)
- {
- // strings must always be compiled and have no timestamp
- return false;
- }
-
- /**
- * Retuen template source from resource name
- *
- * @param object $_template template object
- * @return string content of template source
- */
- public function getTemplateSource($_template)
- {
- // return template string
- $_template->template_source = $_template->resource_name;
- return true;
- }
-
- /**
- * Return flag that this resource uses the compiler
- *
- * @return boolean true
- */
- public function usesCompiler()
- {
- // resource string is template, needs compiler
- return true;
- }
-
- /**
- * Return flag that this resource is evaluated
- *
- * @return boolean true
- */
- public function isEvaluated()
- {
- // compiled template is evaluated instead of saved to disk
- return true;
- }
-
- /**
- * Get filepath to compiled template
- *
- * @param object $_template template object
- * @return boolean return false as compiled template is not stored
- */
- public function getCompiledFilepath($_template)
- {
- // no filepath for strings
- return false;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_run_filter.php b/includes/Smarty/sysplugins/smarty_internal_run_filter.php
deleted file mode 100644
index f62cbe7..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_run_filter.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Run Filter
-*
-* Smarty run filter class
-*
-* @package Smarty
-* @subpackage PluginsInternal
-* @author Uwe Tews
-*/
-
-/**
-* Class for filter processing
-*/
-class Smarty_Internal_Run_Filter {
- function __construct($smarty)
- {
- $this->smarty = $smarty;
- }
- /**
- * Run filters over content
- *
- * The filters will be lazy loaded if required
- * class name format: Smarty_FilterType_FilterName
- * plugin filename format: filtertype.filtername.php
- * Smarty2 filter plugins could be used
- *
- * @param string $type the type of filter ('pre','post','output' or 'variable') which shall run
- * @param string $content the content which shall be processed by the filters
- * @return string the filtered content
- */
- public function execute($type, $content, $flag = null)
- {
- $output = $content;
- if ($type != 'variable' || ($this->smarty->variable_filter && $flag !== false) || $flag === true) {
- // loop over autoload filters of specified type
- if (!empty($this->smarty->autoload_filters[$type])) {
- foreach ((array)$this->smarty->autoload_filters[$type] as $name) {
- $plugin_name = "Smarty_{$type}filter_{$name}";
- if ($this->smarty->loadPlugin($plugin_name)) {
- // use class plugin if found
- if (class_exists($plugin_name, false)) {
- // loaded class of filter plugin
- $output = call_user_func_array(array($plugin_name, 'execute'), array($output, $this->smarty));
- } elseif (function_exists($plugin_name)) {
- // use loaded Smarty2 style plugin
- $output = call_user_func_array($plugin_name, array($output, $this->smarty));
- }
- } else {
- // nothing found, throw exception
- throw new Exception("Unable to load filter {$plugin_name}");
- }
- }
- }
- // loop over registerd filters of specified type
- if (!empty($this->smarty->registered_filters[$type])) {
- foreach ($this->smarty->registered_filters[$type] as $key => $name) {
- $output = call_user_func_array($this->smarty->registered_filters[$type][$key], array($output, $this->smarty));
- }
- }
- }
- // return filtered output
- return $output;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_security_handler.php b/includes/Smarty/sysplugins/smarty_internal_security_handler.php
deleted file mode 100644
index f433e9e..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_security_handler.php
+++ /dev/null
@@ -1,130 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Security Handler
-*
-* @package Smarty
-* @subpackage Security
-* @author Uwe Tews
-*/
-/**
-* This class contains all methods for security checking
-*/
-class Smarty_Internal_Security_Handler {
- function __construct($smarty)
- {
- $this->smarty = $smarty;
- }
- /**
- * Check if PHP function is trusted.
- *
- * @param string $function_name
- * @param object $compiler compiler object
- * @return boolean true if function is trusted
- */
- function isTrustedPhpFunction($function_name, $compiler)
- {
- if (empty($this->smarty->security_policy->php_functions) || in_array($function_name, $this->smarty->security_policy->php_functions)) {
- return true;
- } else {
- $compiler->trigger_template_error ("PHP function \"" . $function_name . "\" not allowed by security setting");
- return false;
- }
- }
-
- /**
- * Check if modifier is trusted.
- *
- * @param string $modifier_name
- * @param object $compiler compiler object
- * @return boolean true if modifier is trusted
- */
- function isTrustedModifier($modifier_name, $compiler)
- {
- if (empty($this->smarty->security_policy->modifiers) || in_array($modifier_name, $this->smarty->security_policy->modifiers)) {
- return true;
- } else {
- $compiler->trigger_template_error ("modifier \"" . $modifier_name . "\" not allowed by security setting");
- return false;
- }
- }
- /**
- * Check if stream is trusted.
- *
- * @param string $stream_name
- * @param object $compiler compiler object
- * @return boolean true if stream is trusted
- */
- function isTrustedStream($stream_name)
- {
- if (empty($this->smarty->security_policy->streams) || in_array($stream_name, $this->smarty->security_policy->streams)) {
- return true;
- } else {
- throw new Exception ("stream \"" . $stream_name . "\" not allowed by security setting");
- return false;
- }
- }
-
- /**
- * Check if directory of file resource is trusted.
- *
- * @param string $filepath
- * @param object $compiler compiler object
- * @return boolean true if directory is trusted
- */
- function isTrustedResourceDir($filepath)
- {
- $_rp = realpath($filepath);
- if (isset($this->smarty->template_dir)) {
- foreach ((array)$this->smarty->template_dir as $curr_dir) {
- if (($_cd = realpath($curr_dir)) !== false &&
- strncmp($_rp, $_cd, strlen($_cd)) == 0 &&
- (strlen($_rp) == strlen($_cd) || substr($_rp, strlen($_cd), 1) == DS)) {
- return true;
- }
- }
- }
- if (!empty($this->smarty->security_policy->secure_dir)) {
- foreach ((array)$this->smarty->security_policy->secure_dir as $curr_dir) {
- if (($_cd = realpath($curr_dir)) !== false) {
- if ($_cd == $_rp) {
- return true;
- } elseif (strncmp($_rp, $_cd, strlen($_cd)) == 0 &&
- (strlen($_rp) == strlen($_cd) || substr($_rp, strlen($_cd), 1) == DS)) {
- return true;
- }
- }
- }
- }
-
- throw new Exception ("directory \"" . $_rp . "\" not allowed by security setting");
- return false;
- }
- /**
- * Check if directory of file resource is trusted.
- *
- * @param string $filepath
- * @param object $compiler compiler object
- * @return boolean true if directory is trusted
- */
- function isTrustedPHPDir($filepath)
- {
- $_rp = realpath($filepath);
- if (!empty($this->smarty->security_policy->trusted_dir)) {
- foreach ((array)$this->smarty->security_policy->trusted_dir as $curr_dir) {
- if (($_cd = realpath($curr_dir)) !== false) {
- if ($_cd == $_rp) {
- return true;
- } elseif (strncmp($_rp, $_cd, strlen($_cd)) == 0 &&
- substr($_rp, strlen($_cd), 1) == DS) {
- return true;
- }
- }
- }
- }
-
- throw new Exception ("directory \"" . $_rp . "\" not allowed by security setting");
- return false;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_smartytemplatecompiler.php b/includes/Smarty/sysplugins/smarty_internal_smartytemplatecompiler.php
deleted file mode 100644
index 3d7dc69..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_smartytemplatecompiler.php
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Smarty Template Compiler Base
-*
-* This file contains the basic classes and methodes for compiling Smarty templates with lexer/parser
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Class SmartyTemplateCompiler
-*/
-class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCompilerBase {
- /**
- * Initialize compiler
- */
- public function __construct($lexer_class, $parser_class, $smarty)
- {
- $this->smarty = $smarty;
- parent::__construct();
- // get required plugins
- $this->lexer_class = $lexer_class;
- $this->parser_class = $parser_class;
- }
-
- /**
- * Methode to compile a Smarty template
- *
- * @param $_content template source
- * @return bool true if compiling succeeded, false if it failed
- */
- protected function doCompile($_content)
- {
- /* here is where the compiling takes place. Smarty
- tags in the templates are replaces with PHP code,
- then written to compiled files. */
- // init the lexer/parser to compile the template
- $lex = new $this->lexer_class($_content,$this->smarty);
- $parser = new $this->parser_class($lex, $this);
- // $parser->PrintTrace();
- // get tokens from lexer and parse them
- while ($lex->yylex() && !$this->abort_and_recompile) {
- // echo "Line {$lex->line} Parsing {$parser->yyTokenName[$lex->token]} Token <pre>".htmlentities($lex->value)."</pre>";
- $parser->doParse($lex->token, $lex->value);
- }
-
- if ($this->abort_and_recompile) {
- // exit here on abort
- return false;
- }
- // finish parsing process
- $parser->doParse(0, 0);
- // check for unclosed tags
- if (count($this->_tag_stack) > 0) {
- // get stacked info
- list($_open_tag, $_data) = array_pop($this->_tag_stack);
- $this->trigger_template_error("unclosed {" . $_open_tag . "} tag");
- }
-
- if (!$this->compile_error) {
- // return compiled code
- return str_replace(array("?>\n<?php","?><?php"), array('',''), $parser->retvalue);
- } else {
- // compilation error
- return false;
- }
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_template.php b/includes/Smarty/sysplugins/smarty_internal_template.php
deleted file mode 100644
index a282bf4..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_template.php
+++ /dev/null
@@ -1,771 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin Template
-*
-* This file contains the Smarty template engine
-*
-* @package Smarty
-* @subpackage Templates
-* @author Uwe Tews
-*/
-
-/**
-* Main class with template data structures and methods
-*/
-class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
- // object cache
- public $compiler_object = null;
- public $cacher_object = null;
- // Smarty parameter
- public $cache_id = null;
- public $compile_id = null;
- public $caching = null;
- public $cache_lifetime = null;
- public $cacher_class = null;
- public $caching_type = null;
- public $force_compile = null;
- public $forceNocache = false;
- // Template resource
- public $template_resource = null;
- public $resource_type = null;
- public $resource_name = null;
- private $resource_object = null;
- private $usesCompiler = null;
- private $isEvaluated = null;
- private $isExisting = null;
- // Template source
- public $template_filepath = null;
- public $template_source = null;
- private $template_timestamp = null;
- // Compiled template
- private $compiled_filepath = null;
- public $compiled_template = null;
- private $compiled_timestamp = null;
- public $mustCompile = null;
- public $suppressHeader = false;
- public $suppressFileDependency = false;
- public $extract_code = false;
- public $extracted_compiled_code = '';
- // Rendered content
- public $rendered_content = null;
- // Cache file
- private $cached_filepath = null;
- private $cached_timestamp = null;
- private $isCached = null;
- private $cache_resource_object = null;
- // template variables
- public $tpl_vars = array();
- public $parent = null;
- public $config_vars = array();
- // storage for plugin
- public $plugin_data = array();
- // special properties
- public $properties = array();
- // storage for block data
- public $block_data = array();
-
- /**
- * Create template data object
- *
- * Some of the global Smarty settings copied to template scope
- * It load the required template resources and cacher plugins
- *
- * @param string $template_resource template resource string
- * @param object $_parent back pointer to parent object with variables or null
- * @param mixed $_cache_id cache id or null
- * @param mixed $_compile_id compile id or null
- */
- public function __construct($template_resource, $smarty, $_parent = null, $_cache_id = null, $_compile_id = null)
- {
- $this->smarty = $smarty;
- // Smarty parameter
- $this->cache_id = $_cache_id === null ? $this->smarty->cache_id : $_cache_id;
- $this->compile_id = $_compile_id === null ? $this->smarty->compile_id : $_compile_id;
- $this->force_compile = $this->smarty->force_compile;
- $this->caching = $this->smarty->caching;
- $this->cache_lifetime = $this->smarty->cache_lifetime;
- $this->force_cache = $this->smarty->force_cache;
- $this->cacher_class = $this->smarty->cacher_class;
- $this->caching_type = $this->smarty->default_caching_type;
- $this->security = $this->smarty->security;
- $this->cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($this->caching_type);
- $this->parent = $_parent;
- $this->properties['file_dependency'] = array();
- // dummy local smarty variable
- $this->tpl_vars['smarty'] = new Smarty_Variable;
- // Template resource
- $this->template_resource = $template_resource;
- // parse resource name
- if (!$this->parseResourceName ($template_resource, $this->resource_type, $this->resource_name, $this->resource_object)) {
- throw new Exception ("Unable to parse resource name \"{$template_resource}\"");
- }
- // load cache resource
- if (!$this->isEvaluated() && $this->caching) {
- $this->cache_resource_object = new $this->cache_resource_class($this->smarty);
- }
- }
-
- /**
- * Returns the template filepath
- *
- * The template filepath is determined by the actual resource handler
- *
- * @return string the template filepath
- */
- public function getTemplateFilepath ()
- {
- return $this->template_filepath === null ?
- $this->template_filepath = $this->resource_object->getTemplateFilepath($this) :
- $this->template_filepath;
- }
-
- /**
- * Returns the timpestamp of the template source
- *
- * The template timestamp is determined by the actual resource handler
- *
- * @return integer the template timestamp
- */
- public function getTemplateTimestamp ()
- {
- return $this->template_timestamp === null ?
- $this->template_timestamp = $this->resource_object->getTemplateTimestamp($this) :
- $this->template_timestamp;
- }
-
- /**
- * Returns the template source code
- *
- * The template source is being read by the actual resource handler
- *
- * @return string the template source
- */
- public function getTemplateSource ()
- {
- if ($this->template_source === null) {
- if (!$this->resource_object->getTemplateSource($this)) {
- throw new Exception("Unable to read template {$this->resource_type} '{$this->resource_name}'");
- }
- }
- return $this->template_source;
- }
-
- /**
- * Returns if the template is existing
- *
- * The status is determined by the actual resource handler
- *
- * @return boolean true if the template exists
- */
- public function isExisting ($error = false)
- {
- if ($this->isExisting === null) {
- $this->isExisting = $this->resource_object->isExisting($this);
- }
- if (!$this->isExisting && $error) {
- throw new Exception("Unable to load template {$this->resource_type} '{$this->resource_name}'");
- }
- return $this->isExisting;
- }
- /**
- * Returns if the template resource uses the Smarty compiler
- *
- * The status is determined by the actual resource handler
- *
- * @return boolean true if the template will use the compiler
- */
- public function usesCompiler ()
- {
- return $this->usesCompiler === null ?
- $this->usesCompiler = $this->resource_object->usesCompiler() :
- $this->usesCompiler;
- }
-
- /**
- * Returns if the compiled template is stored or just evaluated in memory
- *
- * The status is determined by the actual resource handler
- *
- * @return boolean true if the compiled template has to be evaluated
- */
- public function isEvaluated ()
- {
- return $this->isEvaluated === null ?
- $this->isEvaluated = $this->resource_object->isEvaluated() :
- $this->isEvaluated;
- }
-
- /**
- * Returns if the current template must be compiled by the Smarty compiler
- *
- * It does compare the timestamps of template source and the compiled templates and checks the force compile configuration
- *
- * @return boolean true if the template must be compiled
- */
- public function mustCompile ()
- {
- $this->isExisting(true);
- if ($this->mustCompile === null) {
- $this->mustCompile = ($this->usesCompiler() && ($this->force_compile || $this->isEvaluated() || $this->getCompiledTimestamp () === false ||
-// ($this->smarty->compile_check && $this->getCompiledTimestamp () !== $this->getTemplateTimestamp ())));
- ($this->smarty->compile_check && $this->getCompiledTimestamp () < $this->getTemplateTimestamp ())));
- }
- return $this->mustCompile;
- }
-
- /**
- * Returns the compiled template filepath
- *
- * @return string the template filepath
- */
- public function getCompiledFilepath ()
- {
- return $this->compiled_filepath === null ?
- ($this->compiled_filepath = !$this->isEvaluated() ? $this->resource_object->getCompiledFilepath($this) : false) :
- $this->compiled_filepath;
- }
-
- /**
- * Returns the timpestamp of the compiled template
- *
- * @return integer the template timestamp
- */
- public function getCompiledTimestamp ()
- {
- return $this->compiled_timestamp === null ?
- ($this->compiled_timestamp = (!$this->isEvaluated() && file_exists($this->getCompiledFilepath())) ? filemtime($this->getCompiledFilepath()) : false) :
- $this->compiled_timestamp;
- }
-
- /**
- * Returns the compiled template
- *
- * It checks if the template must be compiled or just read from the template resource
- *
- * @return string the compiled template
- */
- public function getCompiledTemplate ()
- {
- if ($this->compiled_template === null) {
- // see if template needs compiling.
- if ($this->mustCompile()) {
- $this->compileTemplateSource();
- } else {
- if ($this->compiled_template === null) {
- $this->compiled_template = !$this->isEvaluated() && $this->usesCompiler() ? file_get_contents($this->getCompiledFilepath()) : false;
- }
- }
- }
- return $this->compiled_template;
- }
-
- /**
- * Compiles the template
- *
- * If the template is not evaluated the compiled template is saved on disk
- */
- public function compileTemplateSource ()
- {
- if (!$this->isEvaluated) {
- $this->properties['file_dependency']['F' . abs(crc32($this->getTemplateFilepath()))] = array($this->getTemplateFilepath(), $this->getTemplateTimestamp());
- }
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::start_compile($this);
- }
- // compile template
- if (!is_object($this->compiler_object)) {
- // load compiler
- $this->smarty->loadPlugin($this->resource_object->compiler_class);
- $this->compiler_object = new $this->resource_object->compiler_class($this->resource_object->template_lexer_class, $this->resource_object->template_parser_class, $this->smarty);
- // load cacher
- if ($this->caching) {
- $this->smarty->loadPlugin($this->cacher_class);
- $this->cacher_object = new $this->cacher_class($this->smarty);
- }
- }
- // call compiler
- if ($this->compiler_object->compileTemplate($this)) {
- // compiling succeded
- if (!$this->isEvaluated()) {
- // write compiled template
- Smarty_Internal_Write_File::writeFile($this->getCompiledFilepath(), $this->compiled_template, $this->smarty);
- // make template and compiled file timestamp match
-/**
- $this->compiled_timestamp = null;
- touch($this->getCompiledFilepath(), $this->getTemplateTimestamp());
- // daylight saving time problem on windows
- if ($this->template_timestamp != $this->getCompiledTimestamp()) {
- touch($this->getCompiledFilepath(), 2 * $this->template_timestamp - $this->compiled_timestamp);
- }
-**/
- }
- } else {
- // error compiling template
- throw new Exception("Error compiling template {$this->getTemplateFilepath ()}");
- return false;
- }
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::end_compile($this);
- }
- }
-
- /**
- * Returns the filepath of the cached template output
- *
- * The filepath is determined by the actual resource handler of the cacher
- *
- * @return string the cache filepath
- */
- public function getCachedFilepath ()
- {
- return $this->cached_filepath === null ?
- $this->cached_filepath = ($this->isEvaluated() || !$this->caching) ? false : $this->cache_resource_object->getCachedFilepath($this) :
- $this->cached_filepath;
- }
-
- /**
- * Returns the timpestamp of the cached template output
- *
- * The timestamp is determined by the actual resource handler of the cacher
- *
- * @return integer the template timestamp
- */
- public function getCachedTimestamp ()
- {
- return $this->cached_timestamp === null ?
- $this->cached_timestamp = ($this->isEvaluated() || !$this->caching) ? false : $this->cache_resource_object->getCachedTimestamp($this) :
- $this->cached_timestamp;
- }
-
- /**
- * Returns the cached template output
- *
- * @return string |booelan the template content or false if the file does not exist
- */
- public function getCachedContent ()
- {
- return $this->rendered_content === null ?
- $this->rendered_content = ($this->isEvaluated() || !$this->caching) ? false : $this->cache_resource_object->getCachedContents($this) :
- $this->rendered_content;
- }
-
- /**
- * Writes the cached template output
- */
- public function writeCachedContent ()
- {
- // build file dependency string
- $this->properties['cache_lifetime'] = $this->cache_lifetime;
- return ($this->isEvaluated() || !$this->caching) ? false : $this->cache_resource_object->writeCachedContent($this, $this->createPropertyHeader() . $this->rendered_content);
- }
-
- /**
- * Checks of a valid version redered HTML output is in the cache
- *
- * If the cache is valid the contents is stored in the template object
- *
- * @return boolean true if cache is valid
- */
- public function isCached ()
- {
- if ($this->isCached === null) {
- $this->isCached = false;
- if ($this->caching && !$this->isEvaluated() && !$this->force_compile && !$this->force_cache) {
- if ($this->getCachedTimestamp() === false) {
- return $this->isCached;
- }
- if ($this->caching === SMARTY_CACHING_LIFETIME_SAVED || ($this->caching == SMARTY_CACHING_LIFETIME_CURRENT && (time() <= ($this->getCachedTimestamp() + $this->cache_lifetime) || $this->cache_lifetime < 0))) {
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::start_cache($this);
- }
- $this->rendered_content = $this->cache_resource_object->getCachedContents($this);
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::end_cache($this);
- }
- if ($this->caching === SMARTY_CACHING_LIFETIME_SAVED && $this->properties['cache_lifetime'] > 0 && (time() > ($this->getCachedTimestamp() + $this->properties['cache_lifetime']))) {
- $this->rendered_content = null;
- return $this->isCached;
- }
- if (!empty($this->properties['file_dependency']) && $this->smarty->compile_check) {
- foreach ($this->properties['file_dependency'] as $_file_to_check) {
- $this->getResourceTypeName($_file_to_check[0], $resource_type, $resource_name);
- If ($resource_type == 'file') {
- $mtime = filemtime($_file_to_check[0]);
- } else {
- $resource_handler = $this->loadTemplateResourceHandler($resource_type);
- $mtime = $resource_handler->getTemplateTimestampTypeName($resource_type, $resource_name);
- }
- // If ($mtime > $this->getCachedTimestamp()) {
- If ($mtime > $_file_to_check[1]) {
- $this->rendered_content = null;
- $this->properties['file_dependency'] = array();
- return $this->isCached;
- }
- }
- }
- $this->isCached = true;
- }
- }
- }
- return $this->isCached;
- }
-
- /**
- * Render the output using the compiled template or the PHP template source
- *
- * The rendering process is accomplished by just including the PHP files.
- * The only exceptions are evaluated templates (string template). Their code has
- * to be evaluated
- */
- public function renderTemplate ()
- {
- if ($this->usesCompiler()) {
- if ($this->mustCompile() && $this->compiled_template === null) {
- $this->compileTemplateSource();
- }
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::start_render($this);
- }
- $_smarty_tpl = $this;
- ob_start();
- if ($this->isEvaluated()) {
- eval("?>" . $this->compiled_template);
- } else {
- include($this->getCompiledFilepath ());
- // check file dependencies at compiled code
- if ($this->smarty->compile_check) {
- if (!empty($this->properties['file_dependency'])) {
- $this->mustCompile = false;
- foreach ($this->properties['file_dependency'] as $_file_to_check) {
- $this->getResourceTypeName($_file_to_check[0], $resource_type, $resource_name);
- If ($resource_type == 'file') {
- $mtime = filemtime($_file_to_check[0]);
- } else {
- $resource_handler = $this->loadTemplateResourceHandler($resource_type);
- $mtime = $resource_handler->getTemplateTimestampTypeName($resource_type, $resource_name);
- }
-// If ($mtime != $_file_to_check[1]) {
- If ($mtime > $_file_to_check[1]) {
- $this->properties['file_dependency'] = array();
- $this->mustCompile = true;
- break;
- }
- }
- if ($this->mustCompile) {
- // recompile and render again
- ob_get_clean();
- $this->compileTemplateSource();
- ob_start();
- include($this->getCompiledFilepath ());
- }
- }
- }
- }
- } else {
- if (is_callable(array($this->resource_object, 'renderUncompiled'))) {
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::start_render($this);
- }
- ob_start();
- $this->resource_object->renderUncompiled($this);
- } else {
- throw new Exception("Resource '$this->resource_type' must have 'renderUncompiled' methode");
- }
- }
- $this->rendered_content = ob_get_clean();
- if (!$this->isEvaluated) {
- $this->properties['file_dependency']['F' . abs(crc32($this->getTemplateFilepath()))] = array($this->getTemplateFilepath(), $this->getTemplateTimestamp());
- }
- if ($this->parent instanceof Smarty_Template or $this->parent instanceof Smarty_Internal_Template) {
- // var_dump('merge ', $this->parent->getTemplateFilepath(), $this->parent->properties['file_dependency'], $this->getTemplateFilepath(), $this->properties['file_dependency']);
- $this->parent->properties['file_dependency'] = array_merge($this->parent->properties['file_dependency'], $this->properties['file_dependency']);
- }
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::end_render($this);
- }
- // write to cache when nessecary
- if (!$this->isEvaluated() && ($this->caching == SMARTY_CACHING_LIFETIME_SAVED || $this->caching == SMARTY_CACHING_LIFETIME_CURRENT)) {
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::start_cache($this);
- }
- // write rendered template
- $this->writeCachedContent($this);
- // cache file may contain nocache code. read it back for processing
- $this->rendered_content = $this->cache_resource_object->getCachedContents($this);
- if ($this->smarty->debugging) {
- Smarty_Internal_Debug::end_cache($this);
- }
- }
- }
-
- /**
- * Returns the rendered HTML output
- *
- * If the cache is valid the cached content is used, otherwise
- * the output is rendered from the compiled template or PHP template source
- *
- * @return string rendered HTML output
- */
- public function getRenderedTemplate ()
- {
- // disable caching for evaluated code
- if ($this->isEvaluated()) {
- $this->caching = false;
- }
- // checks if template exists
- $this->isExisting(true);
- // read from cache or render
- if ($this->rendered_content === null && !$this->isCached()) {
- // render template (not loaded and not in cache)
- $this->renderTemplate();
- }
- $this->updateParentVariables();
- return $this->rendered_content;
- }
-
- /**
- * Parse a template resource in its name and type
- * Load required resource handler
- *
- * @param string $template_resource template resource specification
- * @param string $resource_type return resource type
- * @param string $resource_name return resource name
- * @param object $resource_handler return resource handler object
- */
- public function parseResourceName($template_resource, &$resource_type, &$resource_name, &$resource_handler)
- {
- if (empty($template_resource))
- return false;
- $this->getResourceTypeName($template_resource, $resource_type, $resource_name);
- $resource_handler = $this->loadTemplateResourceHandler($resource_type);
- // cache template object under a unique ID
- // do not cache string resources
- // ***** if ($resource_type != 'string' && $this->smarty->caching) {
- if ($resource_type != 'string') {
- $this->smarty->template_objects[$this->buildTemplateId ($this->template_resource, $this->cache_id, $this->compile_id)] = $this;
- }
- return true;
- }
-
- /**
- * get system filepath to template
- */
- public function buildTemplateFilepath ($file = null)
- {
- if ($file == null) {
- $file = $this->resource_name;
- }
- foreach((array)$this->smarty->template_dir as $_template_dir) {
- if (strpos('/\\', substr($_template_dir, -1)) === false) {
- $_template_dir .= DS;
- }
-
- $_filepath = $_template_dir . $file;
- if (file_exists($_filepath))
- return $_filepath;
- }
- if (file_exists($file)) return $file;
- // no tpl file found
- if (!empty($this->smarty->default_template_handler_func)) {
- if (!is_callable($this->smarty->default_template_handler_func)) {
- throw new Exception("Default template handler not callable");
- } else {
- $_return = call_user_func_array($this->smarty->default_template_handler_func,
- array($this->resource_type, $this->resource_name, &$this->template_source, &$this->template_timestamp, $this));
- if ($_return == true) {
- return $file;
- } elseif (is_string($_return)) {
- return $_return;
- }
- }
- }
- // throw new Exception("Unable to load template \"{$file}\"");
- return false;
- }
-
- /**
- * Decode saved properties from compiled template and cache files
- */
- public function decodeProperties ($properties)
- {
- $prop = unserialize($properties);
- if (isset($prop['cache_lifetime'])) {
- $this->properties['cache_lifetime'] = $prop['cache_lifetime'];
- }
- if (isset($prop['file_dependency'])) {
- $this->properties['file_dependency'] = array_merge($this->properties['file_dependency'], $prop['file_dependency']);
- // $this->properties['file_dependency'] = array_unique($this->properties['file_dependency']);
- }
- if (!empty($prop['function'])) {
- foreach ($prop['function'] as $_name => $_data) {
- $this->smarty->template_functions[$_name]['compiled'] = str_replace('_%n', "\n", $_data['compiled']);
- $this->smarty->template_functions[$_name]['parameter'] = $_data['parameter'];
- }
- }
- }
-
- /**
- * Update Smarty variables in parent variable object
- */
- public function updateParentVariables ($scope = SMARTY_LOCAL_SCOPE)
- {
- foreach ($this->tpl_vars as $_key => $_variable) {
- // copy global vars back to parent
- if (isset($this->parent) && ($scope == SMARTY_PARENT_SCOPE || $this->tpl_vars[$_key]->scope == SMARTY_PARENT_SCOPE)) {
- if (isset($this->parent->tpl_vars[$_key])) {
- // variable is already defined in parent, copy value
- $this->parent->tpl_vars[$_key]->value = $this->tpl_vars[$_key]->value;
- } else {
- // create variable in parent
- $this->parent->tpl_vars[$_key] = clone $_variable;
- $this->parent->tpl_vars[$_key]->scope = SMARTY_LOCAL_SCOPE;
- }
- }
- if ($scope == SMARTY_ROOT_SCOPE || $this->tpl_vars[$_key]->scope == SMARTY_ROOT_SCOPE) {
- $_ptr = $this;
- // find root
- while ($_ptr->parent != null) {
- $_ptr = $_ptr->parent;
- }
- if (isset($_ptr->tpl_vars[$_key])) {
- // variable is already defined in root, copy value
- $_ptr->tpl_vars[$_key]->value = $this->tpl_vars[$_key]->value;
- } else {
- // create variable in root
- $_ptr->tpl_vars[$_key] = clone $_variable;
- $_ptr->tpl_vars[$_key]->scope = SMARTY_LOCAL_SCOPE;
- }
- }
- if ($scope == SMARTY_GLOBAL_SCOPE || $this->tpl_vars[$_key]->scope == SMARTY_GLOBAL_SCOPE) {
- if (isset($this->smarty->global_tpl_vars[$_key])) {
- // variable is already defined in root, copy value
- $this->smarty->global_tpl_vars[$_key]->value = $this->tpl_vars[$_key]->value;
- } else {
- // create variable in root
- $this->smarty->global_tpl_vars[$_key] = clone $_variable;
- }
- $this->smarty->global_tpl_vars[$_key]->scope = SMARTY_LOCAL_SCOPE;
- }
- }
- }
-
- /**
- * Split a template resource in its name and type
- *
- * @param string $template_resource template resource specification
- * @param string $resource_type return resource type
- * @param string $resource_name return resource name
- */
- private function getResourceTypeName ($template_resource, &$resource_type, &$resource_name)
- {
- if (strpos($template_resource, ':') === false) {
- // no resource given, use default
- $resource_type = $this->smarty->default_resource_type;
- $resource_name = $template_resource;
- } else {
- // get type and name from path
- list($resource_type, $resource_name) = explode(':', $template_resource, 2);
- if (strlen($resource_type) == 1) {
- // 1 char is not resource type, but part of filepath
- $resource_type = 'file';
- $resource_name = $template_resource;
- } else {
- $resource_type = strtolower($resource_type);
- }
- }
- }
-
- /**
- * Load template resource handler by type
- *
- * @param string $resource_type template resource type
- * @return object resource handler object
- */
- private function loadTemplateResourceHandler ($resource_type)
- {
- // load resource handler if required
- if (!isset($this->smarty->resource_objects[$resource_type])) {
- // try registered resource
- if (isset($this->smarty->_plugins['resource'][$resource_type])) {
- return $this->smarty->resource_objects[$resource_type] = new Smarty_Internal_Resource_Registered($this->smarty);
- } else {
- // try sysplugins dir
- $_resource_class = 'Smarty_Internal_Resource_' . $resource_type;
- if ($this->smarty->loadPlugin($_resource_class)) {
- return $this->smarty->resource_objects[$resource_type] = new $_resource_class($this->smarty);
- } else {
- // try plugins dir
- $_resource_class = 'Smarty_Resource_' . $resource_type;
- if ($this->smarty->loadPlugin($_resource_class)) {
- if (class_exists($_resource_class, false)) {
- return $this->smarty->resource_objects[$resource_type] = new $_resource_class($this->smarty);
- } else {
- $this->smarty->register_resource($resource_type,
- array("smarty_resource_{$resource_type}_source",
- "smarty_resource_{$resource_type}_timestamp",
- "smarty_resource_{$resource_type}_secure",
- "smarty_resource_{$resource_type}_trusted"));
- return $this->smarty->resource_objects[$resource_type] = new Smarty_Internal_Resource_Registered($this->smarty);
- }
- } else {
- // try streams
- $_known_stream = stream_get_wrappers();
- if (in_array($resource_type, $_known_stream)) {
- // is known stream
- if ($this->smarty->security) {
- $this->smarty->security_handler->isTrustedStream($resource_type);
- }
- return $this->smarty->resource_objects[$resource_type] = new Smarty_Internal_Resource_Stream($this->smarty);
- } else {
- throw new Exception('Unkown resource type \'' . $resource_type . '\'');
- }
- }
- }
- }
- } else {
- return $this->smarty->resource_objects[$resource_type];
- }
- }
-
- /**
- * Create property header
- */
- public function createPropertyHeader ()
- {
- $directory_security = $this->smarty->direct_access_security ? "<?php if(!defined('SMARTY_DIR')) exit('no direct access allowed'); ?>\n" : '';
- $properties_string = "<?php \$_smarty_tpl->decodeProperties('" . str_replace("'", '"', (serialize($this->properties))) . "'); ?>\n";
- return $directory_security . $properties_string;
- }
-
- /**
- * wrapper for display
- */
- public function display ()
- {
- return $this->smarty->display($this);
- }
-
- /**
- * wrapper for fetch
- */
- public function fetch ()
- {
- return $this->smarty->fetch($this);
- }
- /**
- * wrapper for is_cached
- */
- public function is_cached ()
- {
- return $this->iscached($this);
- }
-}
-
-/**
-* wrapper for template class
-*/
-class Smarty_Template extends Smarty_Internal_Template {
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_templatebase.php b/includes/Smarty/sysplugins/smarty_internal_templatebase.php
deleted file mode 100644
index b523a29..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_templatebase.php
+++ /dev/null
@@ -1,428 +0,0 @@
-<?php
-
-/**
-* Smarty Internal Plugin TemplateBase
-*
-* This file contains the basic classes and methodes for template and variable creation
-*
-* @package Smarty
-* @subpackage Templates
-* @author Uwe Tews
-*/
-
-/**
-* Base class with template and variable methodes
-*/
-class Smarty_Internal_TemplateBase {
- // class used for templates
- public $template_class = 'Smarty_Internal_Template';
-
- /**
- * assigns a Smarty variable
- *
- * @param array $ |string $tpl_var the template variable name(s)
- * @param mixed $value the value to assign
- * @param boolean $nocache if true any output of this variable will be not cached
- * @param boolean $scope the scope the variable will have (local,parent or root)
- */
- public function assign($tpl_var, $value = null, $nocache = false, $scope = SMARTY_LOCAL_SCOPE)
- {
- if (is_array($tpl_var)) {
- foreach ($tpl_var as $_key => $_val) {
- if ($_key != '') {
- $this->tpl_vars[$_key] = new Smarty_variable($_val, $nocache, $scope);
- }
- }
- } else {
- if ($tpl_var != '') {
- $this->tpl_vars[$tpl_var] = new Smarty_variable($value, $nocache, $scope);
- }
- }
- }
- /**
- * assigns a global Smarty variable
- *
- * @param string $varname the global variable name
- * @param mixed $value the value to assign
- * @param boolean $nocache if true any output of this variable will be not cached
- */
- public function assign_global($varname, $value = null, $nocache = false)
- {
- if ($varname != '') {
- $this->smarty->global_tpl_vars[$varname] = new Smarty_variable($value, $nocache);
- }
- }
- /**
- * assigns values to template variables by reference
- *
- * @param string $tpl_var the template variable name
- * @param mixed $ &$value the referenced value to assign
- * @param boolean $nocache if true any output of this variable will be not cached
- * @param boolean $scope the scope the variable will have (local,parent or root)
- */
- public function assign_by_ref($tpl_var, &$value, $nocache = false, $scope = SMARTY_LOCAL_SCOPE)
- {
- if ($tpl_var != '') {
- $this->tpl_vars[$tpl_var] = new Smarty_variable(null, $nocache, $scope);
- $this->tpl_vars[$tpl_var]->value = &$value;
- }
- }
- /**
- * appends values to template variables
- *
- * @param array $ |string $tpl_var the template variable name(s)
- * @param mixed $value the value to append
- * @param boolean $merge flag if array elements shall be merged
- * @param boolean $nocache if true any output of this variable will be not cached
- * @param boolean $scope the scope the variable will have (local,parent or root)
- */
- public function append($tpl_var, $value = null, $merge = false, $nocache = false, $scope = SMARTY_LOCAL_SCOPE)
- {
- if (is_array($tpl_var)) {
- // $tpl_var is an array, ignore $value
- foreach ($tpl_var as $_key => $_val) {
- if ($_key != '') {
- if (!isset($this->tpl_vars[$_key])) {
- $tpl_var_inst = $this->getVariable($_key, null, true, false);
- if ($tpl_var_inst instanceof Undefined_Smarty_Variable) {
- $this->tpl_vars[$_key] = new Smarty_variable(null, $nocache, $scope);
- } else {
- $this->tpl_vars[$_key] = clone $tpl_var_inst;
- if ($scope != SMARTY_LOCAL_SCOPE) {
- $this->tpl_vars[$_key]->scope = $scope;
- }
- }
- }
- if (!(is_array($this->tpl_vars[$_key]->value) || $this->tpl_vars[$_key]->value instanceof ArrayAccess)) {
- settype($this->tpl_vars[$_key]->value, 'array');
- }
- if ($merge && is_array($_val)) {
- foreach($_val as $_mkey => $_mval) {
- $this->tpl_vars[$_key]->value[$_mkey] = $_mval;
- }
- } else {
- $this->tpl_vars[$_key]->value[] = $_val;
- }
- }
- }
- } else {
- if ($tpl_var != '' && isset($value)) {
- if (!isset($this->tpl_vars[$tpl_var])) {
- $tpl_var_inst = $this->getVariable($tpl_var, null, true, false);
- if ($tpl_var_inst instanceof Undefined_Smarty_Variable) {
- $this->tpl_vars[$tpl_var] = new Smarty_variable(null, $nocache, $scope);
- } else {
- $this->tpl_vars[$tpl_var] = clone $tpl_var_inst;
- if ($scope != SMARTY_LOCAL_SCOPE) {
- $this->tpl_vars[$tpl_var]->scope = $scope;
- }
- }
- }
- if (!(is_array($this->tpl_vars[$tpl_var]->value) || $this->tpl_vars[$tpl_var]->value instanceof ArrayAccess)) {
- settype($this->tpl_vars[$tpl_var]->value, 'array');
- }
- if ($merge && is_array($value)) {
- foreach($value as $_mkey => $_mval) {
- $this->tpl_vars[$tpl_var]->value[$_mkey] = $_mval;
- }
- } else {
- $this->tpl_vars[$tpl_var]->value[] = $value;
- }
- }
- }
- }
-
- /**
- * appends values to template variables by reference
- *
- * @param string $tpl_var the template variable name
- * @param mixed $ &$value the referenced value to append
- * @param boolean $merge flag if array elements shall be merged
- */
- public function append_by_ref($tpl_var, &$value, $merge = false)
- {
- if ($tpl_var != '' && isset($value)) {
- if (!isset($this->tpl_vars[$tpl_var])) {
- $this->tpl_vars[$tpl_var] = new Smarty_variable();
- }
- if (!@is_array($this->tpl_vars[$tpl_var]->value)) {
- settype($this->tpl_vars[$tpl_var]->value, 'array');
- }
- if ($merge && is_array($value)) {
- foreach($value as $_key => $_val) {
- $this->tpl_vars[$tpl_var]->value[$_key] = &$value[$_key];
- }
- } else {
- $this->tpl_vars[$tpl_var]->value[] = &$value;
- }
- }
- }
-
-
- /**
- * clear the given assigned template variable.
- *
- * @param string $ |array $tpl_var the template variable(s) to clear
- */
- public 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]);
- }
- }
-
- /**
- * clear all the assigned template variables.
- */
- public function clear_all_assign()
- {
- $this->tpl_vars = array();
- }
-
- /**
- * load a config file, optionally load just selected sections
- *
- * @param string $config_file filename
- * @param mixed $sections array of section names, single section or null
- */
- public function config_load($config_file, $sections = null)
- {
- // load Config class
- $config = new Smarty_Internal_Config($config_file, $this->smarty);
- $config->loadConfigVars($sections, $this);
- }
-
- /**
- * gets the object of a Smarty variable
- *
- * @param string $variable the name of the Smarty variable
- * @param object $_ptr optional pointer to data object
- * @param boolean $search_parents search also in parent data
- * @return object the object of the variable
- */
- public function getVariable($variable, $_ptr = null, $search_parents = true, $error_enable = true)
- {
- if ($_ptr === null) {
- $_ptr = $this;
- } while ($_ptr !== null) {
- if (isset($_ptr->tpl_vars[$variable])) {
- // found it, return it
- return $_ptr->tpl_vars[$variable];
- }
- // not found, try at parent
- if ($search_parents) {
- $_ptr = $_ptr->parent;
- } else {
- $_ptr = null;
- }
- }
- if (isset($this->smarty->global_tpl_vars[$variable])) {
- // found it, return it
- return $this->smarty->global_tpl_vars[$variable];
- }
- if ($this->smarty->error_unassigned && $error_enable) {
- throw new Exception('Undefined Smarty variable "' . $variable . '"');
- } else {
- return new Undefined_Smarty_Variable;
- }
- }
- /**
- * gets a config variable
- *
- * @param string $variable the name of the config variable
- * @return mixed the value of the config variable
- */
- public function getConfigVariable($variable)
- {
- $_ptr = $this;
- while ($_ptr !== null) {
- if (isset($_ptr->config_vars[$variable])) {
- // found it, return it
- return $_ptr->config_vars[$variable];
- }
- // not found, try at parent
- $_ptr = $_ptr->parent;
- }
- if ($this->smarty->error_unassigned) {
- throw new Exception('Undefined config variable "' . $variable . '"');
- } else {
- return '';
- }
- }
- /**
- * gets a stream variable
- *
- * @param string $variable the stream of the variable
- * @return mixed the value of the stream variable
- */
- public function getStreamVariable($variable)
- {
- $_result = '';
- if ($fp = fopen($variable, 'r+')) {
- while (!feof($fp)) {
- $_result .= fgets($fp);
- }
- fclose($fp);
- return $_result;
- }
-
- if ($this->smarty->$error_unassigned) {
- throw new Exception('Undefined stream variable "' . $variable . '"');
- } else {
- return '';
- }
- }
-
- /**
- * creates a template object
- *
- * @param string $template the resource handle of the template file
- * @param object $parent next higher level of Smarty variables
- * @param mixed $cache_id cache id to be used with this template
- * @param mixed $compile_id compile id to be used with this template
- * @returns object template object
- */
- public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null)
- {
- if (is_object($cache_id) || is_array($cache_id)) {
- $parent = $cache_id;
- $cache_id = null;
- }
- if (is_array($parent)) {
- $data = $parent;
- $parent = null;
- } else {
- $data = null;
- }
- if (!is_object($template)) {
- // we got a template resource
- $_templateId = $this->buildTemplateId ($template, $cache_id, $compile_id);
- // already in template cache?
- if (isset($this->smarty->template_objects[$_templateId]) && $this->smarty->caching) {
- // return cached template object
- $tpl = $this->smarty->template_objects[$_templateId];
- } else {
- // create new template object
- $tpl = new $this->template_class($template, $this->smarty, $parent, $cache_id, $compile_id);
- }
- } else {
- // just return a copy of template class
- $tpl = $template;
- }
- // fill data if present
- if (is_array($data)) {
- // set up variable values
- foreach ($data as $_key => $_val) {
- $tpl->tpl_vars[$_key] = new Smarty_variable($_val);
- }
- }
- return $tpl;
- }
-
- /**
- * generates a template id
- *
- * @param string $_resource the resource handle of the template file
- * @param mixed $_cache_id cache id to be used with this template
- * @param mixed $_compile_id compile id to be used with this template
- * @returns string a unique template id
- */
- function buildTemplateId ($_resource, $_cache_id, $_compile_id)
- {
- $_cache_id = isset($_cache_id) ? preg_replace('![^\w\|]+!','_',$_cache_id) : null;
- $_compile_id = isset($_compile_id) ? preg_replace('![^\w\|]+!','_',$_compile_id) : null;
- return crc32($_resource . $_cache_id . $_compile_id);
- }
-
- /**
- * return current time
- *
- * @returns double current time
- */
- function _get_time()
- {
- $_mtime = microtime();
- $_mtime = explode(" ", $_mtime);
- return (double)($_mtime[1]) + (double)($_mtime[0]);
- }
-}
-
-/**
-* class for the Smarty data object
-*
-* The Smarty data object will hold Smarty variables in the current scope
-*
-* @param object $parent tpl_vars next higher level of Smarty variables
-*/
-class Smarty_Data extends Smarty_Internal_TemplateBase {
- // array of variable objects
- public $tpl_vars = array();
- // back pointer to parent object
- public $parent = null;
- // config vars
- public $config_vars = array();
- /**
- * create Smarty data object
- */
- public function __construct ($_parent = null)
- {
- if (is_object($_parent)) {
- // when object set up back pointer
- $this->parent = $_parent;
- } elseif (is_array($_parent)) {
- // set up variable values
- foreach ($_parent as $_key => $_val) {
- $this->tpl_vars[$_key] = new Smarty_variable($_val);
- }
- } else {
- throw new Exception("Wrong type for template variables");
- }
- }
-}
-/**
-* class for the Smarty variable object
-*
-* This class defines the Smarty variable object
-*/
-class Smarty_Variable {
- // template variable
- public $value;
- public $nocache;
- public $scope;
- /**
- * create Smarty variable object
- *
- * @param mixed $value the value to assign
- * @param boolean $nocache if true any output of this variable will be not cached
- * @param boolean $scope the scope the variable will have (local,parent or root)
- */
- public function __construct ($value = null, $nocache = false, $scope = SMARTY_LOCAL_SCOPE)
- {
- $this->value = $value;
- $this->nocache = $nocache;
- $this->scope = $scope;
- }
-}
-
-/**
-* class for undefined variable object
-*
-* This class defines an object for undefined variable handling
-*/
-class Undefined_Smarty_Variable {
- // return always false
- public function __get ($name)
- {
- if ($name == 'nocache') {
- return false;
- } else {
- return null;
- }
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_templatecompilerbase.php b/includes/Smarty/sysplugins/smarty_internal_templatecompilerbase.php
deleted file mode 100644
index 16ee795..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_templatecompilerbase.php
+++ /dev/null
@@ -1,271 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Smarty Template Compiler Base
-*
-* This file contains the basic classes and methodes for compiling Smarty templates with lexer/parser
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Main compiler class
-*/
-class Smarty_Internal_TemplateCompilerBase {
- // compile tag objects
- static $_tag_objects = array();
- // tag stack
- public $_tag_stack = array();
- // current template
- public $template = null;
-
- /**
- * Initialize compiler
- */
- public function __construct()
- {
- }
- // abstract function doCompile($_content);
- /**
- * Methode to compile a Smarty template
- *
- * @param $template template object to compile
- * @return bool true if compiling succeeded, false if it failed
- */
- public function compileTemplate($template)
- {
- /* here is where the compiling takes place. Smarty
- tags in the templates are replaces with PHP code,
- then written to compiled files. */
- if (!is_object($template->cacher_object)) {
- $this->smarty->loadPlugin($template->cacher_class);
- $template->cacher_object = new $template->cacher_class($this->smarty);
- }
- // flag for nochache sections
- $this->nocache = false;
- $this->tag_nocache = false;
- // assume successfull compiling
- $this->compile_error = false;
- // save template object in compiler class
- $this->template = $template;
- $this->smarty->_current_file = $this->template->getTemplateFilepath();
- // template header code
- $template_header = '';
- if (!$template->suppressHeader) {
- $template_header .= "<?php /* Smarty version " . Smarty::$_version . ", created on " . strftime("%Y-%m-%d %H:%M:%S") . "\n";
- $template_header .= " compiled from \"" . $this->template->getTemplateFilepath() . "\" */ ?>\n";
- }
-
- do {
- // flag for aborting current and start recompile
- $this->abort_and_recompile = false;
- // get template source
- $_content = $template->getTemplateSource();
- // run prefilter if required
- if (isset($this->smarty->autoload_filters['pre']) || isset($this->smarty->registered_filters['pre'])) {
- $_content = $this->smarty->filter_handler->execute('pre', $_content);
- }
- // on empty template just return header
- if ($_content == '') {
- if ($template->suppressFileDependency) {
- $template->compiled_template = '';
- } else {
- $template->compiled_template = $template->createPropertyHeader() . $template_header;
- }
- return true;
- }
- // init cacher plugin
- $template->cacher_object->initCacher($this);
- // call compiler
- $_compiled_code = $this->doCompile($_content);
- } while ($this->abort_and_recompile);
-
- if (!$this->compile_error) {
- // close cacher and return compiled template
- if ($template->suppressFileDependency) {
- $template->compiled_template = $template->cacher_object->closeCacher($this, $_compiled_code);
- } else {
- $template->compiled_template = $template->createPropertyHeader() . $template_header . $template->cacher_object->closeCacher($this, $_compiled_code);
- }
- // run postfilter if required
- if (isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) {
- $template->compiled_template = $this->smarty->filter_handler->execute('post', $template->compiled_template);
- }
- return true;
- } else {
- // compilation error
- return false;
- }
- }
-
- /**
- * Compile Tag
- *
- * This is a call back from the lexer/parser
- * It executes the required compile plugin for the Smarty tag
- *
- * @param string $tag tag name
- * @param array $args array with tag attributes
- * @return string compiled code
- */
- public function compileTag($tag, $args)
- {
- // $args contains the attributes parsed and compiled by the lexer/parser
- // assume that tag does compile into code, but creates no HTML output
- $this->has_code = true;
- $this->has_output = false;
- // compile the smarty tag (required compile classes to compile the tag are autoloaded)
- if (($_output = $this->generateCode($tag, $args)) === false) {
- if (isset($this->smarty->template_functions[$tag])) {
- // template defined by {template} tag
- $args['name'] = $tag;
- $tag = 'function_call';
- $_output = $this->generateCode($tag, $args);
- }
- }
- if ($_output !== false) {
- if ($_output !== true) {
- // did we get compiled code
- if ($this->has_code) {
- // Does it create output?
- if ($this->has_output) {
- $_output .= "\n";
- }
- // return compiled code
- return $_output;
- }
- }
- // tag did not produce compiled code
- return '';
- } else {
- // not an internal compiler tag
- // check if tag is a registered object
- if (isset($this->smarty->registered_objects[$tag]) && isset($args['object_methode'])) {
- $methode = $args['object_methode'];
- unset ($args['object_methode']);
- if (!in_array($methode, $this->smarty->registered_objects[$tag][3]) &&
- (empty($this->smarty->registered_objects[$tag][1]) || in_array($methode, $this->smarty->registered_objects[$tag][1]))) {
- return $this->generateCode('object_function',$args, $tag, $methode);
- } elseif (in_array($methode, $this->smarty->registered_objects[$tag][3])) {
- return $this->generateCode('object_block_function',$args, $tag, $methode);
- } else {
- return $this->trigger_template_error ('unallowed methode "' . $methode . '" in registered object "' . $tag . '"');
- }
- }
- // check if tag is registered or is Smarty plugin
- $this->smarty->plugin_handler->loadSmartyPlugin($tag, $this->smarty->plugin_search_order);
- if (isset($this->smarty->registered_plugins[$tag])) {
- // if compiler function plugin call it now
- if ($this->smarty->registered_plugins[$tag][0] == 'compiler') {
- if (!$this->smarty->registered_plugins[$tag][2]) {
- $this->tag_nocache = true;
- }
- return call_user_func($this->smarty->registered_plugins[$tag][1], $args, $this);
- }
- // compile function or block plugin
- $plugin_type = $this->smarty->registered_plugins[$tag][0] . '_plugin';
- return $this->generateCode($plugin_type, $args, $tag);
- }
- // compile closing tag of block function
- if (strlen($tag) > 5 && substr_compare($tag, 'close', -5, 5) == 0) {
- $base_tag = substr($tag, 0, -5);
- // check if closing tag is a registered object
- if (isset($this->smarty->registered_objects[$base_tag]) && isset($args['object_methode'])) {
- $methode = $args['object_methode'];
- unset ($args['object_methode']);
- if (in_array($methode, $this->smarty->registered_objects[$base_tag][3])) {
- return $this->generateCode('object_block_function', $args, $tag, $methode);
- } else {
- return $this->trigger_template_error ('unallowed closing tag methode "' . $methode . '" in registered object "' . $base_tag . '"');
- }
- }
- // plugin ?
- if (isset($this->smarty->registered_plugins[$base_tag]) && $this->smarty->registered_plugins[$base_tag][0] == 'block') {
- return $this->generateCode('block_plugin',$args, $tag);
- }
- }
- $this->trigger_template_error ("unknown tag \"" . $tag . "\"");
- }
- }
-
- /**
- * lazy loads internal compile plugin for tag and calls the compile methode
- *
- * compile objects cached for reuse.
- * class name format: Smarty_Internal_Compile_TagName
- * plugin filename format: Smarty_Internal_Tagname.php
- *
- * @param $tag string tag name
- * @param $args array with tag attributes
- * @param $subtag optional tag name at plugins
- * @param $method string optional method on object tags
- * @return string compiled code
- */
- public function generateCode($tag, $args, $subtag = null, $method = null)
- {
- // re-use object if already exists
- if (isset(self::$_tag_objects[$tag])) {
- // compile this tag
- return call_user_func(array(self::$_tag_objects[$tag], 'compile'), $args, $this, $subtag, $method);
- }
- // lazy load internal compiler plugin
- $class_name = 'Smarty_Internal_Compile_' . $tag;
- if ($this->smarty->loadPlugin($class_name)) {
- // use plugin if found
- self::$_tag_objects[$tag] = new $class_name;
- // compile this tag
- return call_user_func(array(self::$_tag_objects[$tag], 'compile'), $args, $this, $subtag, $method);
- }
- // no internal compile plugin for this tag
- return false;
- }
-
- /**
- * display compiler error messages without dying
- *
- * If parameter $args is empty it is a parser detected syntax error.
- * In this case the parser is called to obtain information about expected tokens.
- *
- * If parameter $args contains a string this is used as error message
- *
- * @todo output exact position of parse error in source line
- * @param $args string individual error message or null
- */
- public function trigger_template_error($args = null)
- {
- $this->lex = Smarty_Internal_Templatelexer::instance();
- $this->parser = Smarty_Internal_Templateparser::instance();
- // get template source line which has error
- $line = $this->lex->line;
- if (isset($args)) {
- // $line--;
- }
- $match = preg_split("/\n/", $this->lex->data);
- $error_text = 'Syntax Error in template "' . $this->template->getTemplateFilepath() . '" on line ' . $line . ' "' . $match[$line-1] . '" ';
-
- if (isset($args)) {
- // individual error message
- $error_text .= $args;
- } else {
- // expected token from parser
- foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {
- $exp_token = $this->parser->yyTokenName[$token];
- if (isset($this->lex->smarty_token_names[$exp_token])) {
- // token type from lexer
- $expect[] = '"' . $this->lex->smarty_token_names[$exp_token] . '"';
- } else {
- // otherwise internal token name
- $expect[] = $this->parser->yyTokenName[$token];
- }
- }
- // output parser error message
- $error_text .= ' - Unexpected "' . $this->lex->value . '", expected one of: ' . implode(' , ', $expect);
- }
- echo '<br class="clear" /><pre>';
- throw new Exception("<pre>$error_text</pre>");
- // set error flag
- $this->compile_error = true;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_templatelexer.php b/includes/Smarty/sysplugins/smarty_internal_templatelexer.php
deleted file mode 100644
index 0d59003..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_templatelexer.php
+++ /dev/null
@@ -1,1400 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Templatelexer
-*
-* This is the lexer to break the template source into tokens
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Templatelexer
-*/
-class Smarty_Internal_Templatelexer
-{
- public $data;
- public $counter;
- public $token;
- public $value;
- public $node;
- public $line;
- public $state = 1;
- public $smarty_token_names = array ( // Text for parser error messages
- 'IDENTITY' => '===',
- 'NONEIDENTITY' => '!==',
- 'EQUALS' => '==',
- 'NOTEQUALS' => '!=',
- 'GREATEREQUAL' => '(>=,ge)',
- 'LESSEQUAL' => '(<=,le)',
- 'GREATERTHAN' => '(>,gt)',
- 'LESSTHAN' => '(<,lt)',
- 'MOD' => '(%,mod)',
- 'NOT' => '(!,not)',
- 'LAND' => '(&&,and)',
- 'LOR' => '(||,or)',
- 'LXOR' => 'xor',
- 'OPENP' => '(',
- 'CLOSEP' => ')',
- 'OPENB' => '[',
- 'CLOSEB' => ']',
- 'PTR' => '->',
- 'APTR' => '=>',
- 'EQUAL' => '=',
- 'NUMBER' => 'number',
- 'UNIMATH' => '+" , "-',
- 'MATH' => '*" , "/" , "%',
- 'INCDEC' => '++" , "--',
- 'SPACE' => ' ',
- 'DOLLAR' => '$',
- 'SEMICOLON' => ';',
- 'COLON' => ':',
- 'DOUBLECOLON' => '::',
- 'AT' => '@',
- 'HATCH' => '#',
- 'QUOTE' => '"',
- 'SINGLEQUOTE' => "'",
- 'BACKTICK' => '`',
- 'VERT' => '|',
- 'DOT' => '.',
- 'COMMA' => '","',
- 'ANDSYM' => '"&"',
- 'QMARK' => '"?"',
- 'ID' => 'identifier',
- 'OTHER' => 'text',
- 'PHP' => 'PHP code',
- 'LDELSLASH' => 'closing tag',
- 'COMMENT' => 'comment',
- 'LITERALEND' => 'literal close',
- 'AS' => 'as',
- 'NULL' => 'null',
- 'BOOLEAN' => 'boolean'
- );
-
-
- function __construct($data,$smarty)
- {
- // set instance object
- self::instance($this);
- $this->data = preg_replace("/(\r\n|\r|\n)/", "\n", $data);
- $this->counter = 0;
- $this->line = 1;
- $this->smarty = $smarty;
- $this->ldel = preg_quote($this->smarty->left_delimiter,'/');
- $this->rdel = preg_quote($this->smarty->right_delimiter,'/');
- $this->smarty_token_names['LDEL'] = $this->smarty->left_delimiter;
- $this->smarty_token_names['RDEL'] = $this->smarty->right_delimiter;
- }
- public static function &instance($new_instance = null)
- {
- static $instance = null;
- if (isset($new_instance) && is_object($new_instance))
- $instance = $new_instance;
- return $instance;
- }
-
-
-
- private $_yy_state = 1;
- private $_yy_stack = array();
-
- function yylex()
- {
- return $this->{'yylex' . $this->_yy_state}();
- }
-
- function yypushstate($state)
- {
- array_push($this->_yy_stack, $this->_yy_state);
- $this->_yy_state = $state;
- }
-
- function yypopstate()
- {
- $this->_yy_state = array_pop($this->_yy_stack);
- }
-
- function yybegin($state)
- {
- $this->_yy_state = $state;
- }
-
-
-
- function yylex1()
- {
- $tokenMap = array (
- 1 => 0,
- 2 => 1,
- 4 => 0,
- 5 => 0,
- 6 => 0,
- 7 => 0,
- 8 => 0,
- 9 => 0,
- 10 => 0,
- 11 => 0,
- 12 => 0,
- 13 => 2,
- 16 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/^(\\{\\})|^(".$this->ldel."\\*([\S\s]*?)\\*".$this->rdel.")|^(<\\?xml)|^(<\\?php)|^(<\\?=)|^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\/literal".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(([\S\s]*?)(".$this->ldel."|<\\?))|^([\S\s]+)/";
-
- do {
- if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {
- $yysubmatches = $yymatches;
- $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
- if (!count($yymatches)) {
- throw new Exception('Error: lexing failed because a rule matched' .
- 'an empty string. Input "' . substr($this->data,
- $this->counter, 5) . '... state TEXT');
- }
- next($yymatches); // skip global match
- $this->token = key($yymatches); // token number
- if ($tokenMap[$this->token]) {
- // extract sub-patterns for passing to lex function
- $yysubmatches = array_slice($yysubmatches, $this->token + 1,
- $tokenMap[$this->token]);
- } else {
- $yysubmatches = array();
- }
- $this->value = current($yymatches); // token value
- $r = $this->{'yy_r1_' . $this->token}($yysubmatches);
- if ($r === null) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- // accept this token
- return true;
- } elseif ($r === true) {
- // we have changed state
- // process this token in the new state
- return $this->yylex();
- } elseif ($r === false) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- // skip this token
- continue;
- } else { $yy_yymore_patterns = array(
- 1 => array(0, "^(".$this->ldel."\\*([\S\s]*?)\\*".$this->rdel.")|^(<\\?xml)|^(<\\?php)|^(<\\?=)|^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\/literal".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(([\S\s]*?)(".$this->ldel."|<\\?))|^([\S\s]+)"),
- 2 => array(1, "^(<\\?xml)|^(<\\?php)|^(<\\?=)|^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\/literal".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(([\S\s]*?)(".$this->ldel."|<\\?))|^([\S\s]+)"),
- 4 => array(1, "^(<\\?php)|^(<\\?=)|^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\/literal".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(([\S\s]*?)(".$this->ldel."|<\\?))|^([\S\s]+)"),
- 5 => array(1, "^(<\\?=)|^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\/literal".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(([\S\s]*?)(".$this->ldel."|<\\?))|^([\S\s]+)"),
- 6 => array(1, "^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\/literal".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(([\S\s]*?)(".$this->ldel."|<\\?))|^([\S\s]+)"),
- 7 => array(1, "^(".$this->ldel."\/literal".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(([\S\s]*?)(".$this->ldel."|<\\?))|^([\S\s]+)"),
- 8 => array(1, "^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(([\S\s]*?)(".$this->ldel."|<\\?))|^([\S\s]+)"),
- 9 => array(1, "^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(([\S\s]*?)(".$this->ldel."|<\\?))|^([\S\s]+)"),
- 10 => array(1, "^(".$this->ldel."\/)|^(".$this->ldel.")|^(([\S\s]*?)(".$this->ldel."|<\\?))|^([\S\s]+)"),
- 11 => array(1, "^(".$this->ldel.")|^(([\S\s]*?)(".$this->ldel."|<\\?))|^([\S\s]+)"),
- 12 => array(1, "^(([\S\s]*?)(".$this->ldel."|<\\?))|^([\S\s]+)"),
- 13 => array(3, "^([\S\s]+)"),
- 16 => array(3, ""),
- );
-
- // yymore is needed
- do {
- if (!strlen($yy_yymore_patterns[$this->token][1])) {
- throw new Exception('cannot do yymore for the last token');
- }
- $yysubmatches = array();
- if (preg_match('/' . $yy_yymore_patterns[$this->token][1] . '/',
- substr($this->data, $this->counter), $yymatches)) {
- $yysubmatches = $yymatches;
- $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
- next($yymatches); // skip global match
- $this->token += key($yymatches) + $yy_yymore_patterns[$this->token][0]; // token number
- $this->value = current($yymatches); // token value
- $this->line = substr_count($this->value, "\n");
- if ($tokenMap[$this->token]) {
- // extract sub-patterns for passing to lex function
- $yysubmatches = array_slice($yysubmatches, $this->token + 1,
- $tokenMap[$this->token]);
- } else {
- $yysubmatches = array();
- }
- }
- $r = $this->{'yy_r1_' . $this->token}($yysubmatches);
- } while ($r !== null && !is_bool($r));
- if ($r === true) {
- // we have changed state
- // process this token in the new state
- return $this->yylex();
- } elseif ($r === false) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- // skip this token
- continue;
- } else {
- // accept
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- return true;
- }
- }
- } else {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const TEXT = 1;
- function yy_r1_1($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
- function yy_r1_2($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_COMMENT;
- }
- function yy_r1_4($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_XML;
- $this->yypushstate(self::PHP);
- }
- function yy_r1_5($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_PHP;
- $this->yypushstate(self::PHP);
- }
- function yy_r1_6($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_SHORTTAGSTART;
- $this->yypushstate(self::PHP);
- }
- function yy_r1_7($yy_subpatterns)
- {
-
- $this->yypushstate(self::LITERAL);
- return true;
- }
- function yy_r1_8($yy_subpatterns)
- {
-
- return false; // unexspected here just ignore
- }
- function yy_r1_9($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal) {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
- $this->yypushstate(self::SMARTY);
- }
- }
- function yy_r1_10($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal) {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDEL;
- $this->yypushstate(self::SMARTY);
- }
- }
- function yy_r1_11($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
- $this->yypushstate(self::SMARTY);
- }
- function yy_r1_12($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LDEL;
- $this->yypushstate(self::SMARTY);
- }
- function yy_r1_13($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- if (substr($this->value,-2) == '<?') {
- $this->value = substr($this->value,0,-2);
- } else {
- $this->value = substr($this->value,0,-strlen($this->smarty->left_delimiter));
- }
- if (strlen($this->value) == 0) {
- return true; // rescan
- }
- }
- function yy_r1_16($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
-
-
- function yylex2()
- {
- $tokenMap = array (
- 1 => 1,
- 3 => 1,
- 5 => 0,
- 6 => 0,
- 7 => 0,
- 8 => 0,
- 9 => 0,
- 10 => 0,
- 11 => 0,
- 12 => 0,
- 13 => 0,
- 14 => 1,
- 16 => 0,
- 17 => 0,
- 18 => 0,
- 19 => 0,
- 20 => 0,
- 21 => 1,
- 23 => 1,
- 25 => 1,
- 27 => 1,
- 29 => 1,
- 31 => 1,
- 33 => 1,
- 35 => 1,
- 37 => 1,
- 39 => 1,
- 41 => 1,
- 43 => 0,
- 44 => 0,
- 45 => 0,
- 46 => 0,
- 47 => 0,
- 48 => 0,
- 49 => 0,
- 50 => 0,
- 51 => 0,
- 52 => 0,
- 53 => 3,
- 57 => 0,
- 58 => 0,
- 59 => 0,
- 60 => 0,
- 61 => 0,
- 62 => 0,
- 63 => 0,
- 64 => 0,
- 65 => 1,
- 67 => 1,
- 69 => 1,
- 71 => 0,
- 72 => 0,
- 73 => 0,
- 74 => 0,
- 75 => 0,
- 76 => 0,
- 77 => 0,
- 78 => 0,
- 79 => 0,
- 80 => 0,
- 81 => 0,
- 82 => 0,
- 83 => 0,
- 84 => 0,
- 85 => 0,
- 86 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/^((\\\\\"|\\\\'))|^(''|'([\S\s]*?)[^\\\\]')|^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\/literal".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(\\s{1,}".$this->rdel.")|^(".$this->ldel."\/)|^(".$this->ldel.")|^(".$this->rdel.")|^(\\s+is\\s+in\\s+)|^(\\s+(AS|as)\\s+)|^(\\s+instanceof\\s+)|^(true|false)|^(null)|^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)/";
-
- do {
- if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {
- $yysubmatches = $yymatches;
- $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
- if (!count($yymatches)) {
- throw new Exception('Error: lexing failed because a rule matched' .
- 'an empty string. Input "' . substr($this->data,
- $this->counter, 5) . '... state SMARTY');
- }
- next($yymatches); // skip global match
- $this->token = key($yymatches); // token number
- if ($tokenMap[$this->token]) {
- // extract sub-patterns for passing to lex function
- $yysubmatches = array_slice($yysubmatches, $this->token + 1,
- $tokenMap[$this->token]);
- } else {
- $yysubmatches = array();
- }
- $this->value = current($yymatches); // token value
- $r = $this->{'yy_r2_' . $this->token}($yysubmatches);
- if ($r === null) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- // accept this token
- return true;
- } elseif ($r === true) {
- // we have changed state
- // process this token in the new state
- return $this->yylex();
- } elseif ($r === false) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- // skip this token
- continue;
- } else { $yy_yymore_patterns = array(
- 1 => array(0, "^(''|'([\S\s]*?)[^\\\\]')|^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\/literal".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(\\s{1,}".$this->rdel.")|^(".$this->ldel."\/)|^(".$this->ldel.")|^(".$this->rdel.")|^(\\s+is\\s+in\\s+)|^(\\s+(AS|as)\\s+)|^(\\s+instanceof\\s+)|^(true|false)|^(null)|^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 3 => array(1, "^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\/literal".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(\\s{1,}".$this->rdel.")|^(".$this->ldel."\/)|^(".$this->ldel.")|^(".$this->rdel.")|^(\\s+is\\s+in\\s+)|^(\\s+(AS|as)\\s+)|^(\\s+instanceof\\s+)|^(true|false)|^(null)|^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 5 => array(1, "^(".$this->ldel."\/literal".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(\\s{1,}".$this->rdel.")|^(".$this->ldel."\/)|^(".$this->ldel.")|^(".$this->rdel.")|^(\\s+is\\s+in\\s+)|^(\\s+(AS|as)\\s+)|^(\\s+instanceof\\s+)|^(true|false)|^(null)|^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 6 => array(1, "^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(\\s{1,}".$this->rdel.")|^(".$this->ldel."\/)|^(".$this->ldel.")|^(".$this->rdel.")|^(\\s+is\\s+in\\s+)|^(\\s+(AS|as)\\s+)|^(\\s+instanceof\\s+)|^(true|false)|^(null)|^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 7 => array(1, "^(".$this->ldel."\\s{1,})|^(\\s{1,}".$this->rdel.")|^(".$this->ldel."\/)|^(".$this->ldel.")|^(".$this->rdel.")|^(\\s+is\\s+in\\s+)|^(\\s+(AS|as)\\s+)|^(\\s+instanceof\\s+)|^(true|false)|^(null)|^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 8 => array(1, "^(\\s{1,}".$this->rdel.")|^(".$this->ldel."\/)|^(".$this->ldel.")|^(".$this->rdel.")|^(\\s+is\\s+in\\s+)|^(\\s+(AS|as)\\s+)|^(\\s+instanceof\\s+)|^(true|false)|^(null)|^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 9 => array(1, "^(".$this->ldel."\/)|^(".$this->ldel.")|^(".$this->rdel.")|^(\\s+is\\s+in\\s+)|^(\\s+(AS|as)\\s+)|^(\\s+instanceof\\s+)|^(true|false)|^(null)|^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 10 => array(1, "^(".$this->ldel.")|^(".$this->rdel.")|^(\\s+is\\s+in\\s+)|^(\\s+(AS|as)\\s+)|^(\\s+instanceof\\s+)|^(true|false)|^(null)|^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 11 => array(1, "^(".$this->rdel.")|^(\\s+is\\s+in\\s+)|^(\\s+(AS|as)\\s+)|^(\\s+instanceof\\s+)|^(true|false)|^(null)|^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 12 => array(1, "^(\\s+is\\s+in\\s+)|^(\\s+(AS|as)\\s+)|^(\\s+instanceof\\s+)|^(true|false)|^(null)|^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 13 => array(1, "^(\\s+(AS|as)\\s+)|^(\\s+instanceof\\s+)|^(true|false)|^(null)|^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 14 => array(2, "^(\\s+instanceof\\s+)|^(true|false)|^(null)|^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 16 => array(2, "^(true|false)|^(null)|^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 17 => array(2, "^(null)|^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 18 => array(2, "^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 19 => array(2, "^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 20 => array(2, "^(\\s*==\\s*|\\s+(EQ|eq)\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 21 => array(3, "^(\\s*!=\\s*|\\s*<>\\s*|\\s+(NE|NEQ|ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 23 => array(4, "^(\\s*>=\\s*|\\s+(GE|GTE|ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 25 => array(5, "^(\\s*<=\\s*|\\s+(LE|LTE|le|lte)\\s+)|^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 27 => array(6, "^(\\s*>\\s*|\\s+(GT|gt)\\s+)|^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 29 => array(7, "^(\\s*<\\s*|\\s+(LT|lt)\\s+)|^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 31 => array(8, "^(\\s+(MOD|mod)\\s+)|^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 33 => array(9, "^(!\\s*|(NOT|not)\\s+)|^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 35 => array(10, "^(\\s*&&\\s*|\\s*(AND|and)\\s+)|^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 37 => array(11, "^(\\s*\\|\\|\\s*|\\s*(OR|or)\\s+)|^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 39 => array(12, "^(\\s*(XOR|xor)\\s+)|^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 41 => array(13, "^(\\s+is\\s+odd\\s+by\\s+)|^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 43 => array(13, "^(\\s+is\\s+not\\s+odd\\s+by\\s+)|^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 44 => array(13, "^(\\s+is\\s+odd)|^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 45 => array(13, "^(\\s+is\\s+not\\s+odd)|^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 46 => array(13, "^(\\s+is\\s+even\\s+by\\s+)|^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 47 => array(13, "^(\\s+is\\s+not\\s+even\\s+by\\s+)|^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 48 => array(13, "^(\\s+is\\s+even)|^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 49 => array(13, "^(\\s+is\\s+not\\s+even)|^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 50 => array(13, "^(\\s+is\\s+div\\s+by\\s+)|^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 51 => array(13, "^(\\s+is\\s+not\\s+div\\s+by\\s+)|^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 52 => array(13, "^(\\((int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)\\))|^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 53 => array(16, "^(\\(\\s*)|^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 57 => array(16, "^(\\s*\\))|^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 58 => array(16, "^(\\[\\s*)|^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 59 => array(16, "^(\\s*\\])|^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 60 => array(16, "^(\\s*->\\s*)|^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 61 => array(16, "^(\\s*=>\\s*)|^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 62 => array(16, "^(\\s*=\\s*)|^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 63 => array(16, "^(\\d+)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 64 => array(16, "^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 65 => array(17, "^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 67 => array(18, "^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 69 => array(19, "^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 71 => array(19, "^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 72 => array(19, "^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 73 => array(19, "^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 74 => array(19, "^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 75 => array(19, "^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 76 => array(19, "^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 77 => array(19, "^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 78 => array(19, "^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 79 => array(19, "^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 80 => array(19, "^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 81 => array(19, "^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 82 => array(19, "^(\\s*\\?\\s*)|^(\\w+)|^(\\s+)|^(.)"),
- 83 => array(19, "^(\\w+)|^(\\s+)|^(.)"),
- 84 => array(19, "^(\\s+)|^(.)"),
- 85 => array(19, "^(.)"),
- 86 => array(19, ""),
- );
-
- // yymore is needed
- do {
- if (!strlen($yy_yymore_patterns[$this->token][1])) {
- throw new Exception('cannot do yymore for the last token');
- }
- $yysubmatches = array();
- if (preg_match('/' . $yy_yymore_patterns[$this->token][1] . '/',
- substr($this->data, $this->counter), $yymatches)) {
- $yysubmatches = $yymatches;
- $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
- next($yymatches); // skip global match
- $this->token += key($yymatches) + $yy_yymore_patterns[$this->token][0]; // token number
- $this->value = current($yymatches); // token value
- $this->line = substr_count($this->value, "\n");
- if ($tokenMap[$this->token]) {
- // extract sub-patterns for passing to lex function
- $yysubmatches = array_slice($yysubmatches, $this->token + 1,
- $tokenMap[$this->token]);
- } else {
- $yysubmatches = array();
- }
- }
- $r = $this->{'yy_r2_' . $this->token}($yysubmatches);
- } while ($r !== null && !is_bool($r));
- if ($r === true) {
- // we have changed state
- // process this token in the new state
- return $this->yylex();
- } elseif ($r === false) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- // skip this token
- continue;
- } else {
- // accept
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- return true;
- }
- }
- } else {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const SMARTY = 2;
- function yy_r2_1($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
- function yy_r2_3($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING;
- }
- function yy_r2_5($yy_subpatterns)
- {
-
- $this->yypushstate(self::LITERAL);
- return true;
- }
- function yy_r2_6($yy_subpatterns)
- {
-
- return false; // unexspected here just ignore
- }
- function yy_r2_7($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal) {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
- $this->yypushstate(self::SMARTY);
- }
- }
- function yy_r2_8($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal) {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDEL;
- $this->yypushstate(self::SMARTY);
- }
- }
- function yy_r2_9($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal) {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_RDEL;
- $this->yypopstate();
- }
- }
- function yy_r2_10($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
- $this->yypushstate(self::SMARTY);
- }
- function yy_r2_11($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LDEL;
- $this->yypushstate(self::SMARTY);
- }
- function yy_r2_12($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_RDEL;
- $this->yypopstate();
- }
- function yy_r2_13($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISIN;
- }
- function yy_r2_14($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_AS;
- }
- function yy_r2_16($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF;
- }
- function yy_r2_17($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_BOOLEAN;
- }
- function yy_r2_18($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_NULL;
- }
- function yy_r2_19($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_IDENTITY;
- }
- function yy_r2_20($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_NONEIDENTITY;
- }
- function yy_r2_21($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_EQUALS;
- }
- function yy_r2_23($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_NOTEQUALS;
- }
- function yy_r2_25($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_GREATEREQUAL;
- }
- function yy_r2_27($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LESSEQUAL;
- }
- function yy_r2_29($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_GREATERTHAN;
- }
- function yy_r2_31($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LESSTHAN;
- }
- function yy_r2_33($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_MOD;
- }
- function yy_r2_35($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_NOT;
- }
- function yy_r2_37($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LAND;
- }
- function yy_r2_39($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LOR;
- }
- function yy_r2_41($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LXOR;
- }
- function yy_r2_43($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISODDBY;
- }
- function yy_r2_44($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISNOTODDBY;
- }
- function yy_r2_45($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISODD;
- }
- function yy_r2_46($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISNOTODD;
- }
- function yy_r2_47($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISEVENBY;
- }
- function yy_r2_48($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISNOTEVENBY;
- }
- function yy_r2_49($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISEVEN;
- }
- function yy_r2_50($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISNOTEVEN;
- }
- function yy_r2_51($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISDIVBY;
- }
- function yy_r2_52($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ISNOTDIVBY;
- }
- function yy_r2_53($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_TYPECAST;
- }
- function yy_r2_57($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OPENP;
- }
- function yy_r2_58($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_CLOSEP;
- }
- function yy_r2_59($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OPENB;
- }
- function yy_r2_60($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_CLOSEB;
- }
- function yy_r2_61($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_PTR;
- }
- function yy_r2_62($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_APTR;
- }
- function yy_r2_63($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_EQUAL;
- }
- function yy_r2_64($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_INTEGER;
- }
- function yy_r2_65($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_INCDEC;
- }
- function yy_r2_67($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_UNIMATH;
- }
- function yy_r2_69($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_MATH;
- }
- function yy_r2_71($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_DOLLAR;
- }
- function yy_r2_72($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_SEMICOLON;
- }
- function yy_r2_73($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON;
- }
- function yy_r2_74($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_COLON;
- }
- function yy_r2_75($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_AT;
- }
- function yy_r2_76($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_HATCH;
- }
- function yy_r2_77($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_QUOTE;
- $this->yypushstate(self::DOUBLEQUOTEDSTRING);
- }
- function yy_r2_78($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
- $this->yypopstate();
- }
- function yy_r2_79($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_VERT;
- }
- function yy_r2_80($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_DOT;
- }
- function yy_r2_81($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_COMMA;
- }
- function yy_r2_82($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ANDSYM;
- }
- function yy_r2_83($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_QMARK;
- }
- function yy_r2_84($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_ID;
- }
- function yy_r2_85($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_SPACE;
- }
- function yy_r2_86($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
-
-
- function yylex3()
- {
- $tokenMap = array (
- 1 => 0,
- 2 => 1,
- 4 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/^(\\?>)|^(([\S\s]*?)\\?>)|^([\S\s]+)/";
-
- do {
- if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {
- $yysubmatches = $yymatches;
- $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
- if (!count($yymatches)) {
- throw new Exception('Error: lexing failed because a rule matched' .
- 'an empty string. Input "' . substr($this->data,
- $this->counter, 5) . '... state PHP');
- }
- next($yymatches); // skip global match
- $this->token = key($yymatches); // token number
- if ($tokenMap[$this->token]) {
- // extract sub-patterns for passing to lex function
- $yysubmatches = array_slice($yysubmatches, $this->token + 1,
- $tokenMap[$this->token]);
- } else {
- $yysubmatches = array();
- }
- $this->value = current($yymatches); // token value
- $r = $this->{'yy_r3_' . $this->token}($yysubmatches);
- if ($r === null) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- // accept this token
- return true;
- } elseif ($r === true) {
- // we have changed state
- // process this token in the new state
- return $this->yylex();
- } elseif ($r === false) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- // skip this token
- continue;
- } else { $yy_yymore_patterns = array(
- 1 => array(0, "^(([\S\s]*?)\\?>)|^([\S\s]+)"),
- 2 => array(1, "^([\S\s]+)"),
- 4 => array(1, ""),
- );
-
- // yymore is needed
- do {
- if (!strlen($yy_yymore_patterns[$this->token][1])) {
- throw new Exception('cannot do yymore for the last token');
- }
- $yysubmatches = array();
- if (preg_match('/' . $yy_yymore_patterns[$this->token][1] . '/',
- substr($this->data, $this->counter), $yymatches)) {
- $yysubmatches = $yymatches;
- $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
- next($yymatches); // skip global match
- $this->token += key($yymatches) + $yy_yymore_patterns[$this->token][0]; // token number
- $this->value = current($yymatches); // token value
- $this->line = substr_count($this->value, "\n");
- if ($tokenMap[$this->token]) {
- // extract sub-patterns for passing to lex function
- $yysubmatches = array_slice($yysubmatches, $this->token + 1,
- $tokenMap[$this->token]);
- } else {
- $yysubmatches = array();
- }
- }
- $r = $this->{'yy_r3_' . $this->token}($yysubmatches);
- } while ($r !== null && !is_bool($r));
- if ($r === true) {
- // we have changed state
- // process this token in the new state
- return $this->yylex();
- } elseif ($r === false) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- // skip this token
- continue;
- } else {
- // accept
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- return true;
- }
- }
- } else {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const PHP = 3;
- function yy_r3_1($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_SHORTTAGEND;
- $this->yypopstate();
- }
- function yy_r3_2($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- $this->value = substr($this->value,0,-2);
- }
- function yy_r3_4($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
-
-
- function yylex4()
- {
- $tokenMap = array (
- 1 => 0,
- 2 => 0,
- 3 => 1,
- 5 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\/literal".$this->rdel.")|^(([\S\s]*?)".$this->ldel."\/literal".$this->rdel.")|^([\S\s]+)/";
-
- do {
- if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {
- $yysubmatches = $yymatches;
- $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
- if (!count($yymatches)) {
- throw new Exception('Error: lexing failed because a rule matched' .
- 'an empty string. Input "' . substr($this->data,
- $this->counter, 5) . '... state LITERAL');
- }
- next($yymatches); // skip global match
- $this->token = key($yymatches); // token number
- if ($tokenMap[$this->token]) {
- // extract sub-patterns for passing to lex function
- $yysubmatches = array_slice($yysubmatches, $this->token + 1,
- $tokenMap[$this->token]);
- } else {
- $yysubmatches = array();
- }
- $this->value = current($yymatches); // token value
- $r = $this->{'yy_r4_' . $this->token}($yysubmatches);
- if ($r === null) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- // accept this token
- return true;
- } elseif ($r === true) {
- // we have changed state
- // process this token in the new state
- return $this->yylex();
- } elseif ($r === false) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- // skip this token
- continue;
- } else { $yy_yymore_patterns = array(
- 1 => array(0, "^(".$this->ldel."\/literal".$this->rdel.")|^(([\S\s]*?)".$this->ldel."\/literal".$this->rdel.")|^([\S\s]+)"),
- 2 => array(0, "^(([\S\s]*?)".$this->ldel."\/literal".$this->rdel.")|^([\S\s]+)"),
- 3 => array(1, "^([\S\s]+)"),
- 5 => array(1, ""),
- );
-
- // yymore is needed
- do {
- if (!strlen($yy_yymore_patterns[$this->token][1])) {
- throw new Exception('cannot do yymore for the last token');
- }
- $yysubmatches = array();
- if (preg_match('/' . $yy_yymore_patterns[$this->token][1] . '/',
- substr($this->data, $this->counter), $yymatches)) {
- $yysubmatches = $yymatches;
- $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
- next($yymatches); // skip global match
- $this->token += key($yymatches) + $yy_yymore_patterns[$this->token][0]; // token number
- $this->value = current($yymatches); // token value
- $this->line = substr_count($this->value, "\n");
- if ($tokenMap[$this->token]) {
- // extract sub-patterns for passing to lex function
- $yysubmatches = array_slice($yysubmatches, $this->token + 1,
- $tokenMap[$this->token]);
- } else {
- $yysubmatches = array();
- }
- }
- $r = $this->{'yy_r4_' . $this->token}($yysubmatches);
- } while ($r !== null && !is_bool($r));
- if ($r === true) {
- // we have changed state
- // process this token in the new state
- return $this->yylex();
- } elseif ($r === false) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- // skip this token
- continue;
- } else {
- // accept
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- return true;
- }
- }
- } else {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const LITERAL = 4;
- function yy_r4_1($yy_subpatterns)
- {
-
- return false;
- }
- function yy_r4_2($yy_subpatterns)
- {
-
- $this->yypopstate();
- return false;
- }
- function yy_r4_3($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- $this->value = substr($this->value,0,-strlen($this->smarty->left_delimiter)-strlen($this->smarty->right_delimiter)-8);
- $this->yypopstate();
- if (strlen($this->value) == 0) {
- return false; // change state directly
- } else {
- return; // change state after processiing token
- }
- }
- function yy_r4_5($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
-
-
- function yylex5()
- {
- $tokenMap = array (
- 1 => 0,
- 2 => 0,
- 3 => 0,
- 4 => 0,
- 5 => 0,
- 6 => 0,
- 7 => 0,
- 8 => 0,
- 9 => 2,
- 12 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(\")|^(`\\$)|^(\\$\\w+)|^(\\$)|^(([\S\s]*?)(\\\\\\\\|[^\\\\]\"|".$this->ldel."|\\$|`\\$))|^([\S\s]+)/";
-
- do {
- if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {
- $yysubmatches = $yymatches;
- $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
- if (!count($yymatches)) {
- throw new Exception('Error: lexing failed because a rule matched' .
- 'an empty string. Input "' . substr($this->data,
- $this->counter, 5) . '... state DOUBLEQUOTEDSTRING');
- }
- next($yymatches); // skip global match
- $this->token = key($yymatches); // token number
- if ($tokenMap[$this->token]) {
- // extract sub-patterns for passing to lex function
- $yysubmatches = array_slice($yysubmatches, $this->token + 1,
- $tokenMap[$this->token]);
- } else {
- $yysubmatches = array();
- }
- $this->value = current($yymatches); // token value
- $r = $this->{'yy_r5_' . $this->token}($yysubmatches);
- if ($r === null) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- // accept this token
- return true;
- } elseif ($r === true) {
- // we have changed state
- // process this token in the new state
- return $this->yylex();
- } elseif ($r === false) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- // skip this token
- continue;
- } else { $yy_yymore_patterns = array(
- 1 => array(0, "^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(\")|^(`\\$)|^(\\$\\w+)|^(\\$)|^(([\S\s]*?)(\\\\\\\\|[^\\\\]\"|".$this->ldel."|\\$|`\\$))|^([\S\s]+)"),
- 2 => array(0, "^(".$this->ldel."\/)|^(".$this->ldel.")|^(\")|^(`\\$)|^(\\$\\w+)|^(\\$)|^(([\S\s]*?)(\\\\\\\\|[^\\\\]\"|".$this->ldel."|\\$|`\\$))|^([\S\s]+)"),
- 3 => array(0, "^(".$this->ldel.")|^(\")|^(`\\$)|^(\\$\\w+)|^(\\$)|^(([\S\s]*?)(\\\\\\\\|[^\\\\]\"|".$this->ldel."|\\$|`\\$))|^([\S\s]+)"),
- 4 => array(0, "^(\")|^(`\\$)|^(\\$\\w+)|^(\\$)|^(([\S\s]*?)(\\\\\\\\|[^\\\\]\"|".$this->ldel."|\\$|`\\$))|^([\S\s]+)"),
- 5 => array(0, "^(`\\$)|^(\\$\\w+)|^(\\$)|^(([\S\s]*?)(\\\\\\\\|[^\\\\]\"|".$this->ldel."|\\$|`\\$))|^([\S\s]+)"),
- 6 => array(0, "^(\\$\\w+)|^(\\$)|^(([\S\s]*?)(\\\\\\\\|[^\\\\]\"|".$this->ldel."|\\$|`\\$))|^([\S\s]+)"),
- 7 => array(0, "^(\\$)|^(([\S\s]*?)(\\\\\\\\|[^\\\\]\"|".$this->ldel."|\\$|`\\$))|^([\S\s]+)"),
- 8 => array(0, "^(([\S\s]*?)(\\\\\\\\|[^\\\\]\"|".$this->ldel."|\\$|`\\$))|^([\S\s]+)"),
- 9 => array(2, "^([\S\s]+)"),
- 12 => array(2, ""),
- );
-
- // yymore is needed
- do {
- if (!strlen($yy_yymore_patterns[$this->token][1])) {
- throw new Exception('cannot do yymore for the last token');
- }
- $yysubmatches = array();
- if (preg_match('/' . $yy_yymore_patterns[$this->token][1] . '/',
- substr($this->data, $this->counter), $yymatches)) {
- $yysubmatches = $yymatches;
- $yymatches = array_filter($yymatches, 'strlen'); // remove empty sub-patterns
- next($yymatches); // skip global match
- $this->token += key($yymatches) + $yy_yymore_patterns[$this->token][0]; // token number
- $this->value = current($yymatches); // token value
- $this->line = substr_count($this->value, "\n");
- if ($tokenMap[$this->token]) {
- // extract sub-patterns for passing to lex function
- $yysubmatches = array_slice($yysubmatches, $this->token + 1,
- $tokenMap[$this->token]);
- } else {
- $yysubmatches = array();
- }
- }
- $r = $this->{'yy_r5_' . $this->token}($yysubmatches);
- } while ($r !== null && !is_bool($r));
- if ($r === true) {
- // we have changed state
- // process this token in the new state
- return $this->yylex();
- } elseif ($r === false) {
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- // skip this token
- continue;
- } else {
- // accept
- $this->counter += strlen($this->value);
- $this->line += substr_count($this->value, "\n");
- return true;
- }
- }
- } else {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const DOUBLEQUOTEDSTRING = 5;
- function yy_r5_1($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal) {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
- $this->yypushstate(self::SMARTY);
- }
- }
- function yy_r5_2($yy_subpatterns)
- {
-
- if ($this->smarty->auto_literal) {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_LDEL;
- $this->yypushstate(self::SMARTY);
- }
- }
- function yy_r5_3($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
- $this->yypushstate(self::SMARTY);
- }
- function yy_r5_4($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LDEL;
- $this->yypushstate(self::SMARTY);
- }
- function yy_r5_5($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_QUOTE;
- $this->yypopstate();
- }
- function yy_r5_6($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
- $this->value = substr($this->value,0,-1);
- $this->yypushstate(self::SMARTY);
- }
- function yy_r5_7($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_DOLLARID;
- }
- function yy_r5_8($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
- function yy_r5_9($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- if (substr($this->value,-strlen($this->smarty->left_delimiter)) == $this->smarty->left_delimiter) {
- $this->value = substr($this->value,0,-strlen($this->smarty->left_delimiter));
- } elseif (substr($this->value,-2) == '`$') {
- $this->value = substr($this->value,0,-2);
- } elseif (strpbrk(substr($this->value,-1),'"$') !== false) {
- $this->value = substr($this->value,0,-1);
- }
- if (strlen($this->value) == 0) {
- return true; // rescan
- }
- }
- function yy_r5_12($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- }
-
-}
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_templateparser.php b/includes/Smarty/sysplugins/smarty_internal_templateparser.php
deleted file mode 100644
index ca98df5..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_templateparser.php
+++ /dev/null
@@ -1,2735 +0,0 @@
-<?php
-/**
-* Smarty Internal Plugin Templateparser
-*
-* This is the template parser.
-* It is generated from the internal.templateparser.y file
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-
-/**
- * This can be used to store both the string representation of
- * a token, and any useful meta-data associated with the token.
- *
- * meta-data should be stored as an array
- */
-class TP_yyToken implements ArrayAccess
-{
- public $string = '';
- public $metadata = array();
-
- function __construct($s, $m = array())
- {
- if ($s instanceof TP_yyToken) {
- $this->string = $s->string;
- $this->metadata = $s->metadata;
- } else {
- $this->string = (string) $s;
- if ($m instanceof TP_yyToken) {
- $this->metadata = $m->metadata;
- } elseif (is_array($m)) {
- $this->metadata = $m;
- }
- }
- }
-
- function __toString()
- {
- return $this->_string;
- }
-
- function offsetExists($offset)
- {
- return isset($this->metadata[$offset]);
- }
-
- function offsetGet($offset)
- {
- return $this->metadata[$offset];
- }
-
- function offsetSet($offset, $value)
- {
- if ($offset === null) {
- if (isset($value[0])) {
- $x = ($value instanceof TP_yyToken) ?
- $value->metadata : $value;
- $this->metadata = array_merge($this->metadata, $x);
- return;
- }
- $offset = count($this->metadata);
- }
- if ($value === null) {
- return;
- }
- if ($value instanceof TP_yyToken) {
- if ($value->metadata) {
- $this->metadata[$offset] = $value->metadata;
- }
- } elseif ($value) {
- $this->metadata[$offset] = $value;
- }
- }
-
- function offsetUnset($offset)
- {
- unset($this->metadata[$offset]);
- }
-}
-
-/** The following structure represents a single element of the
- * parser's stack. Information stored includes:
- *
- * + The state number for the parser at this level of the stack.
- *
- * + The value of the token stored at this level of the stack.
- * (In other words, the "major" token.)
- *
- * + The semantic value stored at this level of the stack. This is
- * the information used by the action routines in the grammar.
- * It is sometimes called the "minor" token.
- */
-class TP_yyStackEntry
-{
- public $stateno; /* The state-number */
- public $major; /* The major token value. This is the code
- ** number for the token at this stack level */
- public $minor; /* The user-supplied minor token value. This
- ** is the value of the token */
-};
-
-// code external to the class is included here
-
-// declare_class is output here
-#line 12 "smarty_internal_templateparser.y"
-class Smarty_Internal_Templateparser#line 109 "smarty_internal_templateparser.php"
-{
-/* First off, code is included which follows the "include_class" declaration
-** in the input file. */
-#line 14 "smarty_internal_templateparser.y"
-
- // states whether the parse was successful or not
- public $successful = true;
- public $retvalue = 0;
- private $lex;
- private $internalError = false;
-
- function __construct($lex, $compiler) {
- // set instance object
- self::instance($this);
- $this->lex = $lex;
- $this->compiler = $compiler;
- $this->smarty = $this->compiler->smarty;
- $this->template = $this->compiler->template;
- if ($this->template->security && isset($this->smarty->security_handler)) {
- $this->sec_obj = $this->smarty->security_policy;
- } else {
- $this->sec_obj = $this->smarty;
- }
- $this->cacher = $this->template->cacher_object;
- $this->compiler->has_variable_string = false;
- $this->compiler->prefix_code = array();
- $this->prefix_number = 0;
- }
- public static function &instance($new_instance = null)
- {
- static $instance = null;
- if (isset($new_instance) && is_object($new_instance))
- $instance = $new_instance;
- return $instance;
- }
-
-#line 147 "smarty_internal_templateparser.php"
-
-/* Next is all token values, as class constants
-*/
-/*
-** These constants (all generated automatically by the parser generator)
-** specify the various kinds of tokens (terminals) that the parser
-** understands.
-**
-** Each symbol here is a terminal symbol in the grammar.
-*/
- const TP_COMMENT = 1;
- const TP_PHP = 2;
- const TP_OTHER = 3;
- const TP_SHORTTAGEND = 4;
- const TP_SHORTTAGSTART = 5;
- const TP_XML = 6;
- const TP_LDEL = 7;
- const TP_RDEL = 8;
- const TP_EQUAL = 9;
- const TP_ID = 10;
- const TP_PTR = 11;
- const TP_SPACE = 12;
- const TP_SEMICOLON = 13;
- const TP_DOLLAR = 14;
- const TP_INCDEC = 15;
- const TP_AS = 16;
- const TP_APTR = 17;
- const TP_LDELSLASH = 18;
- const TP_INTEGER = 19;
- const TP_COMMA = 20;
- const TP_COLON = 21;
- const TP_UNIMATH = 22;
- const TP_OPENP = 23;
- const TP_CLOSEP = 24;
- const TP_QMARK = 25;
- const TP_MATH = 26;
- const TP_ANDSYM = 27;
- const TP_TYPECAST = 28;
- const TP_DOT = 29;
- const TP_BOOLEAN = 30;
- const TP_NULL = 31;
- const TP_SINGLEQUOTESTRING = 32;
- const TP_QUOTE = 33;
- const TP_DOUBLECOLON = 34;
- const TP_AT = 35;
- const TP_HATCH = 36;
- const TP_OPENB = 37;
- const TP_CLOSEB = 38;
- const TP_VERT = 39;
- const TP_NOT = 40;
- const TP_ISIN = 41;
- const TP_ISDIVBY = 42;
- const TP_ISNOTDIVBY = 43;
- const TP_ISEVEN = 44;
- const TP_ISNOTEVEN = 45;
- const TP_ISEVENBY = 46;
- const TP_ISNOTEVENBY = 47;
- const TP_ISODD = 48;
- const TP_ISNOTODD = 49;
- const TP_ISODDBY = 50;
- const TP_ISNOTODDBY = 51;
- const TP_INSTANCEOF = 52;
- const TP_EQUALS = 53;
- const TP_NOTEQUALS = 54;
- const TP_GREATERTHAN = 55;
- const TP_LESSTHAN = 56;
- const TP_GREATEREQUAL = 57;
- const TP_LESSEQUAL = 58;
- const TP_IDENTITY = 59;
- const TP_NONEIDENTITY = 60;
- const TP_MOD = 61;
- const TP_LAND = 62;
- const TP_LOR = 63;
- const TP_LXOR = 64;
- const TP_BACKTICK = 65;
- const TP_DOLLARID = 66;
- const YY_NO_ACTION = 493;
- const YY_ACCEPT_ACTION = 492;
- const YY_ERROR_ACTION = 491;
-
-/* Next are that tables used to determine what action to take based on the
-** current state and lookahead token. These tables are used to implement
-** functions that take a state number and lookahead value and return an
-** action integer.
-**
-** Suppose the action integer is N. Then the action is determined as
-** follows
-**
-** 0 <= N < self::YYNSTATE Shift N. That is,
-** push the lookahead
-** token onto the stack
-** and goto state N.
-**
-** self::YYNSTATE <= N < self::YYNSTATE+self::YYNRULE Reduce by rule N-YYNSTATE.
-**
-** N == self::YYNSTATE+self::YYNRULE A syntax error has occurred.
-**
-** N == self::YYNSTATE+self::YYNRULE+1 The parser accepts its
-** input. (and concludes parsing)
-**
-** N == self::YYNSTATE+self::YYNRULE+2 No such action. Denotes unused
-** slots in the yy_action[] table.
-**
-** The action table is constructed as a single large static array $yy_action.
-** Given state S and lookahead X, the action is computed as
-**
-** self::$yy_action[self::$yy_shift_ofst[S] + X ]
-**
-** If the index value self::$yy_shift_ofst[S]+X is out of range or if the value
-** self::$yy_lookahead[self::$yy_shift_ofst[S]+X] is not equal to X or if
-** self::$yy_shift_ofst[S] is equal to self::YY_SHIFT_USE_DFLT, it means that
-** the action is not in the table and that self::$yy_default[S] should be used instead.
-**
-** The formula above is for computing the action when the lookahead is
-** a terminal symbol. If the lookahead is a non-terminal (as occurs after
-** a reduce action) then the static $yy_reduce_ofst array is used in place of
-** the static $yy_shift_ofst array and self::YY_REDUCE_USE_DFLT is used in place of
-** self::YY_SHIFT_USE_DFLT.
-**
-** The following are the tables generated in this section:
-**
-** self::$yy_action A single table containing all actions.
-** self::$yy_lookahead A table containing the lookahead for each entry in
-** yy_action. Used to detect hash collisions.
-** self::$yy_shift_ofst For each state, the offset into self::$yy_action for
-** shifting terminals.
-** self::$yy_reduce_ofst For each state, the offset into self::$yy_action for
-** shifting non-terminals after a reduce.
-** self::$yy_default Default action for each state.
-*/
- const YY_SZ_ACTTAB = 1436;
-static public $yy_action = array(
- /* 0 */ 19, 111, 26, 164, 23, 319, 35, 73, 17, 117,
- /* 10 */ 322, 194, 198, 77, 126, 42, 3, 492, 63, 224,
- /* 20 */ 222, 59, 293, 323, 302, 318, 47, 166, 234, 51,
- /* 30 */ 13, 19, 306, 4, 158, 51, 300, 299, 77, 314,
- /* 40 */ 195, 236, 194, 198, 81, 156, 42, 36, 250, 81,
- /* 50 */ 106, 45, 59, 290, 323, 302, 318, 47, 303, 37,
- /* 60 */ 51, 13, 256, 19, 259, 240, 157, 312, 214, 259,
- /* 70 */ 78, 161, 18, 203, 194, 160, 190, 128, 42, 3,
- /* 80 */ 77, 237, 173, 194, 59, 34, 323, 302, 318, 47,
- /* 90 */ 155, 234, 51, 13, 19, 306, 4, 164, 228, 300,
- /* 100 */ 299, 73, 51, 166, 236, 194, 198, 306, 176, 42,
- /* 110 */ 36, 300, 299, 26, 305, 59, 319, 323, 302, 318,
- /* 120 */ 47, 166, 321, 51, 13, 19, 161, 269, 164, 255,
- /* 130 */ 56, 212, 73, 314, 195, 239, 194, 198, 81, 161,
- /* 140 */ 42, 2, 26, 225, 43, 319, 59, 247, 323, 302,
- /* 150 */ 318, 47, 303, 289, 51, 13, 114, 26, 259, 28,
- /* 160 */ 319, 8, 7, 280, 282, 12, 10, 304, 281, 11,
- /* 170 */ 5, 8, 7, 280, 282, 12, 10, 304, 281, 11,
- /* 180 */ 5, 278, 283, 284, 145, 192, 362, 15, 31, 112,
- /* 190 */ 362, 278, 283, 284, 229, 208, 241, 242, 205, 252,
- /* 200 */ 19, 21, 136, 234, 26, 207, 28, 319, 199, 172,
- /* 210 */ 161, 194, 118, 8, 7, 280, 282, 12, 10, 304,
- /* 220 */ 281, 11, 5, 8, 7, 280, 282, 12, 10, 304,
- /* 230 */ 281, 11, 5, 278, 283, 284, 20, 166, 44, 19,
- /* 240 */ 44, 21, 163, 278, 283, 284, 77, 187, 298, 243,
- /* 250 */ 194, 198, 118, 161, 42, 36, 249, 123, 45, 277,
- /* 260 */ 59, 24, 323, 302, 318, 47, 37, 21, 51, 13,
- /* 270 */ 19, 234, 286, 165, 166, 183, 1, 77, 118, 310,
- /* 280 */ 161, 194, 198, 161, 236, 42, 36, 21, 125, 39,
- /* 290 */ 296, 59, 153, 323, 302, 318, 47, 154, 118, 51,
- /* 300 */ 13, 19, 234, 166, 46, 226, 258, 358, 73, 81,
- /* 310 */ 166, 161, 194, 198, 255, 142, 42, 2, 233, 124,
- /* 320 */ 260, 166, 59, 153, 323, 302, 318, 47, 166, 259,
- /* 330 */ 51, 13, 19, 234, 309, 159, 103, 139, 161, 73,
- /* 340 */ 314, 195, 260, 194, 198, 81, 121, 42, 36, 26,
- /* 350 */ 151, 295, 319, 59, 221, 323, 302, 318, 47, 303,
- /* 360 */ 234, 51, 13, 19, 147, 259, 165, 21, 120, 109,
- /* 370 */ 77, 138, 152, 150, 194, 198, 311, 192, 118, 36,
- /* 380 */ 161, 197, 234, 234, 59, 297, 323, 302, 318, 47,
- /* 390 */ 191, 214, 51, 13, 81, 18, 8, 7, 280, 282,
- /* 400 */ 12, 10, 304, 281, 11, 5, 194, 27, 181, 274,
- /* 410 */ 196, 219, 81, 161, 259, 33, 278, 283, 284, 314,
- /* 420 */ 195, 218, 62, 22, 81, 255, 316, 88, 174, 170,
- /* 430 */ 161, 64, 259, 169, 184, 360, 102, 166, 303, 360,
- /* 440 */ 29, 254, 314, 195, 259, 81, 217, 81, 16, 279,
- /* 450 */ 223, 222, 19, 56, 212, 165, 268, 273, 235, 77,
- /* 460 */ 77, 303, 161, 194, 198, 259, 270, 259, 36, 26,
- /* 470 */ 294, 129, 319, 59, 320, 323, 302, 318, 47, 186,
- /* 480 */ 178, 51, 51, 19, 200, 262, 167, 266, 277, 161,
- /* 490 */ 77, 161, 285, 49, 194, 198, 161, 26, 193, 36,
- /* 500 */ 202, 153, 108, 166, 59, 40, 323, 302, 318, 47,
- /* 510 */ 53, 26, 51, 166, 319, 40, 234, 267, 261, 263,
- /* 520 */ 264, 265, 275, 276, 287, 288, 25, 267, 261, 263,
- /* 530 */ 264, 265, 275, 276, 287, 288, 314, 195, 227, 62,
- /* 540 */ 30, 81, 141, 219, 86, 38, 161, 260, 211, 67,
- /* 550 */ 189, 307, 77, 102, 137, 303, 65, 201, 166, 260,
- /* 560 */ 140, 259, 314, 195, 295, 62, 279, 81, 232, 230,
- /* 570 */ 96, 295, 52, 166, 51, 131, 189, 307, 220, 102,
- /* 580 */ 105, 303, 66, 100, 166, 314, 195, 259, 62, 234,
- /* 590 */ 81, 99, 279, 92, 171, 295, 101, 295, 295, 189,
- /* 600 */ 307, 317, 102, 166, 303, 40, 295, 177, 320, 153,
- /* 610 */ 259, 295, 9, 57, 15, 279, 251, 267, 261, 263,
- /* 620 */ 264, 265, 275, 276, 287, 288, 199, 314, 195, 31,
- /* 630 */ 62, 209, 81, 26, 301, 91, 319, 175, 179, 315,
- /* 640 */ 58, 189, 307, 182, 102, 291, 303, 75, 314, 195,
- /* 650 */ 248, 62, 259, 81, 79, 213, 93, 279, 210, 22,
- /* 660 */ 206, 257, 189, 307, 43, 102, 76, 303, 215, 80,
- /* 670 */ 216, 314, 195, 259, 62, 292, 81, 246, 279, 90,
- /* 680 */ 72, 32, 185, 245, 70, 189, 307, 6, 102, 244,
- /* 690 */ 303, 233, 314, 195, 127, 62, 259, 81, 41, 161,
- /* 700 */ 89, 279, 44, 84, 74, 320, 189, 307, 236, 102,
- /* 710 */ 39, 303, 253, 314, 195, 308, 62, 259, 81, 50,
- /* 720 */ 14, 95, 279, 276, 276, 276, 276, 189, 307, 276,
- /* 730 */ 102, 276, 303, 276, 314, 195, 276, 62, 259, 81,
- /* 740 */ 276, 276, 94, 279, 276, 276, 276, 276, 189, 307,
- /* 750 */ 276, 102, 276, 303, 276, 276, 276, 314, 195, 259,
- /* 760 */ 61, 276, 81, 276, 279, 87, 276, 276, 276, 276,
- /* 770 */ 276, 189, 307, 276, 102, 276, 303, 276, 314, 195,
- /* 780 */ 276, 115, 259, 81, 276, 276, 276, 279, 276, 276,
- /* 790 */ 276, 276, 238, 307, 276, 102, 276, 303, 276, 314,
- /* 800 */ 195, 276, 60, 259, 81, 276, 276, 85, 276, 276,
- /* 810 */ 276, 168, 272, 189, 307, 276, 102, 276, 303, 276,
- /* 820 */ 314, 195, 276, 115, 259, 81, 276, 276, 276, 279,
- /* 830 */ 276, 276, 276, 276, 238, 307, 276, 102, 276, 303,
- /* 840 */ 276, 276, 276, 314, 195, 259, 110, 276, 81, 276,
- /* 850 */ 276, 276, 276, 276, 271, 276, 276, 238, 307, 276,
- /* 860 */ 102, 276, 303, 276, 276, 204, 276, 276, 259, 314,
- /* 870 */ 68, 276, 48, 83, 71, 276, 314, 195, 276, 110,
- /* 880 */ 276, 81, 276, 238, 307, 276, 102, 276, 303, 276,
- /* 890 */ 238, 307, 276, 102, 259, 303, 276, 276, 188, 276,
- /* 900 */ 276, 259, 276, 276, 276, 276, 314, 69, 276, 54,
- /* 910 */ 83, 71, 276, 276, 276, 276, 276, 276, 276, 276,
- /* 920 */ 238, 307, 276, 102, 276, 303, 276, 276, 276, 314,
- /* 930 */ 195, 259, 55, 82, 81, 276, 276, 276, 276, 276,
- /* 940 */ 276, 276, 276, 238, 307, 276, 102, 276, 303, 276,
- /* 950 */ 276, 276, 276, 276, 259, 314, 195, 276, 110, 276,
- /* 960 */ 81, 276, 276, 276, 276, 276, 276, 276, 276, 238,
- /* 970 */ 307, 276, 102, 276, 303, 276, 276, 180, 314, 195,
- /* 980 */ 259, 149, 231, 81, 276, 276, 276, 276, 276, 276,
- /* 990 */ 276, 276, 162, 307, 276, 102, 276, 303, 276, 276,
- /* 1000 */ 276, 314, 195, 259, 110, 276, 81, 276, 276, 276,
- /* 1010 */ 276, 276, 276, 276, 276, 238, 307, 276, 102, 276,
- /* 1020 */ 303, 276, 276, 313, 276, 276, 259, 314, 195, 276,
- /* 1030 */ 135, 276, 81, 276, 276, 276, 276, 276, 276, 276,
- /* 1040 */ 276, 238, 307, 276, 102, 276, 303, 276, 276, 276,
- /* 1050 */ 314, 195, 259, 107, 276, 81, 276, 276, 276, 276,
- /* 1060 */ 276, 276, 276, 276, 238, 307, 276, 102, 276, 303,
- /* 1070 */ 276, 276, 276, 314, 195, 259, 144, 276, 81, 276,
- /* 1080 */ 276, 276, 276, 276, 276, 276, 276, 238, 307, 276,
- /* 1090 */ 102, 276, 303, 276, 276, 276, 276, 276, 259, 314,
- /* 1100 */ 195, 276, 113, 276, 81, 276, 276, 276, 276, 276,
- /* 1110 */ 276, 276, 276, 238, 307, 276, 102, 276, 303, 276,
- /* 1120 */ 276, 276, 314, 195, 259, 122, 276, 81, 276, 276,
- /* 1130 */ 276, 276, 276, 276, 276, 276, 238, 307, 276, 102,
- /* 1140 */ 276, 303, 276, 276, 276, 314, 195, 259, 134, 276,
- /* 1150 */ 81, 276, 276, 276, 276, 276, 276, 276, 276, 238,
- /* 1160 */ 307, 276, 102, 276, 303, 276, 276, 276, 276, 276,
- /* 1170 */ 259, 314, 195, 276, 143, 276, 81, 276, 276, 276,
- /* 1180 */ 276, 276, 276, 276, 276, 238, 307, 276, 102, 276,
- /* 1190 */ 303, 276, 276, 276, 314, 195, 259, 132, 276, 81,
- /* 1200 */ 276, 276, 276, 276, 276, 276, 276, 276, 238, 307,
- /* 1210 */ 276, 102, 276, 303, 276, 276, 276, 314, 195, 259,
- /* 1220 */ 146, 276, 81, 276, 276, 276, 276, 276, 276, 276,
- /* 1230 */ 276, 238, 307, 276, 102, 276, 303, 276, 276, 276,
- /* 1240 */ 276, 276, 259, 314, 195, 276, 148, 276, 81, 276,
- /* 1250 */ 276, 276, 276, 276, 276, 276, 276, 238, 307, 276,
- /* 1260 */ 102, 276, 303, 276, 276, 276, 314, 195, 259, 130,
- /* 1270 */ 276, 81, 276, 276, 276, 276, 276, 276, 276, 276,
- /* 1280 */ 238, 307, 276, 102, 276, 303, 276, 276, 276, 314,
- /* 1290 */ 195, 259, 116, 276, 81, 276, 276, 276, 276, 276,
- /* 1300 */ 276, 276, 276, 238, 307, 276, 102, 276, 303, 276,
- /* 1310 */ 276, 276, 276, 276, 259, 314, 195, 276, 133, 276,
- /* 1320 */ 81, 276, 276, 276, 276, 276, 276, 276, 276, 238,
- /* 1330 */ 307, 276, 102, 276, 303, 276, 276, 276, 314, 195,
- /* 1340 */ 259, 119, 276, 81, 276, 276, 276, 276, 276, 276,
- /* 1350 */ 276, 276, 238, 307, 276, 102, 276, 303, 276, 276,
- /* 1360 */ 276, 314, 195, 259, 276, 276, 81, 276, 276, 276,
- /* 1370 */ 276, 276, 276, 276, 276, 238, 307, 276, 98, 276,
- /* 1380 */ 303, 276, 276, 276, 276, 276, 259, 314, 195, 276,
- /* 1390 */ 276, 276, 81, 276, 276, 276, 276, 276, 276, 276,
- /* 1400 */ 276, 238, 307, 276, 97, 276, 303, 276, 276, 276,
- /* 1410 */ 314, 195, 259, 276, 276, 81, 276, 276, 276, 276,
- /* 1420 */ 276, 276, 276, 276, 238, 307, 276, 104, 276, 303,
- /* 1430 */ 276, 276, 276, 276, 276, 259,
- );
- static public $yy_lookahead = array(
- /* 0 */ 7, 95, 7, 10, 9, 10, 7, 14, 20, 10,
- /* 10 */ 15, 18, 19, 14, 73, 22, 23, 68, 69, 70,
- /* 20 */ 71, 28, 10, 30, 31, 32, 33, 39, 87, 36,
- /* 30 */ 37, 7, 22, 40, 10, 36, 26, 27, 14, 71,
- /* 40 */ 72, 100, 18, 19, 76, 72, 22, 23, 38, 76,
- /* 50 */ 95, 29, 28, 85, 30, 31, 32, 33, 90, 37,
- /* 60 */ 36, 37, 38, 7, 96, 92, 10, 8, 3, 96,
- /* 70 */ 14, 12, 7, 10, 18, 19, 10, 73, 22, 23,
- /* 80 */ 14, 8, 19, 18, 28, 21, 30, 31, 32, 33,
- /* 90 */ 8, 87, 36, 37, 7, 22, 40, 10, 33, 26,
- /* 100 */ 27, 14, 36, 39, 100, 18, 19, 22, 16, 22,
- /* 110 */ 23, 26, 27, 7, 8, 28, 10, 30, 31, 32,
- /* 120 */ 33, 39, 8, 36, 37, 7, 12, 8, 10, 15,
- /* 130 */ 65, 66, 14, 71, 72, 8, 18, 19, 76, 12,
- /* 140 */ 22, 23, 7, 8, 52, 10, 28, 85, 30, 31,
- /* 150 */ 32, 33, 90, 24, 36, 37, 95, 7, 96, 9,
- /* 160 */ 10, 42, 43, 44, 45, 46, 47, 48, 49, 50,
- /* 170 */ 51, 42, 43, 44, 45, 46, 47, 48, 49, 50,
- /* 180 */ 51, 62, 63, 64, 13, 35, 8, 9, 9, 73,
- /* 190 */ 12, 62, 63, 64, 1, 2, 3, 4, 5, 6,
- /* 200 */ 7, 23, 78, 87, 7, 24, 9, 10, 29, 11,
- /* 210 */ 12, 18, 34, 42, 43, 44, 45, 46, 47, 48,
- /* 220 */ 49, 50, 51, 42, 43, 44, 45, 46, 47, 48,
- /* 230 */ 49, 50, 51, 62, 63, 64, 9, 39, 11, 7,
- /* 240 */ 11, 23, 10, 62, 63, 64, 14, 29, 10, 8,
- /* 250 */ 18, 19, 34, 12, 22, 23, 38, 73, 29, 24,
- /* 260 */ 28, 17, 30, 31, 32, 33, 37, 23, 36, 37,
- /* 270 */ 7, 87, 8, 10, 39, 11, 12, 14, 34, 8,
- /* 280 */ 12, 18, 19, 12, 100, 22, 23, 23, 73, 21,
- /* 290 */ 8, 28, 77, 30, 31, 32, 33, 8, 34, 36,
- /* 300 */ 37, 7, 87, 39, 10, 72, 19, 8, 14, 76,
- /* 310 */ 39, 12, 18, 19, 15, 94, 22, 23, 97, 73,
- /* 320 */ 99, 39, 28, 77, 30, 31, 32, 33, 39, 96,
- /* 330 */ 36, 37, 7, 87, 8, 10, 83, 94, 12, 14,
- /* 340 */ 71, 72, 99, 18, 19, 76, 73, 22, 23, 7,
- /* 350 */ 77, 98, 10, 28, 85, 30, 31, 32, 33, 90,
- /* 360 */ 87, 36, 37, 7, 13, 96, 10, 23, 73, 73,
- /* 370 */ 14, 20, 77, 77, 18, 19, 8, 35, 34, 23,
- /* 380 */ 12, 21, 87, 87, 28, 10, 30, 31, 32, 33,
- /* 390 */ 72, 3, 36, 37, 76, 7, 42, 43, 44, 45,
- /* 400 */ 46, 47, 48, 49, 50, 51, 18, 7, 72, 8,
- /* 410 */ 35, 71, 76, 12, 96, 17, 62, 63, 64, 71,
- /* 420 */ 72, 33, 74, 23, 76, 15, 8, 79, 80, 81,
- /* 430 */ 12, 91, 96, 85, 86, 8, 88, 39, 90, 12,
- /* 440 */ 25, 72, 71, 72, 96, 76, 106, 76, 20, 101,
- /* 450 */ 70, 71, 7, 65, 66, 10, 85, 86, 8, 14,
- /* 460 */ 14, 90, 12, 18, 19, 96, 38, 96, 23, 7,
- /* 470 */ 8, 95, 10, 28, 98, 30, 31, 32, 33, 17,
- /* 480 */ 10, 36, 36, 7, 14, 8, 10, 8, 24, 12,
- /* 490 */ 14, 12, 8, 10, 18, 19, 12, 7, 24, 23,
- /* 500 */ 10, 77, 73, 39, 28, 41, 30, 31, 32, 33,
- /* 510 */ 78, 7, 36, 39, 10, 41, 87, 53, 54, 55,
- /* 520 */ 56, 57, 58, 59, 60, 61, 102, 53, 54, 55,
- /* 530 */ 56, 57, 58, 59, 60, 61, 71, 72, 10, 74,
- /* 540 */ 21, 76, 94, 71, 79, 7, 12, 99, 10, 83,
- /* 550 */ 85, 86, 14, 88, 94, 90, 83, 19, 39, 99,
- /* 560 */ 10, 96, 71, 72, 98, 74, 101, 76, 30, 31,
- /* 570 */ 79, 98, 78, 39, 36, 73, 85, 86, 106, 88,
- /* 580 */ 83, 90, 83, 83, 39, 71, 72, 96, 74, 87,
- /* 590 */ 76, 83, 101, 79, 84, 98, 83, 98, 98, 85,
- /* 600 */ 86, 12, 88, 39, 90, 41, 98, 82, 98, 77,
- /* 610 */ 96, 98, 82, 78, 9, 101, 10, 53, 54, 55,
- /* 620 */ 56, 57, 58, 59, 60, 61, 29, 71, 72, 9,
- /* 630 */ 74, 3, 76, 7, 8, 79, 10, 10, 16, 8,
- /* 640 */ 10, 85, 86, 17, 88, 8, 90, 14, 71, 72,
- /* 650 */ 4, 74, 96, 76, 14, 8, 79, 101, 65, 23,
- /* 660 */ 3, 38, 85, 86, 52, 88, 14, 90, 36, 24,
- /* 670 */ 36, 71, 72, 96, 74, 24, 76, 24, 101, 79,
- /* 680 */ 14, 25, 10, 4, 14, 85, 86, 103, 88, 87,
- /* 690 */ 90, 97, 71, 72, 95, 74, 96, 76, 89, 12,
- /* 700 */ 79, 101, 11, 92, 14, 98, 85, 86, 100, 88,
- /* 710 */ 21, 90, 99, 71, 72, 80, 74, 96, 76, 95,
- /* 720 */ 23, 79, 101, 107, 107, 107, 107, 85, 86, 107,
- /* 730 */ 88, 107, 90, 107, 71, 72, 107, 74, 96, 76,
- /* 740 */ 107, 107, 79, 101, 107, 107, 107, 107, 85, 86,
- /* 750 */ 107, 88, 107, 90, 107, 107, 107, 71, 72, 96,
- /* 760 */ 74, 107, 76, 107, 101, 79, 107, 107, 107, 107,
- /* 770 */ 107, 85, 86, 107, 88, 107, 90, 107, 71, 72,
- /* 780 */ 107, 74, 96, 76, 107, 107, 107, 101, 107, 107,
- /* 790 */ 107, 107, 85, 86, 107, 88, 107, 90, 107, 71,
- /* 800 */ 72, 107, 74, 96, 76, 107, 107, 79, 107, 107,
- /* 810 */ 107, 104, 105, 85, 86, 107, 88, 107, 90, 107,
- /* 820 */ 71, 72, 107, 74, 96, 76, 107, 107, 107, 101,
- /* 830 */ 107, 107, 107, 107, 85, 86, 107, 88, 107, 90,
- /* 840 */ 107, 107, 107, 71, 72, 96, 74, 107, 76, 107,
- /* 850 */ 107, 107, 107, 107, 105, 107, 107, 85, 86, 107,
- /* 860 */ 88, 107, 90, 107, 107, 93, 107, 107, 96, 71,
- /* 870 */ 72, 107, 74, 75, 76, 107, 71, 72, 107, 74,
- /* 880 */ 107, 76, 107, 85, 86, 107, 88, 107, 90, 107,
- /* 890 */ 85, 86, 107, 88, 96, 90, 107, 107, 93, 107,
- /* 900 */ 107, 96, 107, 107, 107, 107, 71, 72, 107, 74,
- /* 910 */ 75, 76, 107, 107, 107, 107, 107, 107, 107, 107,
- /* 920 */ 85, 86, 107, 88, 107, 90, 107, 107, 107, 71,
- /* 930 */ 72, 96, 74, 75, 76, 107, 107, 107, 107, 107,
- /* 940 */ 107, 107, 107, 85, 86, 107, 88, 107, 90, 107,
- /* 950 */ 107, 107, 107, 107, 96, 71, 72, 107, 74, 107,
- /* 960 */ 76, 107, 107, 107, 107, 107, 107, 107, 107, 85,
- /* 970 */ 86, 107, 88, 107, 90, 107, 107, 93, 71, 72,
- /* 980 */ 96, 74, 75, 76, 107, 107, 107, 107, 107, 107,
- /* 990 */ 107, 107, 85, 86, 107, 88, 107, 90, 107, 107,
- /* 1000 */ 107, 71, 72, 96, 74, 107, 76, 107, 107, 107,
- /* 1010 */ 107, 107, 107, 107, 107, 85, 86, 107, 88, 107,
- /* 1020 */ 90, 107, 107, 93, 107, 107, 96, 71, 72, 107,
- /* 1030 */ 74, 107, 76, 107, 107, 107, 107, 107, 107, 107,
- /* 1040 */ 107, 85, 86, 107, 88, 107, 90, 107, 107, 107,
- /* 1050 */ 71, 72, 96, 74, 107, 76, 107, 107, 107, 107,
- /* 1060 */ 107, 107, 107, 107, 85, 86, 107, 88, 107, 90,
- /* 1070 */ 107, 107, 107, 71, 72, 96, 74, 107, 76, 107,
- /* 1080 */ 107, 107, 107, 107, 107, 107, 107, 85, 86, 107,
- /* 1090 */ 88, 107, 90, 107, 107, 107, 107, 107, 96, 71,
- /* 1100 */ 72, 107, 74, 107, 76, 107, 107, 107, 107, 107,
- /* 1110 */ 107, 107, 107, 85, 86, 107, 88, 107, 90, 107,
- /* 1120 */ 107, 107, 71, 72, 96, 74, 107, 76, 107, 107,
- /* 1130 */ 107, 107, 107, 107, 107, 107, 85, 86, 107, 88,
- /* 1140 */ 107, 90, 107, 107, 107, 71, 72, 96, 74, 107,
- /* 1150 */ 76, 107, 107, 107, 107, 107, 107, 107, 107, 85,
- /* 1160 */ 86, 107, 88, 107, 90, 107, 107, 107, 107, 107,
- /* 1170 */ 96, 71, 72, 107, 74, 107, 76, 107, 107, 107,
- /* 1180 */ 107, 107, 107, 107, 107, 85, 86, 107, 88, 107,
- /* 1190 */ 90, 107, 107, 107, 71, 72, 96, 74, 107, 76,
- /* 1200 */ 107, 107, 107, 107, 107, 107, 107, 107, 85, 86,
- /* 1210 */ 107, 88, 107, 90, 107, 107, 107, 71, 72, 96,
- /* 1220 */ 74, 107, 76, 107, 107, 107, 107, 107, 107, 107,
- /* 1230 */ 107, 85, 86, 107, 88, 107, 90, 107, 107, 107,
- /* 1240 */ 107, 107, 96, 71, 72, 107, 74, 107, 76, 107,
- /* 1250 */ 107, 107, 107, 107, 107, 107, 107, 85, 86, 107,
- /* 1260 */ 88, 107, 90, 107, 107, 107, 71, 72, 96, 74,
- /* 1270 */ 107, 76, 107, 107, 107, 107, 107, 107, 107, 107,
- /* 1280 */ 85, 86, 107, 88, 107, 90, 107, 107, 107, 71,
- /* 1290 */ 72, 96, 74, 107, 76, 107, 107, 107, 107, 107,
- /* 1300 */ 107, 107, 107, 85, 86, 107, 88, 107, 90, 107,
- /* 1310 */ 107, 107, 107, 107, 96, 71, 72, 107, 74, 107,
- /* 1320 */ 76, 107, 107, 107, 107, 107, 107, 107, 107, 85,
- /* 1330 */ 86, 107, 88, 107, 90, 107, 107, 107, 71, 72,
- /* 1340 */ 96, 74, 107, 76, 107, 107, 107, 107, 107, 107,
- /* 1350 */ 107, 107, 85, 86, 107, 88, 107, 90, 107, 107,
- /* 1360 */ 107, 71, 72, 96, 107, 107, 76, 107, 107, 107,
- /* 1370 */ 107, 107, 107, 107, 107, 85, 86, 107, 88, 107,
- /* 1380 */ 90, 107, 107, 107, 107, 107, 96, 71, 72, 107,
- /* 1390 */ 107, 107, 76, 107, 107, 107, 107, 107, 107, 107,
- /* 1400 */ 107, 85, 86, 107, 88, 107, 90, 107, 107, 107,
- /* 1410 */ 71, 72, 96, 107, 107, 76, 107, 107, 107, 107,
- /* 1420 */ 107, 107, 107, 107, 85, 86, 107, 88, 107, 90,
- /* 1430 */ 107, 107, 107, 107, 107, 96,
-);
- const YY_SHIFT_USE_DFLT = -13;
- const YY_SHIFT_MAX = 209;
- static public $yy_shift_ofst = array(
- /* 0 */ 193, 56, -7, -7, -7, -7, -7, -7, -7, -7,
- /* 10 */ -7, -7, -7, 325, 87, 118, 325, 87, 294, 294,
- /* 20 */ 118, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- /* 30 */ 87, 87, 87, 87, 87, 87, 87, 24, 263, 232,
- /* 40 */ 356, 445, 445, 476, -1, 538, 264, 388, 271, 198,
- /* 50 */ 229, 66, 268, 268, 534, 534, 446, 268, 534, 446,
- /* 60 */ 474, 464, 564, 193, 65, -5, 150, 342, 114, 299,
- /* 70 */ 504, 227, 504, 490, 504, 504, 504, 504, 490, 504,
- /* 80 */ 691, 691, 687, 687, 691, 181, 171, 129, 119, 354,
- /* 90 */ 354, 354, 354, 354, 354, 354, 354, 10, 73, 462,
- /* 100 */ 626, 135, 85, 106, 85, 197, 22, 82, 59, 127,
- /* 110 */ -12, 22, 241, 519, 22, 398, 289, 400, 470, 64,
- /* 120 */ 484, 479, 282, 401, 368, 418, 477, 22, 450, 22,
- /* 130 */ 235, 326, 545, 545, 545, 545, 689, 691, 690, 691,
- /* 140 */ 697, 691, 691, 545, 545, 589, 545, 589, 545, 545,
- /* 150 */ -13, -13, -13, -13, -13, -13, -13, 178, 218, 244,
- /* 160 */ 179, 63, 427, 344, 344, 344, 375, 344, 428, 92,
- /* 170 */ 351, 631, 627, 620, 637, 647, 633, 670, 636, 652,
- /* 180 */ 645, 593, 640, 630, 622, 623, 666, 672, 653, 612,
- /* 190 */ 632, 634, 606, 415, 483, 410, 238, 12, 597, 287,
- /* 200 */ 550, 528, 360, 605, 651, 657, 679, 656, 628, 646,
-);
- const YY_REDUCE_USE_DFLT = -95;
- const YY_REDUCE_MAX = 156;
- static public $yy_reduce_ofst = array(
- /* 0 */ -51, 348, 728, 686, 491, 514, 600, 556, 577, 465,
- /* 10 */ 621, 663, 642, 707, 884, 907, 749, 930, 798, 835,
- /* 20 */ 858, 772, 805, 1100, 1123, 1074, 1051, 979, 1002, 1028,
- /* 30 */ 1146, 1172, 1267, 956, 1244, 1218, 1195, 1316, 1290, 1339,
- /* 40 */ 371, 269, 62, -32, -27, 233, 295, 340, 215, 296,
- /* 50 */ 221, 318, -59, 184, 215, 246, 336, 4, 273, 369,
- /* 60 */ 424, 424, 424, 380, 472, 510, 376, 376, 116, 116,
- /* 70 */ 473, 243, 253, 466, 497, 508, 500, 466, 499, 513,
- /* 80 */ 448, 243, 429, 502, 460, 584, 584, 584, 584, 584,
- /* 90 */ 584, 584, 584, 584, 584, 584, 584, 609, 609, 607,
- /* 100 */ 607, 607, 609, 607, 609, 607, 594, 532, 602, 602,
- /* 110 */ 532, 594, 602, 532, 594, 532, 532, 599, 611, 532,
- /* 120 */ 602, 602, 532, 602, 602, 602, 602, 594, 602, 594,
- /* 130 */ 532, 602, 532, 532, 532, 532, 608, 613, 635, 613,
- /* 140 */ 624, 613, 613, 532, 532, 525, 532, 530, 532, 532,
- /* 150 */ 535, 494, 432, 124, 61, -45, -94,
-);
- static public $yyExpectedTokens = array(
- /* 0 */ array(1, 2, 3, 4, 5, 6, 7, 18, ),
- /* 1 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, 40, ),
- /* 2 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, 40, ),
- /* 3 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, 40, ),
- /* 4 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, 40, ),
- /* 5 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, 40, ),
- /* 6 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, 40, ),
- /* 7 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, 40, ),
- /* 8 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, 40, ),
- /* 9 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, 40, ),
- /* 10 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, 40, ),
- /* 11 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, 40, ),
- /* 12 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, 40, ),
- /* 13 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 14 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 15 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 16 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 17 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 18 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 19 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 20 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 21 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 22 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 23 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 24 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 25 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 26 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 27 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 28 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 29 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 30 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 31 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 32 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 33 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 34 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 35 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 36 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 37 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, 38, ),
- /* 38 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 39 */ array(7, 10, 14, 18, 19, 22, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 40 */ array(7, 10, 14, 18, 19, 23, 28, 30, 31, 32, 33, 36, 37, ),
- /* 41 */ array(7, 10, 14, 18, 19, 23, 28, 30, 31, 32, 33, 36, ),
- /* 42 */ array(7, 10, 14, 18, 19, 23, 28, 30, 31, 32, 33, 36, ),
- /* 43 */ array(7, 10, 14, 18, 19, 23, 28, 30, 31, 32, 33, 36, ),
- /* 44 */ array(7, 10, 14, 36, ),
- /* 45 */ array(7, 10, 14, 19, 30, 31, 36, ),
- /* 46 */ array(8, 11, 12, 23, 34, 39, ),
- /* 47 */ array(3, 7, 18, 33, 65, 66, ),
- /* 48 */ array(8, 12, 39, ),
- /* 49 */ array(11, 12, 39, ),
- /* 50 */ array(11, 29, 37, ),
- /* 51 */ array(10, 14, 36, ),
- /* 52 */ array(12, 21, ),
- /* 53 */ array(12, 21, ),
- /* 54 */ array(12, 39, ),
- /* 55 */ array(12, 39, ),
- /* 56 */ array(14, 36, ),
- /* 57 */ array(12, 21, ),
- /* 58 */ array(12, 39, ),
- /* 59 */ array(14, 36, ),
- /* 60 */ array(24, 39, 41, 53, 54, 55, 56, 57, 58, 59, 60, 61, ),
- /* 61 */ array(24, 39, 41, 53, 54, 55, 56, 57, 58, 59, 60, 61, ),
- /* 62 */ array(39, 41, 53, 54, 55, 56, 57, 58, 59, 60, 61, ),
- /* 63 */ array(1, 2, 3, 4, 5, 6, 7, 18, ),
- /* 64 */ array(3, 7, 18, 33, 65, 66, ),
- /* 65 */ array(7, 9, 10, 15, ),
- /* 66 */ array(7, 9, 10, 35, ),
- /* 67 */ array(7, 10, 35, ),
- /* 68 */ array(8, 12, 15, ),
- /* 69 */ array(8, 12, 15, ),
- /* 70 */ array(7, 10, ),
- /* 71 */ array(9, 11, ),
- /* 72 */ array(7, 10, ),
- /* 73 */ array(7, 10, ),
- /* 74 */ array(7, 10, ),
- /* 75 */ array(7, 10, ),
- /* 76 */ array(7, 10, ),
- /* 77 */ array(7, 10, ),
- /* 78 */ array(7, 10, ),
- /* 79 */ array(7, 10, ),
- /* 80 */ array(11, ),
- /* 81 */ array(11, ),
- /* 82 */ array(12, ),
- /* 83 */ array(12, ),
- /* 84 */ array(11, ),
- /* 85 */ array(24, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 62, 63, 64, ),
- /* 86 */ array(13, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 62, 63, 64, ),
- /* 87 */ array(24, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 62, 63, 64, ),
- /* 88 */ array(8, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 62, 63, 64, ),
- /* 89 */ array(42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 62, 63, 64, ),
- /* 90 */ array(42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 62, 63, 64, ),
- /* 91 */ array(42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 62, 63, 64, ),
- /* 92 */ array(42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 62, 63, 64, ),
- /* 93 */ array(42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 62, 63, 64, ),
- /* 94 */ array(42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 62, 63, 64, ),
- /* 95 */ array(42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 62, 63, 64, ),
- /* 96 */ array(42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 62, 63, 64, ),
- /* 97 */ array(22, 26, 27, 38, ),
- /* 98 */ array(8, 22, 26, 27, ),
- /* 99 */ array(7, 8, 10, 17, ),
- /* 100 */ array(7, 8, 10, 17, ),
- /* 101 */ array(7, 8, 10, ),
- /* 102 */ array(22, 26, 27, ),
- /* 103 */ array(7, 8, 10, ),
- /* 104 */ array(22, 26, 27, ),
- /* 105 */ array(7, 9, 10, ),
- /* 106 */ array(29, 37, ),
- /* 107 */ array(8, 39, ),
- /* 108 */ array(8, 12, ),
- /* 109 */ array(8, 12, ),
- /* 110 */ array(20, 39, ),
- /* 111 */ array(29, 37, ),
- /* 112 */ array(8, 12, ),
- /* 113 */ array(21, 39, ),
- /* 114 */ array(29, 37, ),
- /* 115 */ array(17, 39, ),
- /* 116 */ array(8, 39, ),
- /* 117 */ array(7, 23, ),
- /* 118 */ array(10, 14, ),
- /* 119 */ array(21, 39, ),
- /* 120 */ array(8, 12, ),
- /* 121 */ array(8, 12, ),
- /* 122 */ array(8, 39, ),
- /* 123 */ array(8, 12, ),
- /* 124 */ array(8, 12, ),
- /* 125 */ array(8, 12, ),
- /* 126 */ array(8, 12, ),
- /* 127 */ array(29, 37, ),
- /* 128 */ array(8, 12, ),
- /* 129 */ array(29, 37, ),
- /* 130 */ array(24, 39, ),
- /* 131 */ array(8, 12, ),
- /* 132 */ array(39, ),
- /* 133 */ array(39, ),
- /* 134 */ array(39, ),
- /* 135 */ array(39, ),
- /* 136 */ array(21, ),
- /* 137 */ array(11, ),
- /* 138 */ array(14, ),
- /* 139 */ array(11, ),
- /* 140 */ array(23, ),
- /* 141 */ array(11, ),
- /* 142 */ array(11, ),
- /* 143 */ array(39, ),
- /* 144 */ array(39, ),
- /* 145 */ array(12, ),
- /* 146 */ array(39, ),
- /* 147 */ array(12, ),
- /* 148 */ array(39, ),
- /* 149 */ array(39, ),
- /* 150 */ array(),
- /* 151 */ array(),
- /* 152 */ array(),
- /* 153 */ array(),
- /* 154 */ array(),
- /* 155 */ array(),
- /* 156 */ array(),
- /* 157 */ array(8, 9, 12, 23, 34, ),
- /* 158 */ array(23, 29, 34, 38, ),
- /* 159 */ array(17, 23, 34, ),
- /* 160 */ array(9, 29, ),
- /* 161 */ array(10, 19, ),
- /* 162 */ array(8, 12, ),
- /* 163 */ array(23, 34, ),
- /* 164 */ array(23, 34, ),
- /* 165 */ array(23, 34, ),
- /* 166 */ array(10, 35, ),
- /* 167 */ array(23, 34, ),
- /* 168 */ array(20, 38, ),
- /* 169 */ array(16, 52, ),
- /* 170 */ array(13, 20, ),
- /* 171 */ array(8, ),
- /* 172 */ array(10, ),
- /* 173 */ array(9, ),
- /* 174 */ array(8, ),
- /* 175 */ array(8, ),
- /* 176 */ array(14, ),
- /* 177 */ array(14, ),
- /* 178 */ array(23, ),
- /* 179 */ array(14, ),
- /* 180 */ array(24, ),
- /* 181 */ array(65, ),
- /* 182 */ array(14, ),
- /* 183 */ array(10, ),
- /* 184 */ array(16, ),
- /* 185 */ array(38, ),
- /* 186 */ array(14, ),
- /* 187 */ array(10, ),
- /* 188 */ array(24, ),
- /* 189 */ array(52, ),
- /* 190 */ array(36, ),
- /* 191 */ array(36, ),
- /* 192 */ array(10, ),
- /* 193 */ array(25, ),
- /* 194 */ array(10, ),
- /* 195 */ array(15, ),
- /* 196 */ array(10, ),
- /* 197 */ array(10, ),
- /* 198 */ array(29, ),
- /* 199 */ array(19, ),
- /* 200 */ array(10, ),
- /* 201 */ array(10, ),
- /* 202 */ array(21, ),
- /* 203 */ array(9, ),
- /* 204 */ array(24, ),
- /* 205 */ array(3, ),
- /* 206 */ array(4, ),
- /* 207 */ array(25, ),
- /* 208 */ array(3, ),
- /* 209 */ array(4, ),
- /* 210 */ array(),
- /* 211 */ array(),
- /* 212 */ array(),
- /* 213 */ array(),
- /* 214 */ array(),
- /* 215 */ array(),
- /* 216 */ array(),
- /* 217 */ array(),
- /* 218 */ array(),
- /* 219 */ array(),
- /* 220 */ array(),
- /* 221 */ array(),
- /* 222 */ array(),
- /* 223 */ array(),
- /* 224 */ array(),
- /* 225 */ array(),
- /* 226 */ array(),
- /* 227 */ array(),
- /* 228 */ array(),
- /* 229 */ array(),
- /* 230 */ array(),
- /* 231 */ array(),
- /* 232 */ array(),
- /* 233 */ array(),
- /* 234 */ array(),
- /* 235 */ array(),
- /* 236 */ array(),
- /* 237 */ array(),
- /* 238 */ array(),
- /* 239 */ array(),
- /* 240 */ array(),
- /* 241 */ array(),
- /* 242 */ array(),
- /* 243 */ array(),
- /* 244 */ array(),
- /* 245 */ array(),
- /* 246 */ array(),
- /* 247 */ array(),
- /* 248 */ array(),
- /* 249 */ array(),
- /* 250 */ array(),
- /* 251 */ array(),
- /* 252 */ array(),
- /* 253 */ array(),
- /* 254 */ array(),
- /* 255 */ array(),
- /* 256 */ array(),
- /* 257 */ array(),
- /* 258 */ array(),
- /* 259 */ array(),
- /* 260 */ array(),
- /* 261 */ array(),
- /* 262 */ array(),
- /* 263 */ array(),
- /* 264 */ array(),
- /* 265 */ array(),
- /* 266 */ array(),
- /* 267 */ array(),
- /* 268 */ array(),
- /* 269 */ array(),
- /* 270 */ array(),
- /* 271 */ array(),
- /* 272 */ array(),
- /* 273 */ array(),
- /* 274 */ array(),
- /* 275 */ array(),
- /* 276 */ array(),
- /* 277 */ array(),
- /* 278 */ array(),
- /* 279 */ array(),
- /* 280 */ array(),
- /* 281 */ array(),
- /* 282 */ array(),
- /* 283 */ array(),
- /* 284 */ array(),
- /* 285 */ array(),
- /* 286 */ array(),
- /* 287 */ array(),
- /* 288 */ array(),
- /* 289 */ array(),
- /* 290 */ array(),
- /* 291 */ array(),
- /* 292 */ array(),
- /* 293 */ array(),
- /* 294 */ array(),
- /* 295 */ array(),
- /* 296 */ array(),
- /* 297 */ array(),
- /* 298 */ array(),
- /* 299 */ array(),
- /* 300 */ array(),
- /* 301 */ array(),
- /* 302 */ array(),
- /* 303 */ array(),
- /* 304 */ array(),
- /* 305 */ array(),
- /* 306 */ array(),
- /* 307 */ array(),
- /* 308 */ array(),
- /* 309 */ array(),
- /* 310 */ array(),
- /* 311 */ array(),
- /* 312 */ array(),
- /* 313 */ array(),
- /* 314 */ array(),
- /* 315 */ array(),
- /* 316 */ array(),
- /* 317 */ array(),
- /* 318 */ array(),
- /* 319 */ array(),
- /* 320 */ array(),
- /* 321 */ array(),
- /* 322 */ array(),
- /* 323 */ array(),
-);
- static public $yy_default = array(
- /* 0 */ 491, 491, 491, 491, 491, 491, 491, 491, 491, 491,
- /* 10 */ 491, 491, 491, 477, 435, 491, 491, 435, 491, 491,
- /* 20 */ 491, 435, 435, 491, 491, 491, 491, 491, 491, 491,
- /* 30 */ 491, 491, 491, 491, 491, 491, 491, 491, 491, 491,
- /* 40 */ 491, 491, 491, 491, 491, 491, 491, 491, 491, 358,
- /* 50 */ 397, 491, 358, 358, 358, 358, 491, 358, 358, 491,
- /* 60 */ 445, 445, 445, 324, 491, 491, 407, 407, 380, 380,
- /* 70 */ 491, 400, 491, 491, 491, 491, 491, 491, 491, 491,
- /* 80 */ 393, 400, 358, 358, 392, 491, 491, 491, 491, 455,
- /* 90 */ 449, 451, 459, 450, 458, 454, 443, 491, 491, 491,
- /* 100 */ 491, 491, 368, 491, 440, 491, 429, 491, 491, 491,
- /* 110 */ 434, 427, 491, 491, 428, 480, 491, 407, 491, 491,
- /* 120 */ 491, 491, 491, 491, 491, 491, 491, 426, 491, 405,
- /* 130 */ 491, 491, 479, 375, 446, 478, 370, 394, 491, 423,
- /* 140 */ 407, 395, 398, 347, 366, 490, 376, 490, 363, 359,
- /* 150 */ 439, 439, 439, 439, 407, 407, 407, 367, 491, 367,
- /* 160 */ 383, 491, 371, 441, 367, 491, 491, 460, 491, 371,
- /* 170 */ 491, 491, 491, 491, 364, 491, 491, 491, 396, 491,
- /* 180 */ 491, 491, 491, 491, 374, 491, 491, 491, 491, 371,
- /* 190 */ 491, 491, 491, 388, 491, 380, 491, 491, 383, 491,
- /* 200 */ 491, 411, 421, 362, 491, 491, 491, 491, 491, 491,
- /* 210 */ 483, 408, 484, 355, 488, 403, 404, 482, 391, 487,
- /* 220 */ 481, 373, 327, 326, 325, 352, 413, 412, 390, 328,
- /* 230 */ 410, 361, 409, 406, 357, 354, 438, 414, 371, 353,
- /* 240 */ 430, 333, 332, 334, 356, 330, 432, 372, 329, 415,
- /* 250 */ 417, 401, 331, 425, 381, 382, 418, 416, 384, 402,
- /* 260 */ 424, 463, 343, 464, 465, 466, 341, 462, 448, 344,
- /* 270 */ 474, 476, 475, 447, 342, 467, 468, 388, 471, 442,
- /* 280 */ 452, 457, 453, 472, 473, 339, 340, 469, 470, 444,
- /* 290 */ 461, 345, 431, 369, 349, 419, 422, 437, 436, 379,
- /* 300 */ 378, 351, 386, 387, 456, 350, 377, 374, 365, 336,
- /* 310 */ 486, 337, 338, 433, 399, 346, 335, 489, 389, 421,
- /* 320 */ 420, 485, 348, 385,
-);
-/* The next thing included is series of defines which control
-** various aspects of the generated parser.
-** self::YYNOCODE is a number which corresponds
-** to no legal terminal or nonterminal number. This
-** number is used to fill in empty slots of the hash
-** table.
-** self::YYFALLBACK If defined, this indicates that one or more tokens
-** have fall-back values which should be used if the
-** original value of the token will not parse.
-** self::YYSTACKDEPTH is the maximum depth of the parser's stack.
-** self::YYNSTATE the combined number of states.
-** self::YYNRULE the number of rules in the grammar
-** self::YYERRORSYMBOL is the code number of the error symbol. If not
-** defined, then do no error processing.
-*/
- const YYNOCODE = 108;
- const YYSTACKDEPTH = 100;
- const YYNSTATE = 324;
- const YYNRULE = 167;
- const YYERRORSYMBOL = 67;
- const YYERRSYMDT = 'yy0';
- const YYFALLBACK = 0;
- /** The next table maps tokens into fallback tokens. If a construct
- * like the following:
- *
- * %fallback ID X Y Z.
- *
- * appears in the grammer, then ID becomes a fallback token for X, Y,
- * and Z. Whenever one of the tokens X, Y, or Z is input to the parser
- * but it does not parse, the type of the token is changed to ID and
- * the parse is retried before an error is thrown.
- */
- static public $yyFallback = array(
- );
- /**
- * Turn parser tracing on by giving a stream to which to write the trace
- * and a prompt to preface each trace message. Tracing is turned off
- * by making either argument NULL
- *
- * Inputs:
- *
- * - A stream resource to which trace output should be written.
- * If NULL, then tracing is turned off.
- * - A prefix string written at the beginning of every
- * line of trace output. If NULL, then tracing is
- * turned off.
- *
- * Outputs:
- *
- * - None.
- * @param resource
- * @param string
- */
- static function Trace($TraceFILE, $zTracePrompt)
- {
- if (!$TraceFILE) {
- $zTracePrompt = 0;
- } elseif (!$zTracePrompt) {
- $TraceFILE = 0;
- }
- self::$yyTraceFILE = $TraceFILE;
- self::$yyTracePrompt = $zTracePrompt;
- }
-
- /**
- * Output debug information to output (php://output stream)
- */
- static function PrintTrace()
- {
- self::$yyTraceFILE = fopen('php://output', 'w');
- self::$yyTracePrompt = '<br>';
- }
-
- /**
- * @var resource|0
- */
- static public $yyTraceFILE;
- /**
- * String to prepend to debug output
- * @var string|0
- */
- static public $yyTracePrompt;
- /**
- * @var int
- */
- public $yyidx; /* Index of top element in stack */
- /**
- * @var int
- */
- public $yyerrcnt; /* Shifts left before out of the error */
- /**
- * @var array
- */
- public $yystack = array(); /* The parser's stack */
-
- /**
- * For tracing shifts, the names of all terminals and nonterminals
- * are required. The following table supplies these names
- * @var array
- */
- public $yyTokenName = array(
- '$', 'COMMENT', 'PHP', 'OTHER',
- 'SHORTTAGEND', 'SHORTTAGSTART', 'XML', 'LDEL',
- 'RDEL', 'EQUAL', 'ID', 'PTR',
- 'SPACE', 'SEMICOLON', 'DOLLAR', 'INCDEC',
- 'AS', 'APTR', 'LDELSLASH', 'INTEGER',
- 'COMMA', 'COLON', 'UNIMATH', 'OPENP',
- 'CLOSEP', 'QMARK', 'MATH', 'ANDSYM',
- 'TYPECAST', 'DOT', 'BOOLEAN', 'NULL',
- 'SINGLEQUOTESTRING', 'QUOTE', 'DOUBLECOLON', 'AT',
- 'HATCH', 'OPENB', 'CLOSEB', 'VERT',
- 'NOT', 'ISIN', 'ISDIVBY', 'ISNOTDIVBY',
- 'ISEVEN', 'ISNOTEVEN', 'ISEVENBY', 'ISNOTEVENBY',
- 'ISODD', 'ISNOTODD', 'ISODDBY', 'ISNOTODDBY',
- 'INSTANCEOF', 'EQUALS', 'NOTEQUALS', 'GREATERTHAN',
- 'LESSTHAN', 'GREATEREQUAL', 'LESSEQUAL', 'IDENTITY',
- 'NONEIDENTITY', 'MOD', 'LAND', 'LOR',
- 'LXOR', 'BACKTICK', 'DOLLARID', 'error',
- 'start', 'template', 'template_element', 'smartytag',
- 'variable', 'attributes', 'expr', 'ternary',
- 'varindexed', 'modifier', 'modparameters', 'ifexprs',
- 'statement', 'statements', 'optspace', 'varvar',
- 'foraction', 'value', 'array', 'attribute',
- 'exprs', 'math', 'function', 'doublequoted',
- 'method', 'params', 'objectchain', 'arrayindex',
- 'object', 'indexdef', 'varvarele', 'objectelement',
- 'modparameter', 'ifexpr', 'ifcond', 'lop',
- 'arrayelements', 'arrayelement', 'doublequotedcontent',
- );
-
- /**
- * For tracing reduce actions, the names of all rules are required.
- * @var array
- */
- static public $yyRuleName = array(
- /* 0 */ "start ::= template",
- /* 1 */ "template ::= template_element",
- /* 2 */ "template ::= template template_element",
- /* 3 */ "template_element ::= smartytag",
- /* 4 */ "template_element ::= COMMENT",
- /* 5 */ "template_element ::= PHP OTHER SHORTTAGEND",
- /* 6 */ "template_element ::= SHORTTAGSTART OTHER SHORTTAGEND",
- /* 7 */ "template_element ::= XML",
- /* 8 */ "template_element ::= SHORTTAGEND",
- /* 9 */ "template_element ::= OTHER",
- /* 10 */ "smartytag ::= LDEL variable attributes RDEL",
- /* 11 */ "smartytag ::= LDEL expr attributes RDEL",
- /* 12 */ "smartytag ::= LDEL ternary attributes RDEL",
- /* 13 */ "smartytag ::= LDEL varindexed EQUAL expr attributes RDEL",
- /* 14 */ "smartytag ::= LDEL varindexed EQUAL ternary attributes RDEL",
- /* 15 */ "smartytag ::= LDEL ID attributes RDEL",
- /* 16 */ "smartytag ::= LDEL ID RDEL",
- /* 17 */ "smartytag ::= LDEL ID PTR ID attributes RDEL",
- /* 18 */ "smartytag ::= LDEL ID modifier modparameters attributes RDEL",
- /* 19 */ "smartytag ::= LDEL ID PTR ID modifier modparameters attributes RDEL",
- /* 20 */ "smartytag ::= LDEL ID SPACE ifexprs RDEL",
- /* 21 */ "smartytag ::= LDEL ID SPACE statement RDEL",
- /* 22 */ "smartytag ::= LDEL ID SPACE statements SEMICOLON optspace ifexprs SEMICOLON optspace DOLLAR varvar foraction RDEL",
- /* 23 */ "foraction ::= EQUAL expr",
- /* 24 */ "foraction ::= INCDEC",
- /* 25 */ "smartytag ::= LDEL ID SPACE value AS DOLLAR varvar RDEL",
- /* 26 */ "smartytag ::= LDEL ID SPACE value AS DOLLAR varvar APTR DOLLAR varvar RDEL",
- /* 27 */ "smartytag ::= LDEL ID SPACE array AS DOLLAR varvar RDEL",
- /* 28 */ "smartytag ::= LDEL ID SPACE array AS DOLLAR varvar APTR DOLLAR varvar RDEL",
- /* 29 */ "smartytag ::= LDELSLASH ID attributes RDEL",
- /* 30 */ "smartytag ::= LDELSLASH ID modifier modparameters attributes RDEL",
- /* 31 */ "smartytag ::= LDELSLASH ID PTR ID RDEL",
- /* 32 */ "attributes ::= attributes attribute",
- /* 33 */ "attributes ::= attribute",
- /* 34 */ "attributes ::=",
- /* 35 */ "attribute ::= SPACE ID EQUAL expr",
- /* 36 */ "attribute ::= SPACE ID EQUAL value",
- /* 37 */ "attribute ::= SPACE ID EQUAL ternary",
- /* 38 */ "attribute ::= SPACE ID",
- /* 39 */ "attribute ::= SPACE INTEGER EQUAL expr",
- /* 40 */ "statements ::= statement",
- /* 41 */ "statements ::= statements COMMA statement",
- /* 42 */ "statement ::= DOLLAR varvar EQUAL expr",
- /* 43 */ "expr ::= ID",
- /* 44 */ "expr ::= exprs",
- /* 45 */ "expr ::= DOLLAR ID COLON ID",
- /* 46 */ "expr ::= expr modifier modparameters",
- /* 47 */ "exprs ::= value",
- /* 48 */ "exprs ::= UNIMATH value",
- /* 49 */ "exprs ::= exprs math value",
- /* 50 */ "exprs ::= array",
- /* 51 */ "ternary ::= OPENP ifexprs CLOSEP QMARK expr COLON expr",
- /* 52 */ "ternary ::= OPENP expr CLOSEP QMARK expr COLON expr",
- /* 53 */ "math ::= UNIMATH",
- /* 54 */ "math ::= MATH",
- /* 55 */ "math ::= ANDSYM",
- /* 56 */ "value ::= variable",
- /* 57 */ "value ::= TYPECAST variable",
- /* 58 */ "value ::= variable INCDEC",
- /* 59 */ "value ::= INTEGER",
- /* 60 */ "value ::= INTEGER DOT INTEGER",
- /* 61 */ "value ::= BOOLEAN",
- /* 62 */ "value ::= NULL",
- /* 63 */ "value ::= function",
- /* 64 */ "value ::= OPENP expr CLOSEP",
- /* 65 */ "value ::= SINGLEQUOTESTRING",
- /* 66 */ "value ::= QUOTE doublequoted QUOTE",
- /* 67 */ "value ::= QUOTE QUOTE",
- /* 68 */ "value ::= ID DOUBLECOLON method",
- /* 69 */ "value ::= ID DOUBLECOLON DOLLAR ID OPENP params CLOSEP",
- /* 70 */ "value ::= ID DOUBLECOLON method objectchain",
- /* 71 */ "value ::= ID DOUBLECOLON DOLLAR ID OPENP params CLOSEP objectchain",
- /* 72 */ "value ::= ID DOUBLECOLON ID",
- /* 73 */ "value ::= ID DOUBLECOLON DOLLAR ID arrayindex",
- /* 74 */ "value ::= ID DOUBLECOLON DOLLAR ID arrayindex objectchain",
- /* 75 */ "value ::= smartytag",
- /* 76 */ "variable ::= varindexed",
- /* 77 */ "variable ::= DOLLAR varvar AT ID",
- /* 78 */ "variable ::= object",
- /* 79 */ "variable ::= HATCH ID HATCH",
- /* 80 */ "variable ::= HATCH variable HATCH",
- /* 81 */ "varindexed ::= DOLLAR varvar arrayindex",
- /* 82 */ "arrayindex ::= arrayindex indexdef",
- /* 83 */ "arrayindex ::=",
- /* 84 */ "indexdef ::= DOT ID",
- /* 85 */ "indexdef ::= DOT BOOLEAN",
- /* 86 */ "indexdef ::= DOT NULL",
- /* 87 */ "indexdef ::= DOT INTEGER",
- /* 88 */ "indexdef ::= DOT INTEGER ID",
- /* 89 */ "indexdef ::= DOT variable",
- /* 90 */ "indexdef ::= DOT LDEL exprs RDEL",
- /* 91 */ "indexdef ::= OPENB ID CLOSEB",
- /* 92 */ "indexdef ::= OPENB ID DOT ID CLOSEB",
- /* 93 */ "indexdef ::= OPENB exprs CLOSEB",
- /* 94 */ "indexdef ::= OPENB CLOSEB",
- /* 95 */ "varvar ::= varvarele",
- /* 96 */ "varvar ::= varvar varvarele",
- /* 97 */ "varvarele ::= ID",
- /* 98 */ "varvarele ::= LDEL expr RDEL",
- /* 99 */ "object ::= varindexed objectchain",
- /* 100 */ "objectchain ::= objectelement",
- /* 101 */ "objectchain ::= objectchain objectelement",
- /* 102 */ "objectelement ::= PTR ID arrayindex",
- /* 103 */ "objectelement ::= PTR variable arrayindex",
- /* 104 */ "objectelement ::= PTR LDEL expr RDEL arrayindex",
- /* 105 */ "objectelement ::= PTR ID LDEL expr RDEL arrayindex",
- /* 106 */ "objectelement ::= PTR method",
- /* 107 */ "function ::= ID OPENP params CLOSEP",
- /* 108 */ "method ::= ID OPENP params CLOSEP",
- /* 109 */ "params ::= expr COMMA params",
- /* 110 */ "params ::= expr",
- /* 111 */ "params ::=",
- /* 112 */ "modifier ::= VERT AT ID",
- /* 113 */ "modifier ::= VERT ID",
- /* 114 */ "modparameters ::= modparameters modparameter",
- /* 115 */ "modparameters ::=",
- /* 116 */ "modparameter ::= COLON exprs",
- /* 117 */ "modparameter ::= COLON ID",
- /* 118 */ "ifexprs ::= ifexpr",
- /* 119 */ "ifexprs ::= NOT ifexprs",
- /* 120 */ "ifexprs ::= OPENP ifexprs CLOSEP",
- /* 121 */ "ifexpr ::= expr",
- /* 122 */ "ifexpr ::= expr ifcond expr",
- /* 123 */ "ifexpr ::= expr ISIN array",
- /* 124 */ "ifexpr ::= expr ISIN value",
- /* 125 */ "ifexpr ::= ifexprs lop ifexprs",
- /* 126 */ "ifexpr ::= ifexprs ISDIVBY ifexprs",
- /* 127 */ "ifexpr ::= ifexprs ISNOTDIVBY ifexprs",
- /* 128 */ "ifexpr ::= ifexprs ISEVEN",
- /* 129 */ "ifexpr ::= ifexprs ISNOTEVEN",
- /* 130 */ "ifexpr ::= ifexprs ISEVENBY ifexprs",
- /* 131 */ "ifexpr ::= ifexprs ISNOTEVENBY ifexprs",
- /* 132 */ "ifexpr ::= ifexprs ISODD",
- /* 133 */ "ifexpr ::= ifexprs ISNOTODD",
- /* 134 */ "ifexpr ::= ifexprs ISODDBY ifexprs",
- /* 135 */ "ifexpr ::= ifexprs ISNOTODDBY ifexprs",
- /* 136 */ "ifexpr ::= value INSTANCEOF ID",
- /* 137 */ "ifexpr ::= value INSTANCEOF value",
- /* 138 */ "ifcond ::= EQUALS",
- /* 139 */ "ifcond ::= NOTEQUALS",
- /* 140 */ "ifcond ::= GREATERTHAN",
- /* 141 */ "ifcond ::= LESSTHAN",
- /* 142 */ "ifcond ::= GREATEREQUAL",
- /* 143 */ "ifcond ::= LESSEQUAL",
- /* 144 */ "ifcond ::= IDENTITY",
- /* 145 */ "ifcond ::= NONEIDENTITY",
- /* 146 */ "ifcond ::= MOD",
- /* 147 */ "lop ::= LAND",
- /* 148 */ "lop ::= LOR",
- /* 149 */ "lop ::= LXOR",
- /* 150 */ "array ::= OPENB arrayelements CLOSEB",
- /* 151 */ "arrayelements ::= arrayelement",
- /* 152 */ "arrayelements ::= arrayelements COMMA arrayelement",
- /* 153 */ "arrayelements ::=",
- /* 154 */ "arrayelement ::= expr APTR expr",
- /* 155 */ "arrayelement ::= ID APTR expr",
- /* 156 */ "arrayelement ::= expr",
- /* 157 */ "doublequoted ::= doublequoted doublequotedcontent",
- /* 158 */ "doublequoted ::= doublequotedcontent",
- /* 159 */ "doublequotedcontent ::= BACKTICK variable BACKTICK",
- /* 160 */ "doublequotedcontent ::= DOLLARID",
- /* 161 */ "doublequotedcontent ::= LDEL variable RDEL",
- /* 162 */ "doublequotedcontent ::= LDEL expr RDEL",
- /* 163 */ "doublequotedcontent ::= smartytag",
- /* 164 */ "doublequotedcontent ::= OTHER",
- /* 165 */ "optspace ::= SPACE",
- /* 166 */ "optspace ::=",
- );
-
- /**
- * This function returns the symbolic name associated with a token
- * value.
- * @param int
- * @return string
- */
- function tokenName($tokenType)
- {
- if ($tokenType === 0) {
- return 'End of Input';
- }
- if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) {
- return $this->yyTokenName[$tokenType];
- } else {
- return "Unknown";
- }
- }
-
- /**
- * The following function deletes the value associated with a
- * symbol. The symbol can be either a terminal or nonterminal.
- * @param int the symbol code
- * @param mixed the symbol's value
- */
- static function yy_destructor($yymajor, $yypminor)
- {
- switch ($yymajor) {
- /* Here is inserted the actions which take place when a
- ** terminal or non-terminal is destroyed. This can happen
- ** when the symbol is popped from the stack during a
- ** reduce or during error processing or when a parser is
- ** being destroyed before it is finished parsing.
- **
- ** Note: during a reduce, the only symbols destroyed are those
- ** which appear on the RHS of the rule, but which are not used
- ** inside the C code.
- */
- default: break; /* If no destructor action specified: do nothing */
- }
- }
-
- /**
- * Pop the parser's stack once.
- *
- * If there is a destructor routine associated with the token which
- * is popped from the stack, then call it.
- *
- * Return the major token number for the symbol popped.
- * @param TP_yyParser
- * @return int
- */
- function yy_pop_parser_stack()
- {
- if (!count($this->yystack)) {
- return;
- }
- $yytos = array_pop($this->yystack);
- if (self::$yyTraceFILE && $this->yyidx >= 0) {
- fwrite(self::$yyTraceFILE,
- self::$yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] .
- "\n");
- }
- $yymajor = $yytos->major;
- self::yy_destructor($yymajor, $yytos->minor);
- $this->yyidx--;
- return $yymajor;
- }
-
- /**
- * Deallocate and destroy a parser. Destructors are all called for
- * all stack elements before shutting the parser down.
- */
- function __destruct()
- {
- while ($this->yyidx >= 0) {
- $this->yy_pop_parser_stack();
- }
- if (is_resource(self::$yyTraceFILE)) {
- fclose(self::$yyTraceFILE);
- }
- }
-
- /**
- * Based on the current state and parser stack, get a list of all
- * possible lookahead tokens
- * @param int
- * @return array
- */
- function yy_get_expected_tokens($token)
- {
- $state = $this->yystack[$this->yyidx]->stateno;
- $expected = self::$yyExpectedTokens[$state];
- if (in_array($token, self::$yyExpectedTokens[$state], true)) {
- return $expected;
- }
- $stack = $this->yystack;
- $yyidx = $this->yyidx;
- do {
- $yyact = $this->yy_find_shift_action($token);
- if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
- // reduce action
- $done = 0;
- do {
- if ($done++ == 100) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- // too much recursion prevents proper detection
- // so give up
- return array_unique($expected);
- }
- $yyruleno = $yyact - self::YYNSTATE;
- $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];
- $nextstate = $this->yy_find_reduce_action(
- $this->yystack[$this->yyidx]->stateno,
- self::$yyRuleInfo[$yyruleno]['lhs']);
- if (isset(self::$yyExpectedTokens[$nextstate])) {
- $expected += self::$yyExpectedTokens[$nextstate];
- if (in_array($token,
- self::$yyExpectedTokens[$nextstate], true)) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- return array_unique($expected);
- }
- }
- if ($nextstate < self::YYNSTATE) {
- // we need to shift a non-terminal
- $this->yyidx++;
- $x = new TP_yyStackEntry;
- $x->stateno = $nextstate;
- $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];
- $this->yystack[$this->yyidx] = $x;
- continue 2;
- } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- // the last token was just ignored, we can't accept
- // by ignoring input, this is in essence ignoring a
- // syntax error!
- return array_unique($expected);
- } elseif ($nextstate === self::YY_NO_ACTION) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- // input accepted, but not shifted (I guess)
- return $expected;
- } else {
- $yyact = $nextstate;
- }
- } while (true);
- }
- break;
- } while (true);
- return array_unique($expected);
- }
-
- /**
- * Based on the parser state and current parser stack, determine whether
- * the lookahead token is possible.
- *
- * The parser will convert the token value to an error token if not. This
- * catches some unusual edge cases where the parser would fail.
- * @param int
- * @return bool
- */
- function yy_is_expected_token($token)
- {
- if ($token === 0) {
- return true; // 0 is not part of this
- }
- $state = $this->yystack[$this->yyidx]->stateno;
- if (in_array($token, self::$yyExpectedTokens[$state], true)) {
- return true;
- }
- $stack = $this->yystack;
- $yyidx = $this->yyidx;
- do {
- $yyact = $this->yy_find_shift_action($token);
- if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {
- // reduce action
- $done = 0;
- do {
- if ($done++ == 100) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- // too much recursion prevents proper detection
- // so give up
- return true;
- }
- $yyruleno = $yyact - self::YYNSTATE;
- $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];
- $nextstate = $this->yy_find_reduce_action(
- $this->yystack[$this->yyidx]->stateno,
- self::$yyRuleInfo[$yyruleno]['lhs']);
- if (isset(self::$yyExpectedTokens[$nextstate]) &&
- in_array($token, self::$yyExpectedTokens[$nextstate], true)) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- return true;
- }
- if ($nextstate < self::YYNSTATE) {
- // we need to shift a non-terminal
- $this->yyidx++;
- $x = new TP_yyStackEntry;
- $x->stateno = $nextstate;
- $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];
- $this->yystack[$this->yyidx] = $x;
- continue 2;
- } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- if (!$token) {
- // end of input: this is valid
- return true;
- }
- // the last token was just ignored, we can't accept
- // by ignoring input, this is in essence ignoring a
- // syntax error!
- return false;
- } elseif ($nextstate === self::YY_NO_ACTION) {
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- // input accepted, but not shifted (I guess)
- return true;
- } else {
- $yyact = $nextstate;
- }
- } while (true);
- }
- break;
- } while (true);
- $this->yyidx = $yyidx;
- $this->yystack = $stack;
- return true;
- }
-
- /**
- * Find the appropriate action for a parser given the terminal
- * look-ahead token iLookAhead.
- *
- * If the look-ahead token is YYNOCODE, then check to see if the action is
- * independent of the look-ahead. If it is, return the action, otherwise
- * return YY_NO_ACTION.
- * @param int The look-ahead token
- */
- function yy_find_shift_action($iLookAhead)
- {
- $stateno = $this->yystack[$this->yyidx]->stateno;
-
- /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */
- if (!isset(self::$yy_shift_ofst[$stateno])) {
- // no shift actions
- return self::$yy_default[$stateno];
- }
- $i = self::$yy_shift_ofst[$stateno];
- if ($i === self::YY_SHIFT_USE_DFLT) {
- return self::$yy_default[$stateno];
- }
- if ($iLookAhead == self::YYNOCODE) {
- return self::YY_NO_ACTION;
- }
- $i += $iLookAhead;
- if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
- self::$yy_lookahead[$i] != $iLookAhead) {
- if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback)
- && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) {
- if (self::$yyTraceFILE) {
- fwrite(self::$yyTraceFILE, self::$yyTracePrompt . "FALLBACK " .
- $this->yyTokenName[$iLookAhead] . " => " .
- $this->yyTokenName[$iFallback] . "\n");
- }
- return $this->yy_find_shift_action($iFallback);
- }
- return self::$yy_default[$stateno];
- } else {
- return self::$yy_action[$i];
- }
- }
-
- /**
- * Find the appropriate action for a parser given the non-terminal
- * look-ahead token $iLookAhead.
- *
- * If the look-ahead token is self::YYNOCODE, then check to see if the action is
- * independent of the look-ahead. If it is, return the action, otherwise
- * return self::YY_NO_ACTION.
- * @param int Current state number
- * @param int The look-ahead token
- */
- function yy_find_reduce_action($stateno, $iLookAhead)
- {
- /* $stateno = $this->yystack[$this->yyidx]->stateno; */
-
- if (!isset(self::$yy_reduce_ofst[$stateno])) {
- return self::$yy_default[$stateno];
- }
- $i = self::$yy_reduce_ofst[$stateno];
- if ($i == self::YY_REDUCE_USE_DFLT) {
- return self::$yy_default[$stateno];
- }
- if ($iLookAhead == self::YYNOCODE) {
- return self::YY_NO_ACTION;
- }
- $i += $iLookAhead;
- if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||
- self::$yy_lookahead[$i] != $iLookAhead) {
- return self::$yy_default[$stateno];
- } else {
- return self::$yy_action[$i];
- }
- }
-
- /**
- * Perform a shift action.
- * @param int The new state to shift in
- * @param int The major token to shift in
- * @param mixed the minor token to shift in
- */
- function yy_shift($yyNewState, $yyMajor, $yypMinor)
- {
- $this->yyidx++;
- if ($this->yyidx >= self::YYSTACKDEPTH) {
- $this->yyidx--;
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sStack Overflow!\n", self::$yyTracePrompt);
- }
- while ($this->yyidx >= 0) {
- $this->yy_pop_parser_stack();
- }
- /* Here code is inserted which will execute if the parser
- ** stack ever overflows */
- return;
- }
- $yytos = new TP_yyStackEntry;
- $yytos->stateno = $yyNewState;
- $yytos->major = $yyMajor;
- $yytos->minor = $yypMinor;
- array_push($this->yystack, $yytos);
- if (self::$yyTraceFILE && $this->yyidx > 0) {
- fprintf(self::$yyTraceFILE, "%sShift %d\n", self::$yyTracePrompt,
- $yyNewState);
- fprintf(self::$yyTraceFILE, "%sStack:", self::$yyTracePrompt);
- for($i = 1; $i <= $this->yyidx; $i++) {
- fprintf(self::$yyTraceFILE, " %s",
- $this->yyTokenName[$this->yystack[$i]->major]);
- }
- fwrite(self::$yyTraceFILE,"\n");
- }
- }
-
- /**
- * The following table contains information about every rule that
- * is used during the reduce.
- *
- * <pre>
- * array(
- * array(
- * int $lhs; Symbol on the left-hand side of the rule
- * int $nrhs; Number of right-hand side symbols in the rule
- * ),...
- * );
- * </pre>
- */
- static public $yyRuleInfo = array(
- array( 'lhs' => 68, 'rhs' => 1 ),
- array( 'lhs' => 69, 'rhs' => 1 ),
- array( 'lhs' => 69, 'rhs' => 2 ),
- array( 'lhs' => 70, 'rhs' => 1 ),
- array( 'lhs' => 70, 'rhs' => 1 ),
- array( 'lhs' => 70, 'rhs' => 3 ),
- array( 'lhs' => 70, 'rhs' => 3 ),
- array( 'lhs' => 70, 'rhs' => 1 ),
- array( 'lhs' => 70, 'rhs' => 1 ),
- array( 'lhs' => 70, 'rhs' => 1 ),
- array( 'lhs' => 71, 'rhs' => 4 ),
- array( 'lhs' => 71, 'rhs' => 4 ),
- array( 'lhs' => 71, 'rhs' => 4 ),
- array( 'lhs' => 71, 'rhs' => 6 ),
- array( 'lhs' => 71, 'rhs' => 6 ),
- array( 'lhs' => 71, 'rhs' => 4 ),
- array( 'lhs' => 71, 'rhs' => 3 ),
- array( 'lhs' => 71, 'rhs' => 6 ),
- array( 'lhs' => 71, 'rhs' => 6 ),
- array( 'lhs' => 71, 'rhs' => 8 ),
- array( 'lhs' => 71, 'rhs' => 5 ),
- array( 'lhs' => 71, 'rhs' => 5 ),
- array( 'lhs' => 71, 'rhs' => 13 ),
- array( 'lhs' => 84, 'rhs' => 2 ),
- array( 'lhs' => 84, 'rhs' => 1 ),
- array( 'lhs' => 71, 'rhs' => 8 ),
- array( 'lhs' => 71, 'rhs' => 11 ),
- array( 'lhs' => 71, 'rhs' => 8 ),
- array( 'lhs' => 71, 'rhs' => 11 ),
- array( 'lhs' => 71, 'rhs' => 4 ),
- array( 'lhs' => 71, 'rhs' => 6 ),
- array( 'lhs' => 71, 'rhs' => 5 ),
- array( 'lhs' => 73, 'rhs' => 2 ),
- array( 'lhs' => 73, 'rhs' => 1 ),
- array( 'lhs' => 73, 'rhs' => 0 ),
- array( 'lhs' => 87, 'rhs' => 4 ),
- array( 'lhs' => 87, 'rhs' => 4 ),
- array( 'lhs' => 87, 'rhs' => 4 ),
- array( 'lhs' => 87, 'rhs' => 2 ),
- array( 'lhs' => 87, 'rhs' => 4 ),
- array( 'lhs' => 81, 'rhs' => 1 ),
- array( 'lhs' => 81, 'rhs' => 3 ),
- array( 'lhs' => 80, 'rhs' => 4 ),
- array( 'lhs' => 74, 'rhs' => 1 ),
- array( 'lhs' => 74, 'rhs' => 1 ),
- array( 'lhs' => 74, 'rhs' => 4 ),
- array( 'lhs' => 74, 'rhs' => 3 ),
- array( 'lhs' => 88, 'rhs' => 1 ),
- array( 'lhs' => 88, 'rhs' => 2 ),
- array( 'lhs' => 88, 'rhs' => 3 ),
- array( 'lhs' => 88, 'rhs' => 1 ),
- array( 'lhs' => 75, 'rhs' => 7 ),
- array( 'lhs' => 75, 'rhs' => 7 ),
- array( 'lhs' => 89, 'rhs' => 1 ),
- array( 'lhs' => 89, 'rhs' => 1 ),
- array( 'lhs' => 89, 'rhs' => 1 ),
- array( 'lhs' => 85, 'rhs' => 1 ),
- array( 'lhs' => 85, 'rhs' => 2 ),
- array( 'lhs' => 85, 'rhs' => 2 ),
- array( 'lhs' => 85, 'rhs' => 1 ),
- array( 'lhs' => 85, 'rhs' => 3 ),
- array( 'lhs' => 85, 'rhs' => 1 ),
- array( 'lhs' => 85, 'rhs' => 1 ),
- array( 'lhs' => 85, 'rhs' => 1 ),
- array( 'lhs' => 85, 'rhs' => 3 ),
- array( 'lhs' => 85, 'rhs' => 1 ),
- array( 'lhs' => 85, 'rhs' => 3 ),
- array( 'lhs' => 85, 'rhs' => 2 ),
- array( 'lhs' => 85, 'rhs' => 3 ),
- array( 'lhs' => 85, 'rhs' => 7 ),
- array( 'lhs' => 85, 'rhs' => 4 ),
- array( 'lhs' => 85, 'rhs' => 8 ),
- array( 'lhs' => 85, 'rhs' => 3 ),
- array( 'lhs' => 85, 'rhs' => 5 ),
- array( 'lhs' => 85, 'rhs' => 6 ),
- array( 'lhs' => 85, 'rhs' => 1 ),
- array( 'lhs' => 72, 'rhs' => 1 ),
- array( 'lhs' => 72, 'rhs' => 4 ),
- array( 'lhs' => 72, 'rhs' => 1 ),
- array( 'lhs' => 72, 'rhs' => 3 ),
- array( 'lhs' => 72, 'rhs' => 3 ),
- array( 'lhs' => 76, 'rhs' => 3 ),
- array( 'lhs' => 95, 'rhs' => 2 ),
- array( 'lhs' => 95, 'rhs' => 0 ),
- array( 'lhs' => 97, 'rhs' => 2 ),
- array( 'lhs' => 97, 'rhs' => 2 ),
- array( 'lhs' => 97, 'rhs' => 2 ),
- array( 'lhs' => 97, 'rhs' => 2 ),
- array( 'lhs' => 97, 'rhs' => 3 ),
- array( 'lhs' => 97, 'rhs' => 2 ),
- array( 'lhs' => 97, 'rhs' => 4 ),
- array( 'lhs' => 97, 'rhs' => 3 ),
- array( 'lhs' => 97, 'rhs' => 5 ),
- array( 'lhs' => 97, 'rhs' => 3 ),
- array( 'lhs' => 97, 'rhs' => 2 ),
- array( 'lhs' => 83, 'rhs' => 1 ),
- array( 'lhs' => 83, 'rhs' => 2 ),
- array( 'lhs' => 98, 'rhs' => 1 ),
- array( 'lhs' => 98, 'rhs' => 3 ),
- array( 'lhs' => 96, 'rhs' => 2 ),
- array( 'lhs' => 94, 'rhs' => 1 ),
- array( 'lhs' => 94, 'rhs' => 2 ),
- array( 'lhs' => 99, 'rhs' => 3 ),
- array( 'lhs' => 99, 'rhs' => 3 ),
- array( 'lhs' => 99, 'rhs' => 5 ),
- array( 'lhs' => 99, 'rhs' => 6 ),
- array( 'lhs' => 99, 'rhs' => 2 ),
- array( 'lhs' => 90, 'rhs' => 4 ),
- array( 'lhs' => 92, 'rhs' => 4 ),
- array( 'lhs' => 93, 'rhs' => 3 ),
- array( 'lhs' => 93, 'rhs' => 1 ),
- array( 'lhs' => 93, 'rhs' => 0 ),
- array( 'lhs' => 77, 'rhs' => 3 ),
- array( 'lhs' => 77, 'rhs' => 2 ),
- array( 'lhs' => 78, 'rhs' => 2 ),
- array( 'lhs' => 78, 'rhs' => 0 ),
- array( 'lhs' => 100, 'rhs' => 2 ),
- array( 'lhs' => 100, 'rhs' => 2 ),
- array( 'lhs' => 79, 'rhs' => 1 ),
- array( 'lhs' => 79, 'rhs' => 2 ),
- array( 'lhs' => 79, 'rhs' => 3 ),
- array( 'lhs' => 101, 'rhs' => 1 ),
- array( 'lhs' => 101, 'rhs' => 3 ),
- array( 'lhs' => 101, 'rhs' => 3 ),
- array( 'lhs' => 101, 'rhs' => 3 ),
- array( 'lhs' => 101, 'rhs' => 3 ),
- array( 'lhs' => 101, 'rhs' => 3 ),
- array( 'lhs' => 101, 'rhs' => 3 ),
- array( 'lhs' => 101, 'rhs' => 2 ),
- array( 'lhs' => 101, 'rhs' => 2 ),
- array( 'lhs' => 101, 'rhs' => 3 ),
- array( 'lhs' => 101, 'rhs' => 3 ),
- array( 'lhs' => 101, 'rhs' => 2 ),
- array( 'lhs' => 101, 'rhs' => 2 ),
- array( 'lhs' => 101, 'rhs' => 3 ),
- array( 'lhs' => 101, 'rhs' => 3 ),
- array( 'lhs' => 101, 'rhs' => 3 ),
- array( 'lhs' => 101, 'rhs' => 3 ),
- array( 'lhs' => 102, 'rhs' => 1 ),
- array( 'lhs' => 102, 'rhs' => 1 ),
- array( 'lhs' => 102, 'rhs' => 1 ),
- array( 'lhs' => 102, 'rhs' => 1 ),
- array( 'lhs' => 102, 'rhs' => 1 ),
- array( 'lhs' => 102, 'rhs' => 1 ),
- array( 'lhs' => 102, 'rhs' => 1 ),
- array( 'lhs' => 102, 'rhs' => 1 ),
- array( 'lhs' => 102, 'rhs' => 1 ),
- array( 'lhs' => 103, 'rhs' => 1 ),
- array( 'lhs' => 103, 'rhs' => 1 ),
- array( 'lhs' => 103, 'rhs' => 1 ),
- array( 'lhs' => 86, 'rhs' => 3 ),
- array( 'lhs' => 104, 'rhs' => 1 ),
- array( 'lhs' => 104, 'rhs' => 3 ),
- array( 'lhs' => 104, 'rhs' => 0 ),
- array( 'lhs' => 105, 'rhs' => 3 ),
- array( 'lhs' => 105, 'rhs' => 3 ),
- array( 'lhs' => 105, 'rhs' => 1 ),
- array( 'lhs' => 91, 'rhs' => 2 ),
- array( 'lhs' => 91, 'rhs' => 1 ),
- array( 'lhs' => 106, 'rhs' => 3 ),
- array( 'lhs' => 106, 'rhs' => 1 ),
- array( 'lhs' => 106, 'rhs' => 3 ),
- array( 'lhs' => 106, 'rhs' => 3 ),
- array( 'lhs' => 106, 'rhs' => 1 ),
- array( 'lhs' => 106, 'rhs' => 1 ),
- array( 'lhs' => 82, 'rhs' => 1 ),
- array( 'lhs' => 82, 'rhs' => 0 ),
- );
-
- /**
- * The following table contains a mapping of reduce action to method name
- * that handles the reduction.
- *
- * If a rule is not set, it has no handler.
- */
- static public $yyReduceMap = array(
- 0 => 0,
- 47 => 0,
- 56 => 0,
- 59 => 0,
- 61 => 0,
- 62 => 0,
- 63 => 0,
- 65 => 0,
- 78 => 0,
- 151 => 0,
- 1 => 1,
- 44 => 1,
- 50 => 1,
- 53 => 1,
- 54 => 1,
- 95 => 1,
- 118 => 1,
- 158 => 1,
- 164 => 1,
- 165 => 1,
- 2 => 2,
- 114 => 2,
- 3 => 3,
- 4 => 4,
- 5 => 5,
- 6 => 6,
- 7 => 7,
- 8 => 8,
- 9 => 9,
- 10 => 10,
- 11 => 10,
- 12 => 10,
- 13 => 13,
- 14 => 13,
- 15 => 15,
- 16 => 16,
- 17 => 17,
- 18 => 18,
- 19 => 19,
- 20 => 20,
- 21 => 21,
- 22 => 22,
- 23 => 23,
- 24 => 24,
- 33 => 24,
- 110 => 24,
- 156 => 24,
- 25 => 25,
- 26 => 26,
- 27 => 27,
- 28 => 28,
- 29 => 29,
- 30 => 30,
- 31 => 31,
- 32 => 32,
- 34 => 34,
- 35 => 35,
- 36 => 35,
- 37 => 35,
- 39 => 35,
- 38 => 38,
- 40 => 40,
- 41 => 41,
- 42 => 42,
- 43 => 43,
- 45 => 45,
- 46 => 46,
- 48 => 48,
- 57 => 48,
- 58 => 48,
- 49 => 49,
- 51 => 51,
- 52 => 51,
- 55 => 55,
- 60 => 60,
- 64 => 64,
- 66 => 66,
- 67 => 67,
- 68 => 68,
- 69 => 69,
- 70 => 70,
- 71 => 71,
- 72 => 72,
- 73 => 73,
- 74 => 74,
- 75 => 75,
- 76 => 76,
- 77 => 77,
- 79 => 79,
- 80 => 80,
- 81 => 81,
- 82 => 82,
- 157 => 82,
- 83 => 83,
- 115 => 83,
- 84 => 84,
- 85 => 84,
- 86 => 84,
- 87 => 87,
- 88 => 88,
- 89 => 89,
- 90 => 90,
- 93 => 90,
- 91 => 91,
- 92 => 92,
- 94 => 94,
- 166 => 94,
- 96 => 96,
- 97 => 97,
- 98 => 98,
- 120 => 98,
- 99 => 99,
- 100 => 100,
- 101 => 101,
- 102 => 102,
- 103 => 103,
- 104 => 104,
- 105 => 105,
- 106 => 106,
- 107 => 107,
- 108 => 108,
- 109 => 109,
- 111 => 111,
- 112 => 112,
- 113 => 113,
- 116 => 116,
- 117 => 117,
- 119 => 119,
- 121 => 121,
- 122 => 122,
- 125 => 122,
- 136 => 122,
- 123 => 123,
- 124 => 124,
- 126 => 126,
- 127 => 127,
- 128 => 128,
- 133 => 128,
- 129 => 129,
- 132 => 129,
- 130 => 130,
- 135 => 130,
- 131 => 131,
- 134 => 131,
- 137 => 137,
- 138 => 138,
- 139 => 139,
- 140 => 140,
- 141 => 141,
- 142 => 142,
- 143 => 143,
- 144 => 144,
- 145 => 145,
- 146 => 146,
- 147 => 147,
- 148 => 148,
- 149 => 149,
- 150 => 150,
- 152 => 152,
- 153 => 153,
- 154 => 154,
- 155 => 155,
- 159 => 159,
- 161 => 159,
- 160 => 160,
- 162 => 162,
- 163 => 163,
- );
- /* Beginning here are the reduction cases. A typical example
- ** follows:
- ** #line <lineno> <grammarfile>
- ** function yy_r0($yymsp){ ... } // User supplied code
- ** #line <lineno> <thisfile>
- */
-#line 79 "smarty_internal_templateparser.y"
- function yy_r0(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }
-#line 1997 "smarty_internal_templateparser.php"
-#line 85 "smarty_internal_templateparser.y"
- function yy_r1(){$this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }
-#line 2000 "smarty_internal_templateparser.php"
-#line 87 "smarty_internal_templateparser.y"
- function yy_r2(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2003 "smarty_internal_templateparser.php"
-#line 93 "smarty_internal_templateparser.y"
- function yy_r3(){
- if ($this->compiler->has_code) {
- $tmp =''; foreach ($this->compiler->prefix_code as $code) {$tmp.=$code;} $this->compiler->prefix_code=array();
- $this->_retvalue = $this->cacher->processNocacheCode($tmp.$this->yystack[$this->yyidx + 0]->minor, $this->compiler,true);
- } else { $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;} $this->compiler->has_variable_string = false; }
-#line 2010 "smarty_internal_templateparser.php"
-#line 100 "smarty_internal_templateparser.y"
- function yy_r4(){ $this->_retvalue = ''; }
-#line 2013 "smarty_internal_templateparser.php"
-#line 105 "smarty_internal_templateparser.y"
- function yy_r5(){if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU) {
- $this->_retvalue = $this->cacher->processNocacheCode("<?php echo htmlspecialchars('<?php".str_replace("'","\'",$this->yystack[$this->yyidx + -1]->minor)."?>', ENT_QUOTES);?>\n", $this->compiler, false);
- } elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) {
- $this->_retvalue = $this->cacher->processNocacheCode(htmlspecialchars('<?php'.$this->yystack[$this->yyidx + -1]->minor.'?>', ENT_QUOTES), $this->compiler, false);
- }elseif ($this->sec_obj->php_handling == SMARTY_PHP_ALLOW) {
- $this->_retvalue = $this->cacher->processNocacheCode('<?php'.$this->yystack[$this->yyidx + -1]->minor.'?>', $this->compiler, true);
- }elseif ($this->sec_obj->php_handling == SMARTY_PHP_REMOVE) {
- $this->_retvalue = '';
- }
- }
-#line 2025 "smarty_internal_templateparser.php"
-#line 116 "smarty_internal_templateparser.y"
- function yy_r6(){
- if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU || $this->sec_obj->php_handling == SMARTY_PHP_ALLOW) {
- $this->_retvalue = $this->cacher->processNocacheCode("<?php echo '<?=".$this->yystack[$this->yyidx + -1]->minor."?>'?>\n", $this->compiler, false);
- } elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) {
- $this->_retvalue = $this->cacher->processNocacheCode(htmlspecialchars('<?='.$this->yystack[$this->yyidx + -1]->minor.'?>', ENT_QUOTES), $this->compiler, false);
- }elseif ($this->sec_obj == SMARTY_PHP_REMOVE) {
- $this->_retvalue = '';
- }
- }
-#line 2036 "smarty_internal_templateparser.php"
-#line 127 "smarty_internal_templateparser.y"
- function yy_r7(){ $this->compiler->tag_nocache = true; $this->_retvalue = $this->cacher->processNocacheCode("<?php echo '<?xml';?>", $this->compiler, true); }
-#line 2039 "smarty_internal_templateparser.php"
-#line 128 "smarty_internal_templateparser.y"
- function yy_r8(){$this->compiler->tag_nocache = true; $this->_retvalue = $this->cacher->processNocacheCode("<?php echo '?>';?>\n", $this->compiler, true); }
-#line 2042 "smarty_internal_templateparser.php"
-#line 130 "smarty_internal_templateparser.y"
- function yy_r9(){$this->_retvalue = $this->cacher->processNocacheCode($this->yystack[$this->yyidx + 0]->minor, $this->compiler,false); }
-#line 2045 "smarty_internal_templateparser.php"
-#line 137 "smarty_internal_templateparser.y"
- function yy_r10(){ $this->_retvalue = $this->compiler->compileTag('print_expression',array_merge(array('value'=>$this->yystack[$this->yyidx + -2]->minor),$this->yystack[$this->yyidx + -1]->minor)); }
-#line 2048 "smarty_internal_templateparser.php"
-#line 147 "smarty_internal_templateparser.y"
- function yy_r13(){ $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array('value'=>$this->yystack[$this->yyidx + -2]->minor),$this->yystack[$this->yyidx + -4]->minor,$this->yystack[$this->yyidx + -1]->minor)); }
-#line 2051 "smarty_internal_templateparser.php"
-#line 150 "smarty_internal_templateparser.y"
- function yy_r15(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor,$this->yystack[$this->yyidx + -1]->minor); }
-#line 2054 "smarty_internal_templateparser.php"
-#line 151 "smarty_internal_templateparser.y"
- function yy_r16(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor,array()); }
-#line 2057 "smarty_internal_templateparser.php"
-#line 153 "smarty_internal_templateparser.y"
- function yy_r17(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor,array_merge(array('object_methode'=>$this->yystack[$this->yyidx + -2]->minor),$this->yystack[$this->yyidx + -1]->minor)); }
-#line 2060 "smarty_internal_templateparser.php"
-#line 155 "smarty_internal_templateparser.y"
- function yy_r18(){ $this->_retvalue = '<?php ob_start();?>'.$this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor,$this->yystack[$this->yyidx + -1]->minor).'<?php echo ';
- if ($this->smarty->plugin_handler->loadSmartyPlugin($this->yystack[$this->yyidx + -3]->minor[0],'modifier')) {
- $this->_retvalue .= "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -3]->minor[0] . "',array(ob_get_clean()" . $this->yystack[$this->yyidx + -2]->minor. "),".$this->yystack[$this->yyidx + -3]->minor[1].");?>";
- } else {
- if (is_callable($this->yystack[$this->yyidx + -3]->minor[0])) {
- if (!$this->template->security || $this->smarty->security_handler->isTrustedModifier($this->yystack[$this->yyidx + -3]->minor[0], $this->compiler)) {
- $this->_retvalue .= "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -3]->minor[0] . "',array(ob_get_clean()" . $this->yystack[$this->yyidx + -2]->minor. "),".$this->yystack[$this->yyidx + -3]->minor[1].");?>";
- }
- } else {
- $this->compiler->trigger_template_error ("unknown modifier \"" . $this->yystack[$this->yyidx + -3]->minor[0] . "\"");
- }
- }
- }
-#line 2075 "smarty_internal_templateparser.php"
-#line 169 "smarty_internal_templateparser.y"
- function yy_r19(){ $this->_retvalue = '<?php ob_start();?>'.$this->compiler->compileTag($this->yystack[$this->yyidx + -6]->minor,array_merge(array('object_methode'=>$this->yystack[$this->yyidx + -4]->minor),$this->yystack[$this->yyidx + -1]->minor)).'<?php echo ';
- if ($this->smarty->plugin_handler->loadSmartyPlugin($this->yystack[$this->yyidx + -3]->minor[0],'modifier')) {
- $this->_retvalue .= "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -3]->minor[0] . "',array(ob_get_clean()" . $this->yystack[$this->yyidx + -2]->minor. "),".$this->yystack[$this->yyidx + -3]->minor[1].");?>";
- } else {
- if (is_callable($this->yystack[$this->yyidx + -3]->minor[0])) {
- if (!$this->template->security || $this->smarty->security_handler->isTrustedModifier($this->yystack[$this->yyidx + -3]->minor[0], $this->compiler)) {
- $this->_retvalue .= "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -3]->minor[0] . "',array(ob_get_clean()" . $this->yystack[$this->yyidx + -2]->minor. "),".$this->yystack[$this->yyidx + -3]->minor[1].");?>";
- }
- } else {
- $this->compiler->trigger_template_error ("unknown modifier \"" . $this->yystack[$this->yyidx + -3]->minor[0] . "\"");
- }
- }
- }
-#line 2090 "smarty_internal_templateparser.php"
-#line 183 "smarty_internal_templateparser.y"
- function yy_r20(){if (!in_array($this->yystack[$this->yyidx + -3]->minor,array('if','elseif','while'))) {
- $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -3]->minor . "\"");
- }
- $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor,array('if condition'=>$this->yystack[$this->yyidx + -1]->minor)); }
-#line 2096 "smarty_internal_templateparser.php"
-#line 187 "smarty_internal_templateparser.y"
- function yy_r21(){ if (!in_array($this->yystack[$this->yyidx + -3]->minor,array('if','elseif','while'))) {
- $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -3]->minor . "\"");
- }
- $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor,array('if condition'=>$this->yystack[$this->yyidx + -1]->minor)); }
-#line 2102 "smarty_internal_templateparser.php"
-#line 192 "smarty_internal_templateparser.y"
- function yy_r22(){
- if ($this->yystack[$this->yyidx + -11]->minor != 'for') {
- $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -11]->minor . "\"");
- }
- $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -11]->minor,array('start'=>$this->yystack[$this->yyidx + -9]->minor,'ifexp'=>$this->yystack[$this->yyidx + -6]->minor,'varloop'=>$this->yystack[$this->yyidx + -2]->minor,'loop'=>$this->yystack[$this->yyidx + -1]->minor)); }
-#line 2109 "smarty_internal_templateparser.php"
-#line 197 "smarty_internal_templateparser.y"
- function yy_r23(){ $this->_retvalue = '='.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2112 "smarty_internal_templateparser.php"
-#line 198 "smarty_internal_templateparser.y"
- function yy_r24(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }
-#line 2115 "smarty_internal_templateparser.php"
-#line 200 "smarty_internal_templateparser.y"
- function yy_r25(){
- if ($this->yystack[$this->yyidx + -6]->minor != 'foreach') {
- $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -6]->minor . "\"");
- }
- $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -6]->minor,array('from'=>$this->yystack[$this->yyidx + -4]->minor,'item'=>$this->yystack[$this->yyidx + -1]->minor)); }
-#line 2122 "smarty_internal_templateparser.php"
-#line 205 "smarty_internal_templateparser.y"
- function yy_r26(){
- if ($this->yystack[$this->yyidx + -9]->minor != 'foreach') {
- $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -9]->minor . "\"");
- }
- $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -9]->minor,array('from'=>$this->yystack[$this->yyidx + -7]->minor,'item'=>$this->yystack[$this->yyidx + -1]->minor,'key'=>$this->yystack[$this->yyidx + -4]->minor)); }
-#line 2129 "smarty_internal_templateparser.php"
-#line 210 "smarty_internal_templateparser.y"
- function yy_r27(){
- if ($this->yystack[$this->yyidx + -6]->minor != 'foreach') {
- $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -6]->minor . "\"");
- }
- $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -6]->minor,array('from'=>$this->yystack[$this->yyidx + -4]->minor,'item'=>$this->yystack[$this->yyidx + -1]->minor)); }
-#line 2136 "smarty_internal_templateparser.php"
-#line 215 "smarty_internal_templateparser.y"
- function yy_r28(){
- if ($this->yystack[$this->yyidx + -9]->minor != 'foreach') {
- $this->compiler->trigger_template_error ("wrong syntax for tag \"" . $this->yystack[$this->yyidx + -9]->minor . "\"");
- }
- $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -9]->minor,array('from'=>$this->yystack[$this->yyidx + -7]->minor,'item'=>$this->yystack[$this->yyidx + -1]->minor,'key'=>$this->yystack[$this->yyidx + -4]->minor)); }
-#line 2143 "smarty_internal_templateparser.php"
-#line 222 "smarty_internal_templateparser.y"
- function yy_r29(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor.'close',$this->yystack[$this->yyidx + -1]->minor); }
-#line 2146 "smarty_internal_templateparser.php"
-#line 223 "smarty_internal_templateparser.y"
- function yy_r30(){ $this->_retvalue = '<?php ob_start();?>'.$this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor.'close',$this->yystack[$this->yyidx + -1]->minor).'<?php echo ';
- if ($this->smarty->plugin_handler->loadSmartyPlugin($this->yystack[$this->yyidx + -3]->minor[0],'modifier')) {
- $this->_retvalue .= "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -3]->minor[0] . "',array(ob_get_clean()" . $this->yystack[$this->yyidx + -2]->minor. "),".$this->yystack[$this->yyidx + -3]->minor[1].");?>";
- } else {
- if (is_callable($this->yystack[$this->yyidx + -3]->minor[0])) {
- if (!$this->template->security || $this->smarty->security_handler->isTrustedModifier($this->yystack[$this->yyidx + -3]->minor[0], $this->compiler)) {
- $this->_retvalue .= "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -3]->minor[0] . "',array(ob_get_clean()" . $this->yystack[$this->yyidx + -2]->minor. "),".$this->yystack[$this->yyidx + -3]->minor[1].");?>";
- }
- } else {
- $this->compiler->trigger_template_error ("unknown modifier \"" . $this->yystack[$this->yyidx + -3]->minor[0] . "\"");
- }
- }
- }
-#line 2161 "smarty_internal_templateparser.php"
-#line 237 "smarty_internal_templateparser.y"
- function yy_r31(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor.'close',array('object_methode'=>$this->yystack[$this->yyidx + -1]->minor)); }
-#line 2164 "smarty_internal_templateparser.php"
-#line 244 "smarty_internal_templateparser.y"
- function yy_r32(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); }
-#line 2167 "smarty_internal_templateparser.php"
-#line 248 "smarty_internal_templateparser.y"
- function yy_r34(){ $this->_retvalue = array(); }
-#line 2170 "smarty_internal_templateparser.php"
-#line 251 "smarty_internal_templateparser.y"
- function yy_r35(){ $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>$this->yystack[$this->yyidx + 0]->minor); }
-#line 2173 "smarty_internal_templateparser.php"
-#line 254 "smarty_internal_templateparser.y"
- function yy_r38(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor=>'true'); }
-#line 2176 "smarty_internal_templateparser.php"
-#line 261 "smarty_internal_templateparser.y"
- function yy_r40(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); }
-#line 2179 "smarty_internal_templateparser.php"
-#line 262 "smarty_internal_templateparser.y"
- function yy_r41(){ $this->yystack[$this->yyidx + -2]->minor[]=$this->yystack[$this->yyidx + 0]->minor; $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor; }
-#line 2182 "smarty_internal_templateparser.php"
-#line 264 "smarty_internal_templateparser.y"
- function yy_r42(){ $this->_retvalue = array('var' => $this->yystack[$this->yyidx + -2]->minor, 'value'=>$this->yystack[$this->yyidx + 0]->minor); }
-#line 2185 "smarty_internal_templateparser.php"
-#line 270 "smarty_internal_templateparser.y"
- function yy_r43(){ $this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; }
-#line 2188 "smarty_internal_templateparser.php"
-#line 273 "smarty_internal_templateparser.y"
- function yy_r45(){$this->_retvalue = '$_smarty_tpl->getStreamVariable(\''. $this->yystack[$this->yyidx + -2]->minor .'://'. $this->yystack[$this->yyidx + 0]->minor . '\')'; }
-#line 2191 "smarty_internal_templateparser.php"
-#line 274 "smarty_internal_templateparser.y"
- function yy_r46(){
- if ($this->smarty->plugin_handler->loadSmartyPlugin($this->yystack[$this->yyidx + -1]->minor[0],'modifier')) {
- $this->_retvalue = "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -1]->minor[0] . "',array(". $this->yystack[$this->yyidx + -2]->minor . $this->yystack[$this->yyidx + 0]->minor. "),".$this->yystack[$this->yyidx + -1]->minor[1].")";
- } else {
- if (is_callable($this->yystack[$this->yyidx + -1]->minor[0])) {
- if (!$this->template->security || $this->smarty->security_handler->isTrustedModifier($this->yystack[$this->yyidx + -1]->minor[0], $this->compiler)) {
- $this->_retvalue = "\$_smarty_tpl->smarty->plugin_handler->executeModifier('".$this->yystack[$this->yyidx + -1]->minor[0] . "',array(". $this->yystack[$this->yyidx + -2]->minor . $this->yystack[$this->yyidx + 0]->minor. "),".$this->yystack[$this->yyidx + -1]->minor[1].")";
- }
- } else {
- $this->compiler->trigger_template_error ("unknown modifier \"" . $this->yystack[$this->yyidx + -1]->minor[0] . "\"");
- }
- }
- }
-#line 2206 "smarty_internal_templateparser.php"
-#line 291 "smarty_internal_templateparser.y"
- function yy_r48(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2209 "smarty_internal_templateparser.php"
-#line 293 "smarty_internal_templateparser.y"
- function yy_r49(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor . $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + 0]->minor; }
-#line 2212 "smarty_internal_templateparser.php"
-#line 300 "smarty_internal_templateparser.y"
- function yy_r51(){ $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2215 "smarty_internal_templateparser.php"
-#line 314 "smarty_internal_templateparser.y"
- function yy_r55(){$this->_retvalue = ' & '; }
-#line 2218 "smarty_internal_templateparser.php"
-#line 322 "smarty_internal_templateparser.y"
- function yy_r60(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2221 "smarty_internal_templateparser.php"
-#line 330 "smarty_internal_templateparser.y"
- function yy_r64(){ $this->_retvalue = "(". $this->yystack[$this->yyidx + -1]->minor .")"; }
-#line 2224 "smarty_internal_templateparser.php"
-#line 334 "smarty_internal_templateparser.y"
- function yy_r66(){ $this->_retvalue = str_replace(array('."".','"".','.""'),array('.','',''),'"'.$this->yystack[$this->yyidx + -1]->minor.'"'); }
-#line 2227 "smarty_internal_templateparser.php"
-#line 335 "smarty_internal_templateparser.y"
- function yy_r67(){ $this->_retvalue = "''"; }
-#line 2230 "smarty_internal_templateparser.php"
-#line 337 "smarty_internal_templateparser.y"
- function yy_r68(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2233 "smarty_internal_templateparser.php"
-#line 338 "smarty_internal_templateparser.y"
- function yy_r69(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php $_tmp'.$this->prefix_number.'=$_smarty_tpl->getVariable(\''. $this->yystack[$this->yyidx + -3]->minor .'\')->value;?>'; $this->_retvalue = $this->yystack[$this->yyidx + -6]->minor.'::$_tmp'.$this->prefix_number.'('. $this->yystack[$this->yyidx + -1]->minor .')'; }
-#line 2236 "smarty_internal_templateparser.php"
-#line 340 "smarty_internal_templateparser.y"
- function yy_r70(){ $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor.'::'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2239 "smarty_internal_templateparser.php"
-#line 341 "smarty_internal_templateparser.y"
- function yy_r71(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php $_tmp'.$this->prefix_number.'=$_smarty_tpl->getVariable(\''. $this->yystack[$this->yyidx + -4]->minor .'\')->value;?>'; $this->_retvalue = $this->yystack[$this->yyidx + -7]->minor.'::$_tmp'.$this->prefix_number.'('. $this->yystack[$this->yyidx + -2]->minor .')'.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2242 "smarty_internal_templateparser.php"
-#line 343 "smarty_internal_templateparser.y"
- function yy_r72(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2245 "smarty_internal_templateparser.php"
-#line 345 "smarty_internal_templateparser.y"
- function yy_r73(){ $this->_retvalue = $this->yystack[$this->yyidx + -4]->minor.'::$'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2248 "smarty_internal_templateparser.php"
-#line 347 "smarty_internal_templateparser.y"
- function yy_r74(){ $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.'::$'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2251 "smarty_internal_templateparser.php"
-#line 349 "smarty_internal_templateparser.y"
- function yy_r75(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php ob_start();?>'.$this->yystack[$this->yyidx + 0]->minor.'<?php $_tmp'.$this->prefix_number.'=ob_get_clean();?>'; $this->_retvalue = '$_tmp'.$this->prefix_number; }
-#line 2254 "smarty_internal_templateparser.php"
-#line 358 "smarty_internal_templateparser.y"
- function yy_r76(){if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\'smarty\'') { $this->_retvalue = $this->compiler->compileTag('special_smarty_variable',$this->yystack[$this->yyidx + 0]->minor['index']);} else {
- $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + 0]->minor['var'] .')->value'.$this->yystack[$this->yyidx + 0]->minor['index']; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor['var'],"'"))->nocache;} }
-#line 2258 "smarty_internal_templateparser.php"
-#line 361 "smarty_internal_templateparser.y"
- function yy_r77(){ $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -2]->minor .')->'.$this->yystack[$this->yyidx + 0]->minor; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -2]->minor,"'"))->nocache; }
-#line 2261 "smarty_internal_templateparser.php"
-#line 365 "smarty_internal_templateparser.y"
- function yy_r79(){$this->_retvalue = '$_smarty_tpl->getConfigVariable(\''. $this->yystack[$this->yyidx + -1]->minor .'\')'; }
-#line 2264 "smarty_internal_templateparser.php"
-#line 366 "smarty_internal_templateparser.y"
- function yy_r80(){$this->_retvalue = '$_smarty_tpl->getConfigVariable('. $this->yystack[$this->yyidx + -1]->minor .')'; }
-#line 2267 "smarty_internal_templateparser.php"
-#line 369 "smarty_internal_templateparser.y"
- function yy_r81(){$this->_retvalue = array('var'=>$this->yystack[$this->yyidx + -1]->minor, 'index'=>$this->yystack[$this->yyidx + 0]->minor); }
-#line 2270 "smarty_internal_templateparser.php"
-#line 375 "smarty_internal_templateparser.y"
- function yy_r82(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2273 "smarty_internal_templateparser.php"
-#line 377 "smarty_internal_templateparser.y"
- function yy_r83(){return; }
-#line 2276 "smarty_internal_templateparser.php"
-#line 381 "smarty_internal_templateparser.y"
- function yy_r84(){ $this->_retvalue = "['". $this->yystack[$this->yyidx + 0]->minor ."']"; }
-#line 2279 "smarty_internal_templateparser.php"
-#line 384 "smarty_internal_templateparser.y"
- function yy_r87(){ $this->_retvalue = "[". $this->yystack[$this->yyidx + 0]->minor ."]"; }
-#line 2282 "smarty_internal_templateparser.php"
-#line 385 "smarty_internal_templateparser.y"
- function yy_r88(){ $this->_retvalue = "['". $this->yystack[$this->yyidx + -1]->minor . $this->yystack[$this->yyidx + 0]->minor ."']"; }
-#line 2285 "smarty_internal_templateparser.php"
-#line 386 "smarty_internal_templateparser.y"
- function yy_r89(){ $this->_retvalue = "[".$this->yystack[$this->yyidx + 0]->minor."]"; }
-#line 2288 "smarty_internal_templateparser.php"
-#line 387 "smarty_internal_templateparser.y"
- function yy_r90(){ $this->_retvalue = "[". $this->yystack[$this->yyidx + -1]->minor ."]"; }
-#line 2291 "smarty_internal_templateparser.php"
-#line 389 "smarty_internal_templateparser.y"
- function yy_r91(){ $this->_retvalue = '['.$this->compiler->compileTag('special_smarty_variable','[\'section\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\'][\'index\']').']'; }
-#line 2294 "smarty_internal_templateparser.php"
-#line 390 "smarty_internal_templateparser.y"
- function yy_r92(){ $this->_retvalue = '['.$this->compiler->compileTag('special_smarty_variable','[\'section\'][\''.$this->yystack[$this->yyidx + -3]->minor.'\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\']').']'; }
-#line 2297 "smarty_internal_templateparser.php"
-#line 394 "smarty_internal_templateparser.y"
- function yy_r94(){$this->_retvalue = ''; }
-#line 2300 "smarty_internal_templateparser.php"
-#line 402 "smarty_internal_templateparser.y"
- function yy_r96(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2303 "smarty_internal_templateparser.php"
-#line 404 "smarty_internal_templateparser.y"
- function yy_r97(){$this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; }
-#line 2306 "smarty_internal_templateparser.php"
-#line 406 "smarty_internal_templateparser.y"
- function yy_r98(){$this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')'; }
-#line 2309 "smarty_internal_templateparser.php"
-#line 411 "smarty_internal_templateparser.y"
- function yy_r99(){ if ($this->yystack[$this->yyidx + -1]->minor['var'] == '\'smarty\'') { $this->_retvalue = $this->compiler->compileTag('special_smarty_variable',$this->yystack[$this->yyidx + -1]->minor['index']).$this->yystack[$this->yyidx + 0]->minor;} else {
- $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -1]->minor['var'] .')->value'.$this->yystack[$this->yyidx + -1]->minor['index'].$this->yystack[$this->yyidx + 0]->minor; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -1]->minor['var'],"'"))->nocache;} }
-#line 2313 "smarty_internal_templateparser.php"
-#line 414 "smarty_internal_templateparser.y"
- function yy_r100(){$this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }
-#line 2316 "smarty_internal_templateparser.php"
-#line 416 "smarty_internal_templateparser.y"
- function yy_r101(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2319 "smarty_internal_templateparser.php"
-#line 418 "smarty_internal_templateparser.y"
- function yy_r102(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2322 "smarty_internal_templateparser.php"
-#line 419 "smarty_internal_templateparser.y"
- function yy_r103(){ $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; }
-#line 2325 "smarty_internal_templateparser.php"
-#line 420 "smarty_internal_templateparser.y"
- function yy_r104(){ $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; }
-#line 2328 "smarty_internal_templateparser.php"
-#line 421 "smarty_internal_templateparser.y"
- function yy_r105(){ $this->_retvalue = '->{\''.$this->yystack[$this->yyidx + -4]->minor.'\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; }
-#line 2331 "smarty_internal_templateparser.php"
-#line 423 "smarty_internal_templateparser.y"
- function yy_r106(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2334 "smarty_internal_templateparser.php"
-#line 429 "smarty_internal_templateparser.y"
- function yy_r107(){if (!$this->template->security || $this->smarty->security_handler->isTrustedPhpFunction($this->yystack[$this->yyidx + -3]->minor, $this->compiler)) {
- if ($this->yystack[$this->yyidx + -3]->minor == 'isset' || $this->yystack[$this->yyidx + -3]->minor == 'empty' || $this->yystack[$this->yyidx + -3]->minor == 'array' || is_callable($this->yystack[$this->yyidx + -3]->minor)) {
- $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". $this->yystack[$this->yyidx + -1]->minor .")";
- } else {
- $this->compiler->trigger_template_error ("unknown function \"" . $this->yystack[$this->yyidx + -3]->minor . "\"");
- }
- } }
-#line 2343 "smarty_internal_templateparser.php"
-#line 440 "smarty_internal_templateparser.y"
- function yy_r108(){ $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". $this->yystack[$this->yyidx + -1]->minor .")"; }
-#line 2346 "smarty_internal_templateparser.php"
-#line 444 "smarty_internal_templateparser.y"
- function yy_r109(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.",".$this->yystack[$this->yyidx + 0]->minor; }
-#line 2349 "smarty_internal_templateparser.php"
-#line 448 "smarty_internal_templateparser.y"
- function yy_r111(){ return; }
-#line 2352 "smarty_internal_templateparser.php"
-#line 453 "smarty_internal_templateparser.y"
- function yy_r112(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor,'false'); }
-#line 2355 "smarty_internal_templateparser.php"
-#line 454 "smarty_internal_templateparser.y"
- function yy_r113(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor,'true'); }
-#line 2358 "smarty_internal_templateparser.php"
-#line 470 "smarty_internal_templateparser.y"
- function yy_r116(){$this->_retvalue = ','.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2361 "smarty_internal_templateparser.php"
-#line 471 "smarty_internal_templateparser.y"
- function yy_r117(){$this->_retvalue = ',\''.$this->yystack[$this->yyidx + 0]->minor.'\''; }
-#line 2364 "smarty_internal_templateparser.php"
-#line 478 "smarty_internal_templateparser.y"
- function yy_r119(){$this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2367 "smarty_internal_templateparser.php"
-#line 483 "smarty_internal_templateparser.y"
- function yy_r121(){$this->_retvalue =$this->yystack[$this->yyidx + 0]->minor; }
-#line 2370 "smarty_internal_templateparser.php"
-#line 485 "smarty_internal_templateparser.y"
- function yy_r122(){$this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2373 "smarty_internal_templateparser.php"
-#line 486 "smarty_internal_templateparser.y"
- function yy_r123(){$this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor.')'; }
-#line 2376 "smarty_internal_templateparser.php"
-#line 487 "smarty_internal_templateparser.y"
- function yy_r124(){$this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.',(array)'.$this->yystack[$this->yyidx + 0]->minor.')'; }
-#line 2379 "smarty_internal_templateparser.php"
-#line 489 "smarty_internal_templateparser.y"
- function yy_r126(){$this->_retvalue = '!('.$this->yystack[$this->yyidx + -2]->minor.' % '.$this->yystack[$this->yyidx + 0]->minor.')'; }
-#line 2382 "smarty_internal_templateparser.php"
-#line 490 "smarty_internal_templateparser.y"
- function yy_r127(){$this->_retvalue = '('.$this->yystack[$this->yyidx + -2]->minor.' % '.$this->yystack[$this->yyidx + 0]->minor.')'; }
-#line 2385 "smarty_internal_templateparser.php"
-#line 491 "smarty_internal_templateparser.y"
- function yy_r128(){$this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; }
-#line 2388 "smarty_internal_templateparser.php"
-#line 492 "smarty_internal_templateparser.y"
- function yy_r129(){$this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; }
-#line 2391 "smarty_internal_templateparser.php"
-#line 493 "smarty_internal_templateparser.y"
- function yy_r130(){$this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')'; }
-#line 2394 "smarty_internal_templateparser.php"
-#line 494 "smarty_internal_templateparser.y"
- function yy_r131(){$this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')'; }
-#line 2397 "smarty_internal_templateparser.php"
-#line 500 "smarty_internal_templateparser.y"
- function yy_r137(){$this->prefix_number++; $this->compiler->prefix_code[] = '<?php $_tmp'.$this->prefix_number.'='.$this->yystack[$this->yyidx + 0]->minor.';?>'; $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.'$_tmp'.$this->prefix_number; }
-#line 2400 "smarty_internal_templateparser.php"
-#line 502 "smarty_internal_templateparser.y"
- function yy_r138(){$this->_retvalue = '=='; }
-#line 2403 "smarty_internal_templateparser.php"
-#line 503 "smarty_internal_templateparser.y"
- function yy_r139(){$this->_retvalue = '!='; }
-#line 2406 "smarty_internal_templateparser.php"
-#line 504 "smarty_internal_templateparser.y"
- function yy_r140(){$this->_retvalue = '>'; }
-#line 2409 "smarty_internal_templateparser.php"
-#line 505 "smarty_internal_templateparser.y"
- function yy_r141(){$this->_retvalue = '<'; }
-#line 2412 "smarty_internal_templateparser.php"
-#line 506 "smarty_internal_templateparser.y"
- function yy_r142(){$this->_retvalue = '>='; }
-#line 2415 "smarty_internal_templateparser.php"
-#line 507 "smarty_internal_templateparser.y"
- function yy_r143(){$this->_retvalue = '<='; }
-#line 2418 "smarty_internal_templateparser.php"
-#line 508 "smarty_internal_templateparser.y"
- function yy_r144(){$this->_retvalue = '==='; }
-#line 2421 "smarty_internal_templateparser.php"
-#line 509 "smarty_internal_templateparser.y"
- function yy_r145(){$this->_retvalue = '!=='; }
-#line 2424 "smarty_internal_templateparser.php"
-#line 510 "smarty_internal_templateparser.y"
- function yy_r146(){$this->_retvalue = '%'; }
-#line 2427 "smarty_internal_templateparser.php"
-#line 512 "smarty_internal_templateparser.y"
- function yy_r147(){$this->_retvalue = '&&'; }
-#line 2430 "smarty_internal_templateparser.php"
-#line 513 "smarty_internal_templateparser.y"
- function yy_r148(){$this->_retvalue = '||'; }
-#line 2433 "smarty_internal_templateparser.php"
-#line 514 "smarty_internal_templateparser.y"
- function yy_r149(){$this->_retvalue = ' XOR '; }
-#line 2436 "smarty_internal_templateparser.php"
-#line 519 "smarty_internal_templateparser.y"
- function yy_r150(){ $this->_retvalue = 'array('.$this->yystack[$this->yyidx + -1]->minor.')'; }
-#line 2439 "smarty_internal_templateparser.php"
-#line 521 "smarty_internal_templateparser.y"
- function yy_r152(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2442 "smarty_internal_templateparser.php"
-#line 522 "smarty_internal_templateparser.y"
- function yy_r153(){ return; }
-#line 2445 "smarty_internal_templateparser.php"
-#line 523 "smarty_internal_templateparser.y"
- function yy_r154(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2448 "smarty_internal_templateparser.php"
-#line 524 "smarty_internal_templateparser.y"
- function yy_r155(){ $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor; }
-#line 2451 "smarty_internal_templateparser.php"
-#line 533 "smarty_internal_templateparser.y"
- function yy_r159(){$this->_retvalue = '".'.$this->yystack[$this->yyidx + -1]->minor.'."'; $this->compiler->has_variable_string = true; }
-#line 2454 "smarty_internal_templateparser.php"
-#line 534 "smarty_internal_templateparser.y"
- function yy_r160(){$this->_retvalue = '".'.'$_smarty_tpl->getVariable(\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\')->value'.'."'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor,"'"))->nocache; $this->compiler->has_variable_string = true; }
-#line 2457 "smarty_internal_templateparser.php"
-#line 536 "smarty_internal_templateparser.y"
- function yy_r162(){ $this->_retvalue = '".('.$this->yystack[$this->yyidx + -1]->minor.')."'; $this->compiler->has_variable_string = true; }
-#line 2460 "smarty_internal_templateparser.php"
-#line 537 "smarty_internal_templateparser.y"
- function yy_r163(){ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php ob_start();?>'.$this->yystack[$this->yyidx + 0]->minor.'<?php $_tmp'.$this->prefix_number.'=ob_get_clean();?>'; $this->_retvalue = '".$_tmp'.$this->prefix_number.'."'; $this->compiler->has_variable_string = true; }
-#line 2463 "smarty_internal_templateparser.php"
-
- /**
- * placeholder for the left hand side in a reduce operation.
- *
- * For a parser with a rule like this:
- * <pre>
- * rule(A) ::= B. { A = 1; }
- * </pre>
- *
- * The parser will translate to something like:
- *
- * <code>
- * function yy_r0(){$this->_retvalue = 1;}
- * </code>
- */
- private $_retvalue;
-
- /**
- * Perform a reduce action and the shift that must immediately
- * follow the reduce.
- *
- * For a rule such as:
- *
- * <pre>
- * A ::= B blah C. { dosomething(); }
- * </pre>
- *
- * This function will first call the action, if any, ("dosomething();" in our
- * example), and then it will pop three states from the stack,
- * one for each entry on the right-hand side of the expression
- * (B, blah, and C in our example rule), and then push the result of the action
- * back on to the stack with the resulting state reduced to (as described in the .out
- * file)
- * @param int Number of the rule by which to reduce
- */
- function yy_reduce($yyruleno)
- {
- //int $yygoto; /* The next state */
- //int $yyact; /* The next action */
- //mixed $yygotominor; /* The LHS of the rule reduced */
- //TP_yyStackEntry $yymsp; /* The top of the parser's stack */
- //int $yysize; /* Amount to pop the stack */
- $yymsp = $this->yystack[$this->yyidx];
- if (self::$yyTraceFILE && $yyruleno >= 0
- && $yyruleno < count(self::$yyRuleName)) {
- fprintf(self::$yyTraceFILE, "%sReduce (%d) [%s].\n",
- self::$yyTracePrompt, $yyruleno,
- self::$yyRuleName[$yyruleno]);
- }
-
- $this->_retvalue = $yy_lefthand_side = null;
- if (array_key_exists($yyruleno, self::$yyReduceMap)) {
- // call the action
- $this->_retvalue = null;
- $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}();
- $yy_lefthand_side = $this->_retvalue;
- }
- $yygoto = self::$yyRuleInfo[$yyruleno]['lhs'];
- $yysize = self::$yyRuleInfo[$yyruleno]['rhs'];
- $this->yyidx -= $yysize;
- for($i = $yysize; $i; $i--) {
- // pop all of the right-hand side parameters
- array_pop($this->yystack);
- }
- $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto);
- if ($yyact < self::YYNSTATE) {
- /* If we are not debugging and the reduce action popped at least
- ** one element off the stack, then we can push the new element back
- ** onto the stack here, and skip the stack overflow test in yy_shift().
- ** That gives a significant speed improvement. */
- if (!self::$yyTraceFILE && $yysize) {
- $this->yyidx++;
- $x = new TP_yyStackEntry;
- $x->stateno = $yyact;
- $x->major = $yygoto;
- $x->minor = $yy_lefthand_side;
- $this->yystack[$this->yyidx] = $x;
- } else {
- $this->yy_shift($yyact, $yygoto, $yy_lefthand_side);
- }
- } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) {
- $this->yy_accept();
- }
- }
-
- /**
- * The following code executes when the parse fails
- *
- * Code from %parse_fail is inserted here
- */
- function yy_parse_failed()
- {
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sFail!\n", self::$yyTracePrompt);
- }
- while ($this->yyidx >= 0) {
- $this->yy_pop_parser_stack();
- }
- /* Here code is inserted which will be executed whenever the
- ** parser fails */
- }
-
- /**
- * The following code executes when a syntax error first occurs.
- *
- * %syntax_error code is inserted here
- * @param int The major type of the error token
- * @param mixed The minor type of the error token
- */
- function yy_syntax_error($yymajor, $TOKEN)
- {
-#line 60 "smarty_internal_templateparser.y"
-
- $this->internalError = true;
- $this->yymajor = $yymajor;
- $this->compiler->trigger_template_error();
-#line 2581 "smarty_internal_templateparser.php"
- }
-
- /**
- * The following is executed when the parser accepts
- *
- * %parse_accept code is inserted here
- */
- function yy_accept()
- {
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sAccept!\n", self::$yyTracePrompt);
- }
- while ($this->yyidx >= 0) {
- $stack = $this->yy_pop_parser_stack();
- }
- /* Here code is inserted which will be executed whenever the
- ** parser accepts */
-#line 52 "smarty_internal_templateparser.y"
-
- $this->successful = !$this->internalError;
- $this->internalError = false;
- $this->retvalue = $this->_retvalue;
- //echo $this->retvalue."\n\n";
-#line 2606 "smarty_internal_templateparser.php"
- }
-
- /**
- * The main parser program.
- *
- * The first argument is the major token number. The second is
- * the token value string as scanned from the input.
- *
- * @param int the token number
- * @param mixed the token value
- * @param mixed any extra arguments that should be passed to handlers
- */
- function doParse($yymajor, $yytokenvalue)
- {
-// $yyact; /* The parser action. */
-// $yyendofinput; /* True if we are at the end of input */
- $yyerrorhit = 0; /* True if yymajor has invoked an error */
-
- /* (re)initialize the parser, if necessary */
- if ($this->yyidx === null || $this->yyidx < 0) {
- /* if ($yymajor == 0) return; // not sure why this was here... */
- $this->yyidx = 0;
- $this->yyerrcnt = -1;
- $x = new TP_yyStackEntry;
- $x->stateno = 0;
- $x->major = 0;
- $this->yystack = array();
- array_push($this->yystack, $x);
- }
- $yyendofinput = ($yymajor==0);
-
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sInput %s\n",
- self::$yyTracePrompt, $this->yyTokenName[$yymajor]);
- }
-
- do {
- $yyact = $this->yy_find_shift_action($yymajor);
- if ($yymajor < self::YYERRORSYMBOL &&
- !$this->yy_is_expected_token($yymajor)) {
- // force a syntax error
- $yyact = self::YY_ERROR_ACTION;
- }
- if ($yyact < self::YYNSTATE) {
- $this->yy_shift($yyact, $yymajor, $yytokenvalue);
- $this->yyerrcnt--;
- if ($yyendofinput && $this->yyidx >= 0) {
- $yymajor = 0;
- } else {
- $yymajor = self::YYNOCODE;
- }
- } elseif ($yyact < self::YYNSTATE + self::YYNRULE) {
- $this->yy_reduce($yyact - self::YYNSTATE);
- } elseif ($yyact == self::YY_ERROR_ACTION) {
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sSyntax Error!\n",
- self::$yyTracePrompt);
- }
- if (self::YYERRORSYMBOL) {
- /* A syntax error has occurred.
- ** The response to an error depends upon whether or not the
- ** grammar defines an error token "ERROR".
- **
- ** This is what we do if the grammar does define ERROR:
- **
- ** * Call the %syntax_error function.
- **
- ** * Begin popping the stack until we enter a state where
- ** it is legal to shift the error symbol, then shift
- ** the error symbol.
- **
- ** * Set the error count to three.
- **
- ** * Begin accepting and shifting new tokens. No new error
- ** processing will occur until three tokens have been
- ** shifted successfully.
- **
- */
- if ($this->yyerrcnt < 0) {
- $this->yy_syntax_error($yymajor, $yytokenvalue);
- }
- $yymx = $this->yystack[$this->yyidx]->major;
- if ($yymx == self::YYERRORSYMBOL || $yyerrorhit ){
- if (self::$yyTraceFILE) {
- fprintf(self::$yyTraceFILE, "%sDiscard input token %s\n",
- self::$yyTracePrompt, $this->yyTokenName[$yymajor]);
- }
- $this->yy_destructor($yymajor, $yytokenvalue);
- $yymajor = self::YYNOCODE;
- } else {
- while ($this->yyidx >= 0 &&
- $yymx != self::YYERRORSYMBOL &&
- ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE
- ){
- $this->yy_pop_parser_stack();
- }
- if ($this->yyidx < 0 || $yymajor==0) {
- $this->yy_destructor($yymajor, $yytokenvalue);
- $this->yy_parse_failed();
- $yymajor = self::YYNOCODE;
- } elseif ($yymx != self::YYERRORSYMBOL) {
- $u2 = 0;
- $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2);
- }
- }
- $this->yyerrcnt = 3;
- $yyerrorhit = 1;
- } else {
- /* YYERRORSYMBOL is not defined */
- /* This is what we do if the grammar does not define ERROR:
- **
- ** * Report an error message, and throw away the input token.
- **
- ** * If the input token is $, then fail the parse.
- **
- ** As before, subsequent error messages are suppressed until
- ** three input tokens have been successfully shifted.
- */
- if ($this->yyerrcnt <= 0) {
- $this->yy_syntax_error($yymajor, $yytokenvalue);
- }
- $this->yyerrcnt = 3;
- $this->yy_destructor($yymajor, $yytokenvalue);
- if ($yyendofinput) {
- $this->yy_parse_failed();
- }
- $yymajor = self::YYNOCODE;
- }
- } else {
- $this->yy_accept();
- $yymajor = self::YYNOCODE;
- }
- } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0);
- }
-}
-?>
diff --git a/includes/Smarty/sysplugins/smarty_internal_utility.php b/includes/Smarty/sysplugins/smarty_internal_utility.php
new file mode 100755
index 0000000..3e36285
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_internal_utility.php
@@ -0,0 +1,830 @@
+<?php
+/**
+ * Project: Smarty: the PHP compiling template engine
+ * File: smarty_internal_utility.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/
+ * @copyright 2008 New Digital Group, Inc.
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author Uwe Tews
+ * @package Smarty
+ * @subpackage PluginsInternal
+ * @version 3-SVN$Rev: 3286 $
+ */
+
+
+/**
+ * Utility class
+ *
+ * @package Smarty
+ * @subpackage Security
+ */
+class Smarty_Internal_Utility {
+
+ /**
+ * private constructor to prevent calls creation of new instances
+ */
+ private final function __construct()
+ {
+ // intentionally left blank
+ }
+
+ /**
+ * Compile all template files
+ *
+ * @param string $extension template file name extension
+ * @param bool $force_compile force all to recompile
+ * @param int $time_limit set maximum execution time
+ * @param int $max_errors set maximum allowed errors
+ * @param Smarty $smarty Smarty instance
+ * @return integer number of template files compiled
+ */
+ public static function compileAllTemplates($extention, $force_compile, $time_limit, $max_errors, Smarty $smarty)
+ {
+ // switch off time limit
+ if (function_exists('set_time_limit')) {
+ @set_time_limit($time_limit);
+ }
+ $smarty->force_compile = $force_compile;
+ $_count = 0;
+ $_error_count = 0;
+ // loop over array of template directories
+ foreach($smarty->getTemplateDir() as $_dir) {
+ $_compileDirs = new RecursiveDirectoryIterator($_dir);
+ $_compile = new RecursiveIteratorIterator($_compileDirs);
+ foreach ($_compile as $_fileinfo) {
+ if (substr($_fileinfo->getBasename(),0,1) == '.' || strpos($_fileinfo, '.svn') !== false) continue;
+ $_file = $_fileinfo->getFilename();
+ if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue;
+ if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
+ $_template_file = $_file;
+ } else {
+ $_template_file = substr($_fileinfo->getPath(), strlen($_dir)) . DS . $_file;
+ }
+ echo '<br>', $_dir, '---', $_template_file;
+ flush();
+ $_start_time = microtime(true);
+ try {
+ $_tpl = $smarty->createTemplate($_template_file,null,null,null,false);
+ if ($_tpl->mustCompile()) {
+ $_tpl->compileTemplateSource();
+ $_count++;
+ echo ' compiled in ', microtime(true) - $_start_time, ' seconds';
+ flush();
+ } else {
+ echo ' is up to date';
+ flush();
+ }
+ }
+ catch (Exception $e) {
+ echo 'Error: ', $e->getMessage(), "<br><br>";
+ $_error_count++;
+ }
+ // free memory
+ $smarty->template_objects = array();
+ $_tpl->smarty->template_objects = array();
+ $_tpl = null;
+ if ($max_errors !== null && $_error_count == $max_errors) {
+ echo '<br><br>too many errors';
+ exit();
+ }
+ }
+ }
+ return $_count;
+ }
+
+ /**
+ * Compile all config files
+ *
+ * @param string $extension config file name extension
+ * @param bool $force_compile force all to recompile
+ * @param int $time_limit set maximum execution time
+ * @param int $max_errors set maximum allowed errors
+ * @param Smarty $smarty Smarty instance
+ * @return integer number of config files compiled
+ */
+ public static function compileAllConfig($extention, $force_compile, $time_limit, $max_errors, Smarty $smarty)
+ {
+ // switch off time limit
+ if (function_exists('set_time_limit')) {
+ @set_time_limit($time_limit);
+ }
+ $smarty->force_compile = $force_compile;
+ $_count = 0;
+ $_error_count = 0;
+ // loop over array of template directories
+ foreach($smarty->getConfigDir() as $_dir) {
+ $_compileDirs = new RecursiveDirectoryIterator($_dir);
+ $_compile = new RecursiveIteratorIterator($_compileDirs);
+ foreach ($_compile as $_fileinfo) {
+ if (substr($_fileinfo->getBasename(),0,1) == '.' || strpos($_fileinfo, '.svn') !== false) continue;
+ $_file = $_fileinfo->getFilename();
+ if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue;
+ if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
+ $_config_file = $_file;
+ } else {
+ $_config_file = substr($_fileinfo->getPath(), strlen($_dir)) . DS . $_file;
+ }
+ echo '<br>', $_dir, '---', $_config_file;
+ flush();
+ $_start_time = microtime(true);
+ try {
+ $_config = new Smarty_Internal_Config($_config_file, $smarty);
+ if ($_config->mustCompile()) {
+ $_config->compileConfigSource();
+ $_count++;
+ echo ' compiled in ', microtime(true) - $_start_time, ' seconds';
+ flush();
+ } else {
+ echo ' is up to date';
+ flush();
+ }
+ }
+ catch (Exception $e) {
+ echo 'Error: ', $e->getMessage(), "<br><br>";
+ $_error_count++;
+ }
+ if ($max_errors !== null && $_error_count == $max_errors) {
+ echo '<br><br>too many errors';
+ exit();
+ }
+ }
+ }
+ return $_count;
+ }
+
+ /**
+ * Delete compiled template file
+ *
+ * @param string $resource_name template name
+ * @param string $compile_id compile id
+ * @param integer $exp_time expiration time
+ * @param Smarty $smarty Smarty instance
+ * @return integer number of template files deleted
+ */
+ public static function clearCompiledTemplate($resource_name, $compile_id, $exp_time, Smarty $smarty)
+ {
+ $_compile_dir = $smarty->getCompileDir();
+ $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!', '_', $compile_id) : null;
+ $_dir_sep = $smarty->use_sub_dirs ? DS : '^';
+ if (isset($resource_name)) {
+ $_save_stat = $smarty->caching;
+ $smarty->caching = false;
+ $tpl = new $smarty->template_class($resource_name, $smarty);
+ $smarty->caching = $_save_stat;
+
+ // remove from template cache
+ $tpl->source; // have the template registered before unset()
+ if ($smarty->allow_ambiguous_resources) {
+ $_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
+ } else {
+ $_templateId = $smarty->joined_template_dir . '#' . $resource_name . $tpl->cache_id . $tpl->compile_id;
+ }
+ if (isset($_templateId[150])) {
+ $_templateId = sha1($_templateId);
+ }
+ unset($smarty->template_objects[$_templateId]);
+
+ if ($tpl->source->exists) {
+ $_resource_part_1 = basename(str_replace('^', '/', $tpl->compiled->filepath));
+ $_resource_part_1_length = strlen($_resource_part_1);
+ } else {
+ return 0;
+ }
+
+ $_resource_part_2 = str_replace('.php','.cache.php',$_resource_part_1);
+ $_resource_part_2_length = strlen($_resource_part_2);
+ }
+ $_dir = $_compile_dir;
+ if ($smarty->use_sub_dirs && isset($_compile_id)) {
+ $_dir .= $_compile_id . $_dir_sep;
+ }
+ if (isset($_compile_id)) {
+ $_compile_id_part = $_compile_dir . $_compile_id . $_dir_sep;
+ $_compile_id_part_length = strlen($_compile_id_part);
+ }
+ $_count = 0;
+ try {
+ $_compileDirs = new RecursiveDirectoryIterator($_dir);
+ // NOTE: UnexpectedValueException thrown for PHP >= 5.3
+ } catch (Exception $e) {
+ return 0;
+ }
+ $_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST);
+ foreach ($_compile as $_file) {
+ if (substr($_file->getBasename(), 0, 1) == '.' || strpos($_file, '.svn') !== false)
+ continue;
+
+ $_filepath = (string) $_file;
+
+ if ($_file->isDir()) {
+ if (!$_compile->isDot()) {
+ // delete folder if empty
+ @rmdir($_file->getPathname());
+ }
+ } else {
+ $unlink = false;
+ if ((!isset($_compile_id) || (isset($_filepath[$_compile_id_part_length]) && !strncmp($_filepath, $_compile_id_part, $_compile_id_part_length)))
+ && (!isset($resource_name)
+ || (isset($_filepath[$_resource_part_1_length])
+ && substr_compare($_filepath, $_resource_part_1, -$_resource_part_1_length, $_resource_part_1_length) == 0)
+ || (isset($_filepath[$_resource_part_2_length])
+ && substr_compare($_filepath, $_resource_part_2, -$_resource_part_2_length, $_resource_part_2_length) == 0))) {
+ if (isset($exp_time)) {
+ if (time() - @filemtime($_filepath) >= $exp_time) {
+ $unlink = true;
+ }
+ } else {
+ $unlink = true;
+ }
+ }
+
+ if ($unlink && @unlink($_filepath)) {
+ $_count++;
+ }
+ }
+ }
+ // clear compiled cache
+ Smarty_Resource::$sources = array();
+ Smarty_Resource::$compileds = array();
+ return $_count;
+ }
+
+ /**
+ * Return array of tag/attributes of all tags used by an template
+ *
+ * @param Smarty_Internal_Template $templae template object
+ * @return array of tag/attributes
+ */
+ public static function getTags(Smarty_Internal_Template $template)
+ {
+ $template->smarty->get_used_tags = true;
+ $template->compileTemplateSource();
+ return $template->used_tags;
+ }
+
+
+ /**
+ * diagnose Smarty setup
+ *
+ * If $errors is secified, the diagnostic report will be appended to the array, rather than being output.
+ *
+ * @param Smarty $smarty Smarty instance to test
+ * @param array $errors array to push results into rather than outputting them
+ * @return bool status, true if everything is fine, false else
+ */
+ public static function testInstall(Smarty $smarty, &$errors=null)
+ {
+ $status = true;
+
+ if ($errors === null) {
+ echo "<PRE>\n";
+ echo "Smarty Installation test...\n";
+ echo "Testing template directory...\n";
+ }
+
+ $_stream_resolve_include_path = function_exists('stream_resolve_include_path');
+
+ // test if all registered template_dir are accessible
+ foreach($smarty->getTemplateDir() as $template_dir) {
+ $_template_dir = $template_dir;
+ $template_dir = realpath($template_dir);
+ // resolve include_path or fail existance
+ if (!$template_dir) {
+ if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_template_dir)) {
+ // try PHP include_path
+ if ($_stream_resolve_include_path) {
+ $template_dir = stream_resolve_include_path($_template_dir);
+ } else {
+ $template_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_template_dir);
+ }
+
+ if ($template_dir !== false) {
+ if ($errors === null) {
+ echo "$template_dir is OK.\n";
+ }
+
+ continue;
+ } else {
+ $status = false;
+ $message = "FAILED: $_template_dir does not exist (and couldn't be found in include_path either)";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['template_dir'] = $message;
+ }
+
+ continue;
+ }
+ } else {
+ $status = false;
+ $message = "FAILED: $_template_dir does not exist";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['template_dir'] = $message;
+ }
+
+ continue;
+ }
+ }
+
+ if (!is_dir($template_dir)) {
+ $status = false;
+ $message = "FAILED: $template_dir is not a directory";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['template_dir'] = $message;
+ }
+ } elseif (!is_readable($template_dir)) {
+ $status = false;
+ $message = "FAILED: $template_dir is not readable";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['template_dir'] = $message;
+ }
+ } else {
+ if ($errors === null) {
+ echo "$template_dir is OK.\n";
+ }
+ }
+ }
+
+
+ if ($errors === null) {
+ echo "Testing compile directory...\n";
+ }
+
+ // test if registered compile_dir is accessible
+ $__compile_dir = $smarty->getCompileDir();
+ $_compile_dir = realpath($__compile_dir);
+ if (!$_compile_dir) {
+ $status = false;
+ $message = "FAILED: {$__compile_dir} does not exist";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['compile_dir'] = $message;
+ }
+ } elseif (!is_dir($_compile_dir)) {
+ $status = false;
+ $message = "FAILED: {$_compile_dir} is not a directory";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['compile_dir'] = $message;
+ }
+ } elseif (!is_readable($_compile_dir)) {
+ $status = false;
+ $message = "FAILED: {$_compile_dir} is not readable";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['compile_dir'] = $message;
+ }
+ } elseif (!is_writable($_compile_dir)) {
+ $status = false;
+ $message = "FAILED: {$_compile_dir} is not writable";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['compile_dir'] = $message;
+ }
+ } else {
+ if ($errors === null) {
+ echo "{$_compile_dir} is OK.\n";
+ }
+ }
+
+
+ if ($errors === null) {
+ echo "Testing plugins directory...\n";
+ }
+
+ // test if all registered plugins_dir are accessible
+ // and if core plugins directory is still registered
+ $_core_plugins_dir = realpath(dirname(__FILE__) .'/../plugins');
+ $_core_plugins_available = false;
+ foreach($smarty->getPluginsDir() as $plugin_dir) {
+ $_plugin_dir = $plugin_dir;
+ $plugin_dir = realpath($plugin_dir);
+ // resolve include_path or fail existance
+ if (!$plugin_dir) {
+ if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) {
+ // try PHP include_path
+ if ($_stream_resolve_include_path) {
+ $plugin_dir = stream_resolve_include_path($_plugin_dir);
+ } else {
+ $plugin_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_plugin_dir);
+ }
+
+ if ($plugin_dir !== false) {
+ if ($errors === null) {
+ echo "$plugin_dir is OK.\n";
+ }
+
+ continue;
+ } else {
+ $status = false;
+ $message = "FAILED: $_plugin_dir does not exist (and couldn't be found in include_path either)";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['plugins_dir'] = $message;
+ }
+
+ continue;
+ }
+ } else {
+ $status = false;
+ $message = "FAILED: $_plugin_dir does not exist";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['plugins_dir'] = $message;
+ }
+
+ continue;
+ }
+ }
+
+ if (!is_dir($plugin_dir)) {
+ $status = false;
+ $message = "FAILED: $plugin_dir is not a directory";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['plugins_dir'] = $message;
+ }
+ } elseif (!is_readable($plugin_dir)) {
+ $status = false;
+ $message = "FAILED: $plugin_dir is not readable";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['plugins_dir'] = $message;
+ }
+ } elseif ($_core_plugins_dir && $_core_plugins_dir == realpath($plugin_dir)) {
+ $_core_plugins_available = true;
+ if ($errors === null) {
+ echo "$plugin_dir is OK.\n";
+ }
+ } else {
+ if ($errors === null) {
+ echo "$plugin_dir is OK.\n";
+ }
+ }
+ }
+ if (!$_core_plugins_available) {
+ $status = false;
+ $message = "WARNING: Smarty's own libs/plugins is not available";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } elseif (!isset($errors['plugins_dir'])) {
+ $errors['plugins_dir'] = $message;
+ }
+ }
+
+ if ($errors === null) {
+ echo "Testing cache directory...\n";
+ }
+
+
+ // test if all registered cache_dir is accessible
+ $__cache_dir = $smarty->getCacheDir();
+ $_cache_dir = realpath($__cache_dir);
+ if (!$_cache_dir) {
+ $status = false;
+ $message = "FAILED: {$__cache_dir} does not exist";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['cache_dir'] = $message;
+ }
+ } elseif (!is_dir($_cache_dir)) {
+ $status = false;
+ $message = "FAILED: {$_cache_dir} is not a directory";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['cache_dir'] = $message;
+ }
+ } elseif (!is_readable($_cache_dir)) {
+ $status = false;
+ $message = "FAILED: {$_cache_dir} is not readable";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['cache_dir'] = $message;
+ }
+ } elseif (!is_writable($_cache_dir)) {
+ $status = false;
+ $message = "FAILED: {$_cache_dir} is not writable";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['cache_dir'] = $message;
+ }
+ } else {
+ if ($errors === null) {
+ echo "{$_cache_dir} is OK.\n";
+ }
+ }
+
+
+ if ($errors === null) {
+ echo "Testing configs directory...\n";
+ }
+
+ // test if all registered config_dir are accessible
+ foreach($smarty->getConfigDir() as $config_dir) {
+ $_config_dir = $config_dir;
+ $config_dir = realpath($config_dir);
+ // resolve include_path or fail existance
+ if (!$config_dir) {
+ if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_config_dir)) {
+ // try PHP include_path
+ if ($_stream_resolve_include_path) {
+ $config_dir = stream_resolve_include_path($_config_dir);
+ } else {
+ $config_dir = Smarty_Internal_Get_Include_Path::getIncludePath($_config_dir);
+ }
+
+ if ($config_dir !== false) {
+ if ($errors === null) {
+ echo "$config_dir is OK.\n";
+ }
+
+ continue;
+ } else {
+ $status = false;
+ $message = "FAILED: $_config_dir does not exist (and couldn't be found in include_path either)";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['config_dir'] = $message;
+ }
+
+ continue;
+ }
+ } else {
+ $status = false;
+ $message = "FAILED: $_config_dir does not exist";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['config_dir'] = $message;
+ }
+
+ continue;
+ }
+ }
+
+ if (!is_dir($config_dir)) {
+ $status = false;
+ $message = "FAILED: $config_dir is not a directory";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['config_dir'] = $message;
+ }
+ } elseif (!is_readable($config_dir)) {
+ $status = false;
+ $message = "FAILED: $config_dir is not readable";
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['config_dir'] = $message;
+ }
+ } else {
+ if ($errors === null) {
+ echo "$config_dir is OK.\n";
+ }
+ }
+ }
+
+
+ if ($errors === null) {
+ echo "Testing sysplugin files...\n";
+ }
+ // test if sysplugins are available
+ $source = SMARTY_SYSPLUGINS_DIR;
+ if (is_dir($source)) {
+ $expected = array(
+ "smarty_cacheresource.php" => true,
+ "smarty_cacheresource_custom.php" => true,
+ "smarty_cacheresource_keyvaluestore.php" => true,
+ "smarty_config_source.php" => true,
+ "smarty_internal_cacheresource_file.php" => true,
+ "smarty_internal_compile_append.php" => true,
+ "smarty_internal_compile_assign.php" => true,
+ "smarty_internal_compile_block.php" => true,
+ "smarty_internal_compile_break.php" => true,
+ "smarty_internal_compile_call.php" => true,
+ "smarty_internal_compile_capture.php" => true,
+ "smarty_internal_compile_config_load.php" => true,
+ "smarty_internal_compile_continue.php" => true,
+ "smarty_internal_compile_debug.php" => true,
+ "smarty_internal_compile_eval.php" => true,
+ "smarty_internal_compile_extends.php" => true,
+ "smarty_internal_compile_for.php" => true,
+ "smarty_internal_compile_foreach.php" => true,
+ "smarty_internal_compile_function.php" => true,
+ "smarty_internal_compile_if.php" => true,
+ "smarty_internal_compile_include.php" => true,
+ "smarty_internal_compile_include_php.php" => true,
+ "smarty_internal_compile_insert.php" => true,
+ "smarty_internal_compile_ldelim.php" => true,
+ "smarty_internal_compile_nocache.php" => true,
+ "smarty_internal_compile_private_block_plugin.php" => true,
+ "smarty_internal_compile_private_function_plugin.php" => true,
+ "smarty_internal_compile_private_modifier.php" => true,
+ "smarty_internal_compile_private_object_block_function.php" => true,
+ "smarty_internal_compile_private_object_function.php" => true,
+ "smarty_internal_compile_private_print_expression.php" => true,
+ "smarty_internal_compile_private_registered_block.php" => true,
+ "smarty_internal_compile_private_registered_function.php" => true,
+ "smarty_internal_compile_private_special_variable.php" => true,
+ "smarty_internal_compile_rdelim.php" => true,
+ "smarty_internal_compile_section.php" => true,
+ "smarty_internal_compile_setfilter.php" => true,
+ "smarty_internal_compile_while.php" => true,
+ "smarty_internal_compilebase.php" => true,
+ "smarty_internal_config.php" => true,
+ "smarty_internal_config_file_compiler.php" => true,
+ "smarty_internal_configfilelexer.php" => true,
+ "smarty_internal_configfileparser.php" => true,
+ "smarty_internal_data.php" => true,
+ "smarty_internal_debug.php" => true,
+ "smarty_internal_filter_handler.php" => true,
+ "smarty_internal_function_call_handler.php" => true,
+ "smarty_internal_get_include_path.php" => true,
+ "smarty_internal_nocache_insert.php" => true,
+ "smarty_internal_parsetree.php" => true,
+ "smarty_internal_resource_eval.php" => true,
+ "smarty_internal_resource_extends.php" => true,
+ "smarty_internal_resource_file.php" => true,
+ "smarty_internal_resource_registered.php" => true,
+ "smarty_internal_resource_stream.php" => true,
+ "smarty_internal_resource_string.php" => true,
+ "smarty_internal_smartytemplatecompiler.php" => true,
+ "smarty_internal_template.php" => true,
+ "smarty_internal_templatebase.php" => true,
+ "smarty_internal_templatecompilerbase.php" => true,
+ "smarty_internal_templatelexer.php" => true,
+ "smarty_internal_templateparser.php" => true,
+ "smarty_internal_utility.php" => true,
+ "smarty_internal_write_file.php" => true,
+ "smarty_resource.php" => true,
+ "smarty_resource_custom.php" => true,
+ "smarty_resource_recompiled.php" => true,
+ "smarty_resource_uncompiled.php" => true,
+ "smarty_security.php" => true,
+ );
+ $iterator = new DirectoryIterator($source);
+ foreach ($iterator as $file) {
+ if (!$file->isDot()) {
+ $filename = $file->getFilename();
+ if (isset($expected[$filename])) {
+ unset($expected[$filename]);
+ }
+ }
+ }
+ if ($expected) {
+ $status = false;
+ $message = "FAILED: files missing from libs/sysplugins: ". join(', ', array_keys($expected));
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['sysplugins'] = $message;
+ }
+ } elseif ($errors === null) {
+ echo "... OK\n";
+ }
+ } else {
+ $status = false;
+ $message = "FAILED: ". SMARTY_SYSPLUGINS_DIR .' is not a directory';
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['sysplugins_dir_constant'] = $message;
+ }
+ }
+
+ if ($errors === null) {
+ echo "Testing plugin files...\n";
+ }
+ // test if core plugins are available
+ $source = SMARTY_PLUGINS_DIR;
+ if (is_dir($source)) {
+ $expected = array(
+ "block.textformat.php" => true,
+ "function.counter.php" => true,
+ "function.cycle.php" => true,
+ "function.fetch.php" => true,
+ "function.html_checkboxes.php" => true,
+ "function.html_image.php" => true,
+ "function.html_options.php" => true,
+ "function.html_radios.php" => true,
+ "function.html_select_date.php" => true,
+ "function.html_select_time.php" => true,
+ "function.html_table.php" => true,
+ "function.mailto.php" => true,
+ "function.math.php" => true,
+ "modifier.capitalize.php" => true,
+ "modifier.date_format.php" => true,
+ "modifier.debug_print_var.php" => true,
+ "modifier.escape.php" => true,
+ "modifier.regex_replace.php" => true,
+ "modifier.replace.php" => true,
+ "modifier.spacify.php" => true,
+ "modifier.truncate.php" => true,
+ "modifiercompiler.cat.php" => true,
+ "modifiercompiler.count_characters.php" => true,
+ "modifiercompiler.count_paragraphs.php" => true,
+ "modifiercompiler.count_sentences.php" => true,
+ "modifiercompiler.count_words.php" => true,
+ "modifiercompiler.default.php" => true,
+ "modifiercompiler.escape.php" => true,
+ "modifiercompiler.from_charset.php" => true,
+ "modifiercompiler.indent.php" => true,
+ "modifiercompiler.lower.php" => true,
+ "modifiercompiler.noprint.php" => true,
+ "modifiercompiler.string_format.php" => true,
+ "modifiercompiler.strip.php" => true,
+ "modifiercompiler.strip_tags.php" => true,
+ "modifiercompiler.to_charset.php" => true,
+ "modifiercompiler.unescape.php" => true,
+ "modifiercompiler.upper.php" => true,
+ "modifiercompiler.wordwrap.php" => true,
+ "outputfilter.trimwhitespace.php" => true,
+ "shared.escape_special_chars.php" => true,
+ "shared.literal_compiler_param.php" => true,
+ "shared.make_timestamp.php" => true,
+ "shared.mb_str_replace.php" => true,
+ "shared.mb_unicode.php" => true,
+ "shared.mb_wordwrap.php" => true,
+ "variablefilter.htmlspecialchars.php" => true,
+ );
+ $iterator = new DirectoryIterator($source);
+ foreach ($iterator as $file) {
+ if (!$file->isDot()) {
+ $filename = $file->getFilename();
+ if (isset($expected[$filename])) {
+ unset($expected[$filename]);
+ }
+ }
+ }
+ if ($expected) {
+ $status = false;
+ $message = "FAILED: files missing from libs/plugins: ". join(', ', array_keys($expected));
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['plugins'] = $message;
+ }
+ } elseif ($errors === null) {
+ echo "... OK\n";
+ }
+ } else {
+ $status = false;
+ $message = "FAILED: ". SMARTY_PLUGINS_DIR .' is not a directory';
+ if ($errors === null) {
+ echo $message . ".\n";
+ } else {
+ $errors['plugins_dir_constant'] = $message;
+ }
+ }
+
+ if ($errors === null) {
+ echo "Tests complete.\n";
+ echo "</PRE>\n";
+ }
+
+ return $status;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_internal_write_file.php b/includes/Smarty/sysplugins/smarty_internal_write_file.php
deleted file mode 100644
index 437053b..0000000
--- a/includes/Smarty/sysplugins/smarty_internal_write_file.php
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-
-/**
-* Smarty write file plugin
-*
-* @package Smarty
-* @subpackage PluginsInternal
-* @author Monte Ohrt
-*/
-/**
-* Smarty Internal Write File Class
-*/
-class Smarty_Internal_Write_File {
- /**
- * Writes file in a save way to disk
- *
- * @param string $_filepath complete filepath
- * @param string $_contents file content
- * @return boolean true
- */
- public static function writeFile($_filepath, $_contents, $smarty)
- {
- $old_umask = umask(0);
- $_dirpath = dirname($_filepath);
- // if subdirs, create dir structure
- if ($_dirpath !== '.' && !file_exists($_dirpath)) {
- mkdir($_dirpath, $smarty->_dir_perms, true);
- }
- // write to tmp file, then move to overt file lock race condition
- $_tmp_file = tempnam($_dirpath, 'wrt');
-
- if (!file_put_contents($_tmp_file, $_contents)) {
- umask($old_umask);
- throw new Exception("unable to write file {$_tmp_file}");
- return false;
- }
- // remove original file
- if (file_exists($_filepath))
- unlink($_filepath);
- // rename tmp file
- rename($_tmp_file, $_filepath);
- // set file permissions
- chmod($_filepath, $smarty->_file_perms);
- umask($old_umask);
- return true;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method__get_filter_name.php b/includes/Smarty/sysplugins/smarty_method__get_filter_name.php
deleted file mode 100644
index 9bc18fb..0000000
--- a/includes/Smarty/sysplugins/smarty_method__get_filter_name.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-/**
-* Smarty method _get_filter_name
-*
-* Return internal filter name
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Return internal filter name
-*
-* @param object $smarty
-* @param callback $function
-*/
-function Smarty_Method__get_filter_name($smarty, $function)
-{
- if (is_array($function)) {
- $_class_name = (is_object($function[0]) ?
- get_class($function[0]) : $function[0]);
- return $_class_name . '_' . $function[1];
- }
- else {
- return $function;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_addpluginsdir.php b/includes/Smarty/sysplugins/smarty_method_addpluginsdir.php
deleted file mode 100644
index 24eb113..0000000
--- a/includes/Smarty/sysplugins/smarty_method_addpluginsdir.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
-* Smarty method addPluginsDir
-*
-* Adds directory of plugin files
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Adds directory of plugin files
-*
-* @param object $smarty
-* @param string $ |array $ plugins folder
-* @return
-*/
-function Smarty_Method_AddPluginsDir($smarty, $plugins_dir)
-{
- $smarty->plugins_dir = array_merge((array)$smarty->plugins_dir, (array)$plugins_dir);
- $smarty->plugins_dir = array_unique($smarty->plugins_dir);
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_clear_all_assign.php b/includes/Smarty/sysplugins/smarty_method_clear_all_assign.php
deleted file mode 100644
index 9809f03..0000000
--- a/includes/Smarty/sysplugins/smarty_method_clear_all_assign.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-/**
-* Smarty method Clear_All_Assign
-*
-* Deletes all assigned Smarty variables at current level
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Delete Smarty variables
-*
-* @param object $smarty
-* @param object $data_object object which holds tpl_vars
-*/
-function Smarty_Method_Clear_All_Assign($smarty, $data_object = null)
-{
- if (isset($data_object)) {
- $ptr = $data_object;
- } else {
- $ptr = $smarty;
- }
- $ptr->tpl_vars = array();
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_clear_all_cache.php b/includes/Smarty/sysplugins/smarty_method_clear_all_cache.php
deleted file mode 100644
index ca7dd01..0000000
--- a/includes/Smarty/sysplugins/smarty_method_clear_all_cache.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-/**
-* Smarty method Clear_All_Cache
-*
-* Empties the cache folder
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Empty cache folder
-*
-* @param object $smarty
-* @param integer $exp_time expiration time
-* @param string $type resource type
-* @return integer number of cache files deleted
-*/
-function Smarty_Method_Clear_All_Cache($smarty, $exp_time = null, $type = 'file')
-{
- // load cache resource
- if (!isset($smarty->cache_resource_objects[$type])) {
- $_cache_resource_class = 'Smarty_Internal_CacheResource_' . $type;
- if (!$smarty->loadPlugin($_cache_resource_class)) {
- throw new Exception("Undefined cache resource type {$type}");
- }
- $smarty->cache_resource_objects[$type] = new $_cache_resource_class($smarty);
- }
-
- return $smarty->cache_resource_objects[$type]->clearAll($exp_time);
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_clear_assign.php b/includes/Smarty/sysplugins/smarty_method_clear_assign.php
deleted file mode 100644
index 1f1fe0b..0000000
--- a/includes/Smarty/sysplugins/smarty_method_clear_assign.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-/**
-* Smarty method Clear_Assign
-*
-* Deletes a assigned Smarty variable or array of variables at current level
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Delete a Smarty variable or array of variables
-*
-* @param object $smarty
-* @param string $ |array $varname variable name or array of variable names
-* @param object $data_object object which holds tpl_vars
-*/
-function Smarty_Method_Clear_Assign($smarty, $varname, $data_object = null)
-{
- foreach ((array)$varname as $variable) {
- if (isset($data_object)) {
- $ptr = $data_object;
- } else {
- $ptr = $smarty;
- } while ($ptr != null) {
- if (isset($ptr->tpl_vars[$variable])) {
- unset($ptr->tpl_vars[$variable]);
- }
- $ptr = $ptr->parent;
- }
- }
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_clear_cache.php b/includes/Smarty/sysplugins/smarty_method_clear_cache.php
deleted file mode 100644
index c84edd0..0000000
--- a/includes/Smarty/sysplugins/smarty_method_clear_cache.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-
-/**
-* Smarty method Clear_Cache
-*
-* Empties the cache for a specific template
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Empty cache for a specific template
-*
-* @param object $smarty
-* @param string $template_name template name
-* @param string $cache_id cache id
-* @param string $compile_id compile id
-* @param integer $exp_time expiration time
-* @param string $type resource type
-* @return integer number of cache files deleted
-*/
-function Smarty_Method_Clear_Cache($smarty, $template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = 'file')
-{
- // load cache resource
- $_cache_resource_class = 'Smarty_Internal_CacheResource_' . $type;
- if (!$smarty->loadPlugin($_cache_resource_class)) {
- throw new Exception("Undefined cache resource type {$type}");
- }
- $cache_object = new $_cache_resource_class($smarty);
-
- return $cache_object->clear($template_name, $cache_id, $compile_id, $exp_time);
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_clear_compiled_tpl.php b/includes/Smarty/sysplugins/smarty_method_clear_compiled_tpl.php
deleted file mode 100644
index 4f53d61..0000000
--- a/includes/Smarty/sysplugins/smarty_method_clear_compiled_tpl.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-
-/**
-* Smarty method Clear_Compiled_Tpl
-*
-* Deletes compiled template files
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Delete compiled template file
-*
-* @param string $resource_name template name
-* @param string $compile_id compile id
-* @param integer $exp_time expiration time
-* @return integer number of template files deleted
-*/
-function Smarty_Method_Clear_Compiled_Tpl($smarty, $resource_name = null, $compile_id = null, $exp_time = null)
-{
- $_compile_id = isset($compile_id) ? preg_replace('![^\w\|]+!','_',$compile_id) : null;
- $_dir_sep = $smarty->use_sub_dirs ? DS : '^';
- if (isset($resource_name)) {
- $_resource_part_1 = $resource_name . '.php';
- $_resource_part_2 = $resource_name . '.cache' . '.php';
- } else {
- $_resource_part = '';
- }
- $_dir = $smarty->compile_dir;
- if ($smarty->use_sub_dirs && isset($_compile_id)) {
- $_dir .= $_compile_id . $_dir_sep;
- }
- if (isset($_compile_id)) {
- $_compile_id_part = $smarty->compile_dir . $_compile_id . $_dir_sep;
- }
- $_count = 0;
- $_compileDirs = new RecursiveDirectoryIterator($_dir);
- $_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST);
- foreach ($_compile as $_file) {
- if (strpos($_file, '.svn') !== false) continue;
- if ($_file->isDir()) {
- if (!$_compile->isDot()) {
- // delete folder if empty
- @rmdir($_file->getPathname());
- }
- } else {
- if ((!isset($_compile_id) || substr_compare((string)$_file, $_compile_id_part, 0, strlen($_compile_id_part)) == 0) &&
- (!isset($resource_name) || substr_compare((string)$_file, $_resource_part_1, - strlen($_resource_part_1), strlen($_resource_part_1)) == 0 ||
- substr_compare((string)$_file, $_resource_part_2, - strlen($_resource_part_2), strlen($_resource_part_2)) == 0)) {
- if (isset($exp_time)) {
- if (time() - @filemtime($_file) >= $exp_time) {
- $_count += unlink((string) $_file) ? 1 : 0;
- }
- } else {
- $_count += unlink((string) $_file) ? 1 : 0;
- }
- }
- }
- }
- return $_count;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_clear_config.php b/includes/Smarty/sysplugins/smarty_method_clear_config.php
deleted file mode 100644
index 3c752e0..0000000
--- a/includes/Smarty/sysplugins/smarty_method_clear_config.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-
-/**
-* Smarty method Get_Config_Vars
-*
-* Returns a single or all global config variables
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Deassigns a single or all global config variables
-*
-* @param object $smarty
-* @param string $varname variable name or null
-*/
-function Smarty_Method_Clear_Config($smarty, $varname = null)
-{
- if (isset($varname)) {
- unset($smarty->config_vars[$varname]);
- return;
- } else {
- $smarty->config_vars = array();
- return;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_compile_directory.php b/includes/Smarty/sysplugins/smarty_method_compile_directory.php
deleted file mode 100644
index 48ffff7..0000000
--- a/includes/Smarty/sysplugins/smarty_method_compile_directory.php
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-
-/**
-* Smarty method compile_dir
-*
-* Compiles all template files in an given directory
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Compile all template files
-*
-* @param string $dir_name name of directories
-* @return integer number of template files deleted
-*/
-function Smarty_Method_Compile_Directory($smarty, $extention = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null)
-{
- function _get_time()
- {
- $_mtime = microtime();
- $_mtime = explode(" ", $_mtime);
- return (double)($_mtime[1]) + (double)($_mtime[0]);
- }
- // set default directory
- if ($dir_name === null) {
- $dir_name = $smarty->template_dir;
- }
- // switch off time limit
- if (function_exists('set_time_limit')) {
- @set_time_limit($time_limit);
- }
- $smarty->force_compile = $force_compile;
- $_count = 0;
- $_error_count = 0;
- // loop over array of template directories
- foreach((array)$smarty->template_dir as $_dir) {
- $_compileDirs = new RecursiveDirectoryIterator($_dir);
- $_compile = new RecursiveIteratorIterator($_compileDirs);
- foreach ($_compile as $_fileinfo) {
- if (strpos($_fileinfo, '.svn') !== false) continue;
- $_file = $_fileinfo->getFilename();
- if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue;
- if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
- $_template_file = $_file;
- } else {
- $_template_file = substr($_fileinfo->getPath(), strlen($_dir)) . '\\' . $_file;
- }
- echo '<br>', $_dir, '---', $_template_file;
- flush();
- $_start_time = _get_time();
- try {
- $_tpl = $smarty->createTemplate($_template_file);
- $_tpl->getCompiledTemplate();
- }
- catch (Exception $e) {
- echo 'Error: ', $e->getMessage(), "<br><br>";
- $_error_count++;
- }
- echo ' done in ', _get_time() - $_start_time, ' seconds';
- if ($max_errors !== null && $_error_count == $max_errors) {
- echo '<br><br>too many errors';
- exit();
- }
- }
- }
- return $_count;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_disablecachemodifycheck.php b/includes/Smarty/sysplugins/smarty_method_disablecachemodifycheck.php
deleted file mode 100644
index aac8fab..0000000
--- a/includes/Smarty/sysplugins/smarty_method_disablecachemodifycheck.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-
-/**
-* Smarty method DisableCacheModifyCheck
-*
-* Disable cache modify check
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-*
-* Disable cache modify check
-*/
-function Smarty_Method_DisableCacheModifyCheck($smarty)
- {
- $smarty->cache_modified_check = false;
- return ;
- }
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_disablecaching.php b/includes/Smarty/sysplugins/smarty_method_disablecaching.php
deleted file mode 100644
index ba5097a..0000000
--- a/includes/Smarty/sysplugins/smarty_method_disablecaching.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
-* Smarty method DisableCaching
-*
-* Disable caching
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Disable caching
-*/
-function Smarty_Method_DisableCaching()
-{
- $this->smarty->caching = false;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_disablecompilecheck.php b/includes/Smarty/sysplugins/smarty_method_disablecompilecheck.php
deleted file mode 100644
index f18514f..0000000
--- a/includes/Smarty/sysplugins/smarty_method_disablecompilecheck.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-
-/**
-* Smarty method DisableCompileCheck
-*
-* Disable compile checking
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Disable compile checking
-*
-* @param object $smarty
-*/
-function Smarty_Method_DisableCompileCheck($smarty)
-{
- $smarty->compile_check = false;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_disableconfigbooleanize.php b/includes/Smarty/sysplugins/smarty_method_disableconfigbooleanize.php
deleted file mode 100644
index fa7a434..0000000
--- a/includes/Smarty/sysplugins/smarty_method_disableconfigbooleanize.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
-* Smarty method DisableConfigBooleanize
-*
-* Disable config booleanize mode
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Disable config booleanize mode
-*/
-function Smarty_Method_DisableConfigBooleanize($smarty)
-{
- $this->smarty->config_booleanize = false;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_disableconfigoverwrite.php b/includes/Smarty/sysplugins/smarty_method_disableconfigoverwrite.php
deleted file mode 100644
index d37cea4..0000000
--- a/includes/Smarty/sysplugins/smarty_method_disableconfigoverwrite.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
-* Smarty method DisableConfigOverwrite
-*
-* Disable config overwrite mode
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Disable config overwrite mode
-*/
-function Smarty_Method_DisableConfigOverwrite($smarty)
-{
- $smarty->config_overwrite = false;
- return ;
-}
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_disableconfigreadhidden.php b/includes/Smarty/sysplugins/smarty_method_disableconfigreadhidden.php
deleted file mode 100644
index e5001d6..0000000
--- a/includes/Smarty/sysplugins/smarty_method_disableconfigreadhidden.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
-* Smarty method DisableConfigReadHidden
-*
-* Disable config read hidden mode
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Disable config read hidden mode
-*/
-function Smarty_Method_DisableConfigReadHidden ($smarty)
-{
- $this->smarty->config_read_hidden = false;
- return;
-}
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_disabledebugging.php b/includes/Smarty/sysplugins/smarty_method_disabledebugging.php
deleted file mode 100644
index 3cfccd7..0000000
--- a/includes/Smarty/sysplugins/smarty_method_disabledebugging.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
-* Smarty method DisableDebugging
-*
-* Disable debugging
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Disable debugging
-*/
-function Smarty_Method_DisableDebugging($smarty)
-{
- $smarty->debugging = false;
- return;
-}
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_disabledebuggingurlctrl.php b/includes/Smarty/sysplugins/smarty_method_disabledebuggingurlctrl.php
deleted file mode 100644
index fa149db..0000000
--- a/includes/Smarty/sysplugins/smarty_method_disabledebuggingurlctrl.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
-* Smarty method DisableDebuggingUrlCtrl
-*
-* Disable possibility to Disable debugging by SMARTY_DEBUG attribute
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Disable possibility to Disable debugging by SMARTY_DEBUG attribute
-*/
-function Smarty_Method_DisableDebuggingUrlCtrl($smarty)
- {
- $smarty->debugging_ctrl = 'none';
- return;
- }
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_disabledefaulttimezone.php b/includes/Smarty/sysplugins/smarty_method_disabledefaulttimezone.php
deleted file mode 100644
index 3aef9cb..0000000
--- a/includes/Smarty/sysplugins/smarty_method_disabledefaulttimezone.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
-* Smarty method DisableDefaultTimezone
-*
-* Disable setting of default timezone
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Disable setting of default timezone
-*/
-function Smarty_Method_DisableDefaultTimezone($smarty)
-{
- $smarty->set_timezone = false;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_disableforcecompile.php b/includes/Smarty/sysplugins/smarty_method_disableforcecompile.php
deleted file mode 100644
index 7dab167..0000000
--- a/includes/Smarty/sysplugins/smarty_method_disableforcecompile.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
-* Smarty method DisableForceCompile
-*
-* Disable forced compiling
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Disable forced compiling
-*/
-function Smarty_Method_DisableForceCompile($smarty)
-{
- $smarty->force_compile = false;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_disablevariablefilter.php b/includes/Smarty/sysplugins/smarty_method_disablevariablefilter.php
deleted file mode 100644
index 173bdfe..0000000
--- a/includes/Smarty/sysplugins/smarty_method_disablevariablefilter.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
-* Smarty method DisableVariableFilter
-*
-* Disable filter on variable output
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Disable filter on variable output
-*/
-function Smarty_Method_DisableVariableFilter($smarty)
-{
- $smarty->variable_filter = false;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_enablecachemodifycheck.php b/includes/Smarty/sysplugins/smarty_method_enablecachemodifycheck.php
deleted file mode 100644
index 31dbbeb..0000000
--- a/includes/Smarty/sysplugins/smarty_method_enablecachemodifycheck.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
-* Smarty method EnableCacheModifyCheck
-*
-* Enable cache modify check
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Enable cache modify check
-*/
-function Smarty_Method_EnableCacheModifyCheck($smarty)
-{
- $smarty->cache_modified_check = true;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_enablecompilecheck.php b/includes/Smarty/sysplugins/smarty_method_enablecompilecheck.php
deleted file mode 100644
index 23cd283..0000000
--- a/includes/Smarty/sysplugins/smarty_method_enablecompilecheck.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
-* Smarty method EnableCompileCheck
-*
-* Enable compile checking
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Enable compile checking
-*/
-function Smarty_Method_EnableCompileCheck($smarty)
-{
- $smarty->compile_check = true;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_enableconfigbooleanize.php b/includes/Smarty/sysplugins/smarty_method_enableconfigbooleanize.php
deleted file mode 100644
index ab7bd14..0000000
--- a/includes/Smarty/sysplugins/smarty_method_enableconfigbooleanize.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
-* Smarty method EnableConfigBooleanize
-*
-* Enable config booleanize mode
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Enable config booleanize mode
-*/
-function Smarty_Method_EnableConfigBooleanize($smarty)
-{
- $smarty->config_booleanize = true;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_enableconfigoverwrite.php b/includes/Smarty/sysplugins/smarty_method_enableconfigoverwrite.php
deleted file mode 100644
index 7f0cc71..0000000
--- a/includes/Smarty/sysplugins/smarty_method_enableconfigoverwrite.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
-* Smarty method EnableConfigOverwrite
-*
-* Enable config overwrite mode
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Enable config overwrite mode
-*/
-function Smarty_Method_EnableConfigOverwrite($smarty)
-{
- $smarty->config_overwrite = true;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_enableconfigreadhidden.php b/includes/Smarty/sysplugins/smarty_method_enableconfigreadhidden.php
deleted file mode 100644
index 982d0fd..0000000
--- a/includes/Smarty/sysplugins/smarty_method_enableconfigreadhidden.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
-* Smarty method EnableConfigReadHidden
-*
-* Enable config read hidden mode
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Enable config read hidden mode
-*/
-function Smarty_Method_EnableConfigReadHidden($smarty)
-{
- $this->smarty->config_read_hidden = true;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_enabledebugging.php b/includes/Smarty/sysplugins/smarty_method_enabledebugging.php
deleted file mode 100644
index 3f3cc90..0000000
--- a/includes/Smarty/sysplugins/smarty_method_enabledebugging.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
-* Smarty method EnableDebugging
-*
-* Enable debugging
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Enable debugging
-*/
-function Smarty_Method_EnableDebugging($smarty)
-{
- $this->smarty->debugging = true;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_enabledebuggingurlctrl.php b/includes/Smarty/sysplugins/smarty_method_enabledebuggingurlctrl.php
deleted file mode 100644
index 0743270..0000000
--- a/includes/Smarty/sysplugins/smarty_method_enabledebuggingurlctrl.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
-* Smarty method EnableDebuggingUrlCtrl
-*
-* Enable possibility to enable debugging by SMARTY_DEBUG attribute
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Enable possibility to enable debugging by SMARTY_DEBUG attribute
-*/
-function Smarty_Method_EnableDebuggingUrlCtrl($smarty)
-{
- $smarty->debugging_ctrl = 'URL';
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_enabledefaulttimezone.php b/includes/Smarty/sysplugins/smarty_method_enabledefaulttimezone.php
deleted file mode 100644
index e5a7f27..0000000
--- a/includes/Smarty/sysplugins/smarty_method_enabledefaulttimezone.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
-* Smarty method EnableDefaultTimezone
-*
-* Enable setting of default timezone
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Enable setting of default timezone
-*/
-function Smarty_Method_EnableDefaultTimezone($smarty)
-{
- $this->smarty->set_timezone = true;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_enableforcecompile.php b/includes/Smarty/sysplugins/smarty_method_enableforcecompile.php
deleted file mode 100644
index f78fc91..0000000
--- a/includes/Smarty/sysplugins/smarty_method_enableforcecompile.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
-* Smarty method EnableForceCompile
-*
-* Enable forced compiling
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Enable forced compiling
-*/
-function Smarty_Method_EnableForceCompile($smarty)
-{
- $smarty->force_compile = true;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_enablevariablefilter.php b/includes/Smarty/sysplugins/smarty_method_enablevariablefilter.php
deleted file mode 100644
index 6abe923..0000000
--- a/includes/Smarty/sysplugins/smarty_method_enablevariablefilter.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
-* Smarty method EnableVariableFilter
-*
-* Enable filter on variable output
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Enable filter on variable output
-*/
-function Smarty_Method_EnableVariableFilter($smarty)
-{
- $smarty->variable_filter = true;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_get_config_vars.php b/includes/Smarty/sysplugins/smarty_method_get_config_vars.php
deleted file mode 100644
index 9bbf4b5..0000000
--- a/includes/Smarty/sysplugins/smarty_method_get_config_vars.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-
-/**
-* Smarty method Get_Config_Vars
-*
-* Returns a single or all global config variables
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Returns a single or all global config variables
-*/
-
-/**
-* Returns a single or all global config variables
-*
-* @param string $varname variable name or null
-* @return string variable value or or array of variables
-*/
-function Smarty_Method_Get_Config_Vars($smarty, $varname = null)
-{
- if (isset($varname)) {
- if (isset($smarty->config_vars[$varname])) {
- return $smarty->config_vars[$varname];
- } else {
- return '';
- }
- } else {
- return $smarty->config_vars;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_get_global.php b/includes/Smarty/sysplugins/smarty_method_get_global.php
deleted file mode 100644
index 539e082..0000000
--- a/includes/Smarty/sysplugins/smarty_method_get_global.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-/**
-* Smarty method Get_Global
-*
-* Returns a single or all global variables
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Returns a single or all global variables
-*
-* @param object $smarty
-* @param string $varname variable name or null
-* @return string variable value or or array of variables
-*/
-function Smarty_Method_Get_Global($smarty, $varname = null)
-{
- if (isset($varname)) {
- if (isset($smarty->global_tpl_vars[$varname])) {
- return $smarty->global_tpl_vars[$varname]->value;
- } else {
- return '';
- }
- } else {
- $_result = array();
- foreach ($smarty->global_tpl_vars AS $key => $var) {
- $_result[$key] = $var->value;
- }
- return $_result;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_get_registered_object.php b/includes/Smarty/sysplugins/smarty_method_get_registered_object.php
deleted file mode 100644
index 147a1f3..0000000
--- a/includes/Smarty/sysplugins/smarty_method_get_registered_object.php
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/**
-* Smarty method Get_Registered_Object
-*
-* Registers a PHP object
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Returns a reference to a registered object
-*/
-
-/**
-* return a reference to a registered object
-*
-* @param string $name
-* @return object
-*/
-function Smarty_Method_Get_Registered_Object($smarty, $name)
-{
- if (!isset($smarty->registered_objects[$name]))
- throw new Exception("'$name' is not a registered object");
-
- if (!is_object($smarty->registered_objects[$name][0]))
- throw new Exception("registered '$name' is not an object");
-
- return $smarty->registered_objects[$name][0];
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_get_template_vars.php b/includes/Smarty/sysplugins/smarty_method_get_template_vars.php
deleted file mode 100644
index 9bfdbd8..0000000
--- a/includes/Smarty/sysplugins/smarty_method_get_template_vars.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-
-/**
-* Smarty method Get_Template_Vars
-*
-* Returns a single or all template variables
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Returns a single or all template variables
-*/
-
-/**
-* Returns a single or all template variables
-*
-* @param string $varname variable name or null
-* @return string variable value or or array of variables
-*/
-function Smarty_Method_Get_Template_Vars($smarty, $varname = null, $_ptr = null, $search_parents = true)
-{
- if (isset($varname)) {
- $_var = $smarty->getVariable($varname, $_ptr, $search_parents);
- if (is_object($_var)) {
- return $_var->value;
- } else {
- return null;
- }
- } else {
- $_result = array();
- if ($_ptr === null) {
- $_ptr = $smarty;
- } while ($_ptr !== null) {
- foreach ($_ptr->tpl_vars AS $key => $var) {
- $_result[$key] = $var->value;
- }
- // not found, try at parent
- if ($search_parents) {
- $_ptr = $_ptr->parent;
- } else {
- $_ptr = null;
- }
- }
- if ($search_parents) {
- foreach ($smarty->global_tpl_vars AS $key => $var) {
- $_result[$key] = $var->value;
- }
- }
- return $_result;
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_getcachedir.php b/includes/Smarty/sysplugins/smarty_method_getcachedir.php
deleted file mode 100644
index 47ed877..0000000
--- a/includes/Smarty/sysplugins/smarty_method_getcachedir.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
-* Smarty method GetCacheDir
-*
-* Returns directory of cache files
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Returns directory of cache files
-*/
-
-/**
-* Returns directory of cache files
-*
-* @return array cache folder
-*/
-function Smarty_Method_GetCacheDir($smarty)
-{
- return $this->smarty->cache_dir;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_getcachelifetime.php b/includes/Smarty/sysplugins/smarty_method_getcachelifetime.php
deleted file mode 100644
index 0db4fc7..0000000
--- a/includes/Smarty/sysplugins/smarty_method_getcachelifetime.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-/**
-* Smarty method GetCacheLifetime
-*
-* Returns lifetime of cache files
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Smarty class getCacheLifetime
-*
-* Returns lifetime of cache files
-*/
-/**
-* Returns lifetime of cache files
-*
-* @return integer cache file lifetime
-*/
-function Smarty_Method_GetCacheLifetime($smarty)
-{
- return $smarty->cache_lifetime;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_getcompiledir.php b/includes/Smarty/sysplugins/smarty_method_getcompiledir.php
deleted file mode 100644
index 929da27..0000000
--- a/includes/Smarty/sysplugins/smarty_method_getcompiledir.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
-* Smarty method GetCompileDir
-*
-* Returns directory of compiled templates
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Returns directory of compiled templates
-*/
-
-/**
-* Returns directory of compiled templates
-*
-* @return array compiled template folder
-*/
-function Smarty_Method_GetCompileDir($smarty)
-{
- return $this->smarty->compile_dir;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_getconfigdir.php b/includes/Smarty/sysplugins/smarty_method_getconfigdir.php
deleted file mode 100644
index 79e55b6..0000000
--- a/includes/Smarty/sysplugins/smarty_method_getconfigdir.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
-* Smarty method GetConfigDir
-*
-* Returns directory of config files
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Returns directory of config files
-*/
-
-/**
-* Returns directory of config files
-*
-* @return array config folder
-*/
-function Smarty_Method_GetConfigDir($smarty)
-{
- return $smarty->config_dir;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_getdebugtemplate.php b/includes/Smarty/sysplugins/smarty_method_getdebugtemplate.php
deleted file mode 100644
index 8109169..0000000
--- a/includes/Smarty/sysplugins/smarty_method_getdebugtemplate.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
-* Smarty method GetDebugTemplate
-*
-* Returns debug template filepath
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Returns debug template filepath
-*/
-
-/**
-* Returns directory of cache files
-*
-* @return string debug template filepath
-*/
-function Smarty_Method_GetDebugTemplate($smarty)
-{
- return $smarty->debug_tpl;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_getpluginsdir.php b/includes/Smarty/sysplugins/smarty_method_getpluginsdir.php
deleted file mode 100644
index 6fa98a3..0000000
--- a/includes/Smarty/sysplugins/smarty_method_getpluginsdir.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
-* Smarty method GetPluginsDir
-*
-* Returns directory of plugins
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Returns directory of plugins
-*/
-
-/**
-* Returns directory of plugins
-*
-* @return array plugins folder
-*/
-function Smarty_Method_GetPluginsDir($smarty)
-{
- return $smarty->plugins_dir;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_gettemplatedir.php b/includes/Smarty/sysplugins/smarty_method_gettemplatedir.php
deleted file mode 100644
index 2fa1df8..0000000
--- a/includes/Smarty/sysplugins/smarty_method_gettemplatedir.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
-* Smarty method GetTemplateDir
-*
-* Returns template directory
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Returns template directory
-*/
-
-/**
-* Returns template directory
-*
-* @return array template folders
-*/
-function Smarty_Method_GetTemplateDir($smarty)
-{
- return $smarty->template_dir;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_getvariablefilter.php b/includes/Smarty/sysplugins/smarty_method_getvariablefilter.php
deleted file mode 100644
index 9d7d0c4..0000000
--- a/includes/Smarty/sysplugins/smarty_method_getvariablefilter.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-
-/**
-* Smarty method GetVariableFilter
-*
-* get status of filter on variable output
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Smarty class getVariableFilter
-*
-* get status of filter on variable output
-*/
-function Smarty_Method_GetVariableFilter($smarty)
-{
- return $smarty->variable_filter;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_iscachemodifycheck.php b/includes/Smarty/sysplugins/smarty_method_iscachemodifycheck.php
deleted file mode 100644
index 4e93b17..0000000
--- a/includes/Smarty/sysplugins/smarty_method_iscachemodifycheck.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
-* Smarty method IsCacheModifyCheck
-*
-* is cache modify check
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* is cache modify check
-*/
-function Smarty_Method_IsCacheModifyCheck()
-{
- return $smarty->cache_modified_check;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_iscaching.php b/includes/Smarty/sysplugins/smarty_method_iscaching.php
deleted file mode 100644
index e27bd0a..0000000
--- a/includes/Smarty/sysplugins/smarty_method_iscaching.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
-* Smarty method IsCaching
-*
-* is caching
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* is caching
-*/
-function Smarty_Method_IsCaching($smarty)
-{
- return $smarty->caching;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_iscompilecheck.php b/includes/Smarty/sysplugins/smarty_method_iscompilecheck.php
deleted file mode 100644
index 904ad4c..0000000
--- a/includes/Smarty/sysplugins/smarty_method_iscompilecheck.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
-* Smarty method IsCompileCheck
-*
-* is compile checking
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* is compile checking
-*/
-function Smarty_Method_IsCompileCheck($smarty)
-{
- return $smarty->compile_check;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_isconfigbooleanize.php b/includes/Smarty/sysplugins/smarty_method_isconfigbooleanize.php
deleted file mode 100644
index 605474b..0000000
--- a/includes/Smarty/sysplugins/smarty_method_isconfigbooleanize.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
-* Smarty method IsConfigBooleanize
-*
-* is config booleanize mode
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* is config booleanize mode
-*/
-function Smarty_Method_IsConfigBooleanize($smarty)
-{
- return $smarty->config_booleanize;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_isconfigoverwrite.php b/includes/Smarty/sysplugins/smarty_method_isconfigoverwrite.php
deleted file mode 100644
index fb10f0e..0000000
--- a/includes/Smarty/sysplugins/smarty_method_isconfigoverwrite.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
-* Smarty method IsConfigOverwrite
-*
-* is config overwrite mode
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* is config overwrite mode
-*/
-function Smarty_Method_IsConfigOverwrite($smarty)
-{
- return $smarty->config_overwrite;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_isconfigreadhidden.php b/includes/Smarty/sysplugins/smarty_method_isconfigreadhidden.php
deleted file mode 100644
index e13c84d..0000000
--- a/includes/Smarty/sysplugins/smarty_method_isconfigreadhidden.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
-* Smarty method IsConfigReadHidden
-*
-* is config read hidden mode
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-*
-* is config read hidden mode
-*/
-function Smarty_Method_IsConfigReadHidden($smarty)
- {
- return $smarty->config_read_hidden;
- }
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_isdebugging.php b/includes/Smarty/sysplugins/smarty_method_isdebugging.php
deleted file mode 100644
index 9d36eb4..0000000
--- a/includes/Smarty/sysplugins/smarty_method_isdebugging.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
-* Smarty method IsDebugging
-*
-* is debugging
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* is debugging
-*/
-function Smarty_Method_IsDebugging($smarty)
-{
- return $smarty->debugging;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_isdebuggingurlctrl.php b/includes/Smarty/sysplugins/smarty_method_isdebuggingurlctrl.php
deleted file mode 100644
index 5487cd1..0000000
--- a/includes/Smarty/sysplugins/smarty_method_isdebuggingurlctrl.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
-* Smarty method IsDebuggingUrlCtrl
-*
-* is possibility to is debugging by SMARTY_DEBUG attribute
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* is possibility to is debugging by SMARTY_DEBUG attribute
-*/
-function Smarty_Method_IsDebuggingUrlCtrl($smarty)
-{
- return $smarty->debugging_ctrl != 'none';
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_isdefaulttimezone.php b/includes/Smarty/sysplugins/smarty_method_isdefaulttimezone.php
deleted file mode 100644
index dd22117..0000000
--- a/includes/Smarty/sysplugins/smarty_method_isdefaulttimezone.php
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-
-/**
-* Smarty method IsDefaultTimezone
-*
-* is setting of default timezone
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* is setting of default timezone
-*/
-function Smarty_Method_IsDefaultTimezone($smarty)
-{
- return $smarty->set_timezone = false;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_isforcecompile.php b/includes/Smarty/sysplugins/smarty_method_isforcecompile.php
deleted file mode 100644
index 94c62a0..0000000
--- a/includes/Smarty/sysplugins/smarty_method_isforcecompile.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-
-/**
-* Smarty method IsForceCompile
-*
-* is forced compiling
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-*
-* is forced compiling
-*/
-function Smarty_Method_IsForceCompile($smarty)
- {
- return $smarty->force_compile;
- }
-
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_load_filter.php b/includes/Smarty/sysplugins/smarty_method_load_filter.php
deleted file mode 100644
index cb82ea1..0000000
--- a/includes/Smarty/sysplugins/smarty_method_load_filter.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-/**
-* Smarty method Load_Filter
-*
-* Loads a filter plugin
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* load a filter of specified type and name
-*
-* @param string $type filter type
-* @param string $name filter name
-*/
-function Smarty_Method_Load_Filter($smarty, $type, $name)
-{
- $_plugin = "smarty_{$type}filter_{$name}";
- $_filter_name = $_plugin;
- if ($smarty->loadPlugin($_plugin)) {
- if (class_exists($_plugin, false)) {
- $_plugin = array($_plugin, 'execute');
- }
- if (is_callable($_plugin)) {
- $smarty->registered_filters[$type][$_filter_name] = $_plugin;
- return;
- }
- }
- throw new Exception("{$type}filter \"{$name}\" not callable");
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_register_block.php b/includes/Smarty/sysplugins/smarty_method_register_block.php
deleted file mode 100644
index c2bf1cb..0000000
--- a/includes/Smarty/sysplugins/smarty_method_register_block.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-
-/**
-* Smarty method Register_Block
-*
-* Registers a PHP function as Smarty block function plugin
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Register a PHP function as Smarty block function plugin
-*/
-
-/**
-* Registers block function to be used in templates
-*
-* @param string $block_tag name of template block
-* @param string $block_impl PHP function to register
-* @param boolean $cacheable if true (default) this fuction is cachable
-*/
-function Smarty_Method_Register_Block($smarty, $block_tag, $block_impl, $cacheable = true, $cache_attr = array())
-{
- if (isset($smarty->registered_plugins[$block_tag])) {
- throw new Exception("Plugin tag \"{$block_tag}\" already registered");
- } elseif (!is_callable($block_impl)) {
- throw new Exception("Plugin \"{$block_tag}\" not callable");
- } else {
- $smarty->registered_plugins[$block_tag] =
- array('block', $block_impl, $cacheable, $cache_attr);
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_register_compiler_function.php b/includes/Smarty/sysplugins/smarty_method_register_compiler_function.php
deleted file mode 100644
index 5d74744..0000000
--- a/includes/Smarty/sysplugins/smarty_method_register_compiler_function.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-
-/**
-* Smarty method Register_Compiler_Function
-*
-* Registers a PHP function as Smarty compiler function plugin
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Register a PHP function as Smarty compiler function plugin
-*/
-
-/**
-* Registers compiler function
-*
-* @param string $compiler_tag of template function
-* @param string $compiler_impl name of PHP function to register
-*/
-function Smarty_Method_Register_Compiler_Function($smarty, $compiler_tag, $compiler_impl, $cacheable = true)
-{
- if (isset($smarty->registered_plugins[$compiler_tag])) {
- throw new Exception("Plugin tag \"{$compiler_tag}\" already registered");
- } elseif (!is_callable($compiler_impl)) {
- throw new Exception("Plugin \"{$compiler_tag}\" not callable");
- } else {
- $smarty->registered_plugins[$compiler_tag] =
- array('compiler', $compiler_impl, $cacheable);
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_register_function.php b/includes/Smarty/sysplugins/smarty_method_register_function.php
deleted file mode 100644
index ceb8048..0000000
--- a/includes/Smarty/sysplugins/smarty_method_register_function.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-/**
-* Smarty method Register_Function
-*
-* Registers a PHP function as Smarty function plugin
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Registers custom function to be used in templates
-*
-* @param object $smarty
-* @param string $function_tag the name of the template function
-* @param string $function_impl the name of the PHP function to register
-* @param boolean $cacheable if true (default) this fuction is cachable
-*/
-function Smarty_Method_Register_Function($smarty, $function_tag, $function_impl, $cacheable = true, $cache_attr = array())
-{
- if (isset($smarty->registered_plugins[$function_tag])) {
- throw new Exception("Plugin tag \"{$function_tag}\" already registered");
- } elseif (!is_callable($function_impl)) {
- throw new Exception("Plugin \"{$function_tag}\" not callable");
- } else {
- $smarty->registered_plugins[$function_tag] =
- array('function', $function_impl, $cacheable, $cache_attr);
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_register_modifier.php b/includes/Smarty/sysplugins/smarty_method_register_modifier.php
deleted file mode 100644
index 7d9986c..0000000
--- a/includes/Smarty/sysplugins/smarty_method_register_modifier.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-/**
-* Smarty method Register_Modifier
-*
-* Registers a PHP function as Smarty modifier plugin
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Registers modifier to be used in templates
-*
-* @param object $smarty
-* @param string $modifier name of template modifier
-* @param string $modifier_impl name of PHP function to register
-*/
-function Smarty_Method_Register_Modifier($smarty, $modifier, $modifier_impl)
-{
- if (isset($smarty->registered_plugins[$modifier])) {
- throw new Exception("Plugin \"{$modifier}\" already registered");
- } elseif (!is_callable($modifier_impl)) {
- throw new Exception("Plugin \"{$modifier}\" not callable");
- } else {
- $smarty->registered_plugins[$modifier] =
- array('modifier', $modifier_impl);
- }
-}
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_register_object.php b/includes/Smarty/sysplugins/smarty_method_register_object.php
deleted file mode 100644
index a4d0e60..0000000
--- a/includes/Smarty/sysplugins/smarty_method_register_object.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-
-/**
-* Smarty method Register_Object
-*
-* Registers a PHP object
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Registers object to be used in templates
-*
-* @param object $smarty
-* @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 Smarty_Method_Register_Object($smarty, $object, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
-{
- // test if allowed methodes callable
- if (!empty($allowed)) {
- foreach ((array)$allowed as $methode) {
- if (!is_callable(array($object_impl, $methode))) {
- throw new Exception("Undefined methode '$methode' in registered object");
- }
- }
- }
- // test if block methodes callable
- if (!empty($block_methods)) {
- foreach ((array)$block_methods as $methode) {
- if (!is_callable(array($object_impl, $methode))) {
- throw new Exception("Undefined methode '$methode' in registered object");
- }
- }
- }
- // register the object
- $smarty->registered_objects[$object] =
- array($object_impl, (array)$allowed, (boolean)$smarty_args, (array)$block_methods);
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_register_outputfilter.php b/includes/Smarty/sysplugins/smarty_method_register_outputfilter.php
deleted file mode 100644
index 4601264..0000000
--- a/includes/Smarty/sysplugins/smarty_method_register_outputfilter.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-/**
-* Smarty method Register_Outputfilter
-*
-* Registers a PHP function as outputfilter
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Registers an output filter function to apply
-* to a template output
-*
-* @param object $smarty
-* @param callback $function
-*/
-function Smarty_Method_Register_Outputfilter($smarty, $function)
-{
- $smarty->registered_filters['output'][$smarty->_get_filter_name($function)] = $function;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_register_postfilter.php b/includes/Smarty/sysplugins/smarty_method_register_postfilter.php
deleted file mode 100644
index 1d8c2e7..0000000
--- a/includes/Smarty/sysplugins/smarty_method_register_postfilter.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-/**
-* Smarty method Register_Postfilter
-*
-* Registers a PHP function as postfilter
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Registers a postfilter function to apply
-* to a compiled template after compilation
-*
-* @param object $smarty
-* @param callback $function
-*/
-function Smarty_Method_Register_Postfilter($smarty, $function)
-{
- $smarty->registered_filters['post'][$smarty->_get_filter_name($function)] = $function;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_register_prefilter.php b/includes/Smarty/sysplugins/smarty_method_register_prefilter.php
deleted file mode 100644
index 781700d..0000000
--- a/includes/Smarty/sysplugins/smarty_method_register_prefilter.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-/**
-* Smarty method Register_Prefilter
-*
-* Registers a PHP function as prefilter
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Registers a prefilter function to apply
-* to a template before compiling
-*
-* @param object $smarty
-* @param callback $function
-*/
-function Smarty_Method_Register_Prefilter($smarty, $function)
-{
- $smarty->registered_filters['pre'][$smarty->_get_filter_name($function)] = $function;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_register_resource.php b/includes/Smarty/sysplugins/smarty_method_register_resource.php
deleted file mode 100644
index 09f5e89..0000000
--- a/includes/Smarty/sysplugins/smarty_method_register_resource.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-/**
-* Smarty method Register_Resource
-*
-* Registers a Smarty template resource
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Registers a resource to fetch a template
-*
-* @param object $smarty
-* @param string $type name of resource
-* @param array $functions array of functions to handle resource
-*/
-function Smarty_Method_Register_Resource($smarty, $type, $functions)
-{
- if (count($functions) == 4) {
- $smarty->_plugins['resource'][$type] =
- array($functions, false);
- } elseif (count($functions) == 5) {
- $smarty->_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 {
- throw new Exception("malformed function-list for '$type' in register_resource");
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_register_variablefilter.php b/includes/Smarty/sysplugins/smarty_method_register_variablefilter.php
deleted file mode 100644
index 3052d34..0000000
--- a/includes/Smarty/sysplugins/smarty_method_register_variablefilter.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-/**
-* Smarty method Register_Variablefilter
-*
-* Registers a PHP function as an output filter for variables
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Registers an output filter function which
-* runs over any variable output
-*
-* @param object $smarty
-* @param callback $function
-*/
-function Smarty_Method_Register_Variablefilter($smarty, $function)
-{
- $smarty->registered_filters['variable'][$smarty->_get_filter_name($function)] = $function;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_registerdefaultpluginhandler.php b/includes/Smarty/sysplugins/smarty_method_registerdefaultpluginhandler.php
deleted file mode 100644
index fe1e25b..0000000
--- a/includes/Smarty/sysplugins/smarty_method_registerdefaultpluginhandler.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-/**
-* Smarty method RegisterDefaultPluginhandlerHandler
-*
-* Registers a default plugin handler
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Registers a default plugin handler
-*
-* @param object $smarty
-* @param string $ |array $plugin class/methode name
-*/
-function Smarty_Method_RegisterDefaultPluginHandler($smarty, $plugin)
-{
- if (is_callable($plugin)) {
- $smarty->default_plugin_handler_func = $plugin;
- } else {
- throw new Exception('Default plugin handler "' . $plugin . '" not callable');
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_registerdefaulttemplatehandler.php b/includes/Smarty/sysplugins/smarty_method_registerdefaulttemplatehandler.php
deleted file mode 100644
index 1b716af..0000000
--- a/includes/Smarty/sysplugins/smarty_method_registerdefaulttemplatehandler.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-/**
-* Smarty method RegisterDefaultTemplateHandler
-*
-* Registers a default template handler
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Registers a default template handler
-*
-* @param object $smarty
-* @param string $ |array $function class/methode name
-*/
-function Smarty_Method_RegisterDefaultTemplateHandler($smarty, $function)
-{
- if (is_callable($function)) {
- $smarty->default_template_handler_func = $function;
- } else {
- throw new Exception('Default template handler "' . $function . '" not callable');
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_setconfigdir.php b/includes/Smarty/sysplugins/smarty_method_setconfigdir.php
deleted file mode 100644
index 6e501f6..0000000
--- a/includes/Smarty/sysplugins/smarty_method_setconfigdir.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-
-/**
-* Smarty method SetConfigDir
-*
-* Sets directory of config files
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Sets directory of config files
-*
-* @param object $smarty
-* @param string $ config folder
-* @return
-*/
-function Smarty_Method_SetConfigDir($smarty, $config_dir)
-{
- $this->smarty->config_dir = $config_dir;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_setdebugtemplate.php b/includes/Smarty/sysplugins/smarty_method_setdebugtemplate.php
deleted file mode 100644
index 4e9cc1f..0000000
--- a/includes/Smarty/sysplugins/smarty_method_setdebugtemplate.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-/**
-* Smarty method SetDebugTemplate
-*
-* Sets debug template filepath
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Sets debug template filepath
-*/
-
-/**
-* Sets debug template filepath
-*
-* @param string $ array debug template filepath
-*/
-function Smarty_Method_SetDebugTemplate($smarty, $debug_tpl)
-{
- $smarty->debug_tpl = $debug_tpl;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_setpluginsdir.php b/includes/Smarty/sysplugins/smarty_method_setpluginsdir.php
deleted file mode 100644
index 57ed8f2..0000000
--- a/includes/Smarty/sysplugins/smarty_method_setpluginsdir.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-/**
-* Smarty method SetPluginsDir
-*
-* Sets directory of plugin files
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Sets directory of plugin files
-*/
-
-/**
-* Sets directory of plugin files
-*
-* @param string $ plugins folder
-* @return
-*/
-function Smarty_Method_SetPluginsDir($smarty, $plugins_dir)
-{
- $smarty->plugins_dir = (array)$plugins_dir;
- return;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_template_exists.php b/includes/Smarty/sysplugins/smarty_method_template_exists.php
deleted file mode 100644
index 8ece1ae..0000000
--- a/includes/Smarty/sysplugins/smarty_method_template_exists.php
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-
-/**
-* Smarty method Template_Exists
-*
-* Checks if a template resource exists
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Checks if a template resource exists
-*/
-
-/**
-* Check if a template resource exists
-*
-* @param string $resource_name template name
-* @return boolean status
-*/
-function Smarty_Method_Template_Exists($smarty, $resource_name)
-{
- // create template object
- $tpl = new $smarty->template_class($resource_name, $smarty);
- // check if it does exists
- return $tpl->isExisting();
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_test.php b/includes/Smarty/sysplugins/smarty_method_test.php
deleted file mode 100644
index 53f8594..0000000
--- a/includes/Smarty/sysplugins/smarty_method_test.php
+++ /dev/null
@@ -1,77 +0,0 @@
-<?php
-
-/**
-* Smarty plugin
-*
-* @ignore
-* @package Smarty
-* @subpackage plugins
-*/
-
-function Smarty_Method_Test($smarty)
-{
- echo "<PRE>\n";
-
- echo "Smarty Installation test...\n";
-
- echo "Testing template directory...\n";
-
- foreach((array)$smarty->template_dir as $template_dir) {
- if (!is_dir($template_dir))
- echo "FAILED: $template_dir is not a directory.\n";
- elseif (!is_readable($template_dir))
- echo "FAILED: $template_dir is not readable.\n";
- else
- echo "$template_dir is OK.\n";
- }
-
- echo "Testing compile directory...\n";
-
- if (!is_dir($smarty->compile_dir))
- echo "FAILED: $smarty->compile_dir is not a directory.\n";
- elseif (!is_readable($smarty->compile_dir))
- echo "FAILED: $smarty->compile_dir is not readable.\n";
- elseif (!is_writable($smarty->compile_dir))
- echo "FAILED: $smarty->compile_dir is not writable.\n";
- else
- echo "{$smarty->compile_dir} is OK.\n";
-
- echo "Testing plugins directory...\n";
-
- foreach((array)$smarty->plugins_dir as $plugin_dir) {
- if (!is_dir($plugin_dir))
- echo "FAILED: $plugin_dir is not a directory.\n";
- elseif (!is_readable($plugin_dir))
- echo "FAILED: $plugin_dir is not readable.\n";
- else
- echo "$plugin_dir is OK.\n";
- }
-
- echo "Testing cache directory...\n";
-
- if (!is_dir($smarty->cache_dir))
- echo "FAILED: $smarty->cache_dir is not a directory.\n";
- elseif (!is_readable($smarty->cache_dir))
- echo "FAILED: $smarty->cache_dir is not readable.\n";
- elseif (!is_writable($smarty->cache_dir))
- echo "FAILED: $smarty->cache_dir is not writable.\n";
- else
- echo "{$smarty->cache_dir} is OK.\n";
-
- echo "Testing configs directory...\n";
-
- if (!is_dir($smarty->config_dir))
- echo "FAILED: $smarty->config_dir is not a directory.\n";
- elseif (!is_readable($smarty->config_dir))
- echo "FAILED: $smarty->config_dir is not readable.\n";
- else
- echo "{$smarty->config_dir} is OK.\n";
-
- echo "Tests complete.\n";
-
- echo "</PRE>\n";
-
- return true;
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_unregister_block.php b/includes/Smarty/sysplugins/smarty_method_unregister_block.php
deleted file mode 100644
index 2b6867a..0000000
--- a/includes/Smarty/sysplugins/smarty_method_unregister_block.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-/**
-* Smarty method Unregister_Block
-*
-* Unregister a Smarty block function plugin
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Unregister a Smarty block function plugin
-*/
-
-/**
-* Unregisters block function
-*
-* @param string $block_tag name of template function
-*/
-function Smarty_Method_Unregister_Block($smarty, $block_tag)
-{
- if (isset($smarty->registered_plugins[$block_tag]) && $smarty->registered_plugins[$block_tag][0] == 'block') {
- unset($smarty->registered_plugins[$block_tag]);
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_unregister_compiler_function.php b/includes/Smarty/sysplugins/smarty_method_unregister_compiler_function.php
deleted file mode 100644
index 3769b03..0000000
--- a/includes/Smarty/sysplugins/smarty_method_unregister_compiler_function.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-/**
-* Smarty method Unregister_Compiler_Function
-*
-* Unregister a Smarty compiler function plugin
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Unregister a Smarty compiler function plugin
-*/
-
-/**
-* Unregisters compiler function
-*
-* @param string $compiler_tag name of template function
-*/
-function Smarty_Method_Unregister_Compiler_Function($smarty, $compiler_tag)
-{
- if (isset($smarty->registered_plugins[$compiler_tag]) && $smarty->registered_plugins[$compiler_tag][0] == 'compiler') {
- unset($smarty->registered_plugins[$compiler_tag]);
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_unregister_function.php b/includes/Smarty/sysplugins/smarty_method_unregister_function.php
deleted file mode 100644
index 99c0d43..0000000
--- a/includes/Smarty/sysplugins/smarty_method_unregister_function.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-/**
-* Smarty method Unregister_Function
-*
-* Unregister a Smarty function plugin
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Unregister a Smarty function plugin
-*/
-
-/**
-* Unregisters custom function
-*
-* @param string $function_tag name of template function
-*/
-function Smarty_Method_Unregister_Function($smarty, $function_tag)
-{
- if (isset($smarty->registered_plugins[$function_tag]) && $smarty->registered_plugins[$function_tag][0] == 'function') {
- unset($smarty->registered_plugins[$function_tag]);
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_unregister_modifier.php b/includes/Smarty/sysplugins/smarty_method_unregister_modifier.php
deleted file mode 100644
index 84c78fc..0000000
--- a/includes/Smarty/sysplugins/smarty_method_unregister_modifier.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?php
-
-/**
-* Smarty method Unregister_Modifier
-*
-* Unregister a Smarty modifier plugin
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Unregister a Smarty modifier plugin
-*/
-
-/**
-* Unregisters modifier
-*
-* @param string $modifier name of template modifier
-*/
-function Smarty_Method_Unregister_Modifier($smarty, $modifier)
-{
- if (isset($smarty->registered_plugins[$modifier]) && $smarty->registered_plugins[$modifier][0] == 'modifier') {
- unset($smarty->registered_plugins[$modifier]);
- }
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_unregister_object.php b/includes/Smarty/sysplugins/smarty_method_unregister_object.php
deleted file mode 100644
index 0be5c25..0000000
--- a/includes/Smarty/sysplugins/smarty_method_unregister_object.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-/**
-* Smarty method Unregister_Object
-*
-* Unregister a PHP object
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-*
-* Unregister a PHP object
-*/
-
- /**
- * Unregisters object
- *
- * @param string $object name of template object
- */
- function Smarty_Method_Unregister_Object($smarty, $object)
- {
- unset($smarty->registered_objects[$object]);
- }
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_unregister_outputfilter.php b/includes/Smarty/sysplugins/smarty_method_unregister_outputfilter.php
deleted file mode 100644
index b71a779..0000000
--- a/includes/Smarty/sysplugins/smarty_method_unregister_outputfilter.php
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-/**
-* Smarty method Unregister_Outputfilter
-*
-* Unregister a outputfilter
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Unregister a outputfilter
-*/
-
-/**
-* Registers an output filter function to apply
-* to a template output
-*
-* @param callback $function
-*/
-function Smarty_Method_Unregister_Outputfilter($smarty, $function)
-{
- unset($smarty->registered_filters['output'][$smarty->_get_filter_name($function)]);
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_unregister_postfilter.php b/includes/Smarty/sysplugins/smarty_method_unregister_postfilter.php
deleted file mode 100644
index 17aa49b..0000000
--- a/includes/Smarty/sysplugins/smarty_method_unregister_postfilter.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
-* Smarty method Unregister_Postfilter
-*
-* Unregister a postfilter
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Unregister a postfilter
-*/
-
-/**
-* Unregisters a postfilter function
-*
-* @param callback $function
-*/
-function Smarty_Method_Unregister_Postfilter($smarty, $function)
-{
- unset($smarty->registered_filters['post'][$smarty->_get_filter_name($function)]);
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_unregister_prefilter.php b/includes/Smarty/sysplugins/smarty_method_unregister_prefilter.php
deleted file mode 100644
index b77eaf6..0000000
--- a/includes/Smarty/sysplugins/smarty_method_unregister_prefilter.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
-* Smarty method Unregister_Prefilter
-*
-* Unregister a prefilter
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Unregister a prefilter
-*/
-
-/**
-* Unregisters a prefilter function
-*
-* @param callback $function
-*/
-function Smarty_Method_Unregister_Prefilter($smarty, $function)
-{
- unset($smarty->registered_filters['pre'][$smarty->_get_filter_name($function)]);
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_unregister_resource.php b/includes/Smarty/sysplugins/smarty_method_unregister_resource.php
deleted file mode 100644
index b17875a..0000000
--- a/includes/Smarty/sysplugins/smarty_method_unregister_resource.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
-* Smarty method Unregister_Resource
-*
-* Unregister a template resource
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Unregister a template resource
-*/
-
-/**
-* Unregisters a resource
-*
-* @param string $type name of resource
-*/
-function Smarty_Method_Unregister_Resource($smarty, $type)
-{
- unset($smarty->plugins['resource'][$type]);
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_method_unregister_variablefilter.php b/includes/Smarty/sysplugins/smarty_method_unregister_variablefilter.php
deleted file mode 100644
index 032943b..0000000
--- a/includes/Smarty/sysplugins/smarty_method_unregister_variablefilter.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/**
-* Smarty method Unregister_Variablefilter
-*
-* Unregister a variablefilter
-*
-* @package Smarty
-* @subpackage SmartyMethod
-* @author Uwe Tews
-*/
-
-/**
-* Unregister a variablefilter
-*/
-
-/**
-* Unregisters a variablefilter function
-*
-* @param callback $function
-*/
-function Smarty_Method_Unregister_Variablefilter($smarty, $function)
-{
- unset($smarty->registered_filters['variable'][$smarty->_get_filter_name($function)]);
-}
-
-?>
diff --git a/includes/Smarty/sysplugins/smarty_resource.php b/includes/Smarty/sysplugins/smarty_resource.php
new file mode 100755
index 0000000..f79373a
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_resource.php
@@ -0,0 +1,860 @@
+<?php
+/**
+ * Smarty Resource Plugin
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Rodney Rehm
+ */
+
+/**
+ * Smarty Resource Plugin
+ *
+ * Base implementation for resource plugins
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ */
+abstract class Smarty_Resource {
+ /**
+ * cache for Smarty_Template_Source instances
+ * @var array
+ */
+ public static $sources = array();
+ /**
+ * cache for Smarty_Template_Compiled instances
+ * @var array
+ */
+ public static $compileds = array();
+ /**
+ * cache for Smarty_Resource instances
+ * @var array
+ */
+ public static $resources = array();
+ /**
+ * resource types provided by the core
+ * @var array
+ */
+ protected static $sysplugins = array(
+ 'file' => true,
+ 'string' => true,
+ 'extends' => true,
+ 'stream' => true,
+ 'eval' => true,
+ 'php' => true
+ );
+
+ /**
+ * Name of the Class to compile this resource's contents with
+ * @var string
+ */
+ public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler';
+
+ /**
+ * Name of the Class to tokenize this resource's contents with
+ * @var string
+ */
+ public $template_lexer_class = 'Smarty_Internal_Templatelexer';
+
+ /**
+ * Name of the Class to parse this resource's contents with
+ * @var string
+ */
+ public $template_parser_class = 'Smarty_Internal_Templateparser';
+
+ /**
+ * Load template's source into current template object
+ *
+ * {@internal The loaded source is assigned to $_template->source->content directly.}}
+ *
+ * @param Smarty_Template_Source $source source object
+ * @return string template source
+ * @throws SmartyException if source cannot be loaded
+ */
+ public abstract function getContent(Smarty_Template_Source $source);
+
+ /**
+ * populate Source Object with meta data from Resource
+ *
+ * @param Smarty_Template_Source $source source object
+ * @param Smarty_Internal_Template $_template template object
+ */
+ public abstract function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null);
+
+ /**
+ * populate Source Object with timestamp and exists from Resource
+ *
+ * @param Smarty_Template_Source $source source object
+ */
+ public function populateTimestamp(Smarty_Template_Source $source)
+ {
+ // intentionally left blank
+ }
+
+
+ /**
+ * modify resource_name according to resource handlers specifications
+ *
+ * @param Smarty $smarty Smarty instance
+ * @param string $resource_name resource_name to make unique
+ * @return string unique resource name
+ */
+ protected function buildUniqueResourceName(Smarty $smarty, $resource_name)
+ {
+ return get_class($this) . '#' . $smarty->joined_template_dir . '#' . $resource_name;
+ }
+
+ /**
+ * populate Compiled Object with compiled filepath
+ *
+ * @param Smarty_Template_Compiled $compiled compiled object
+ * @param Smarty_Internal_Template $_template template object
+ */
+ public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)
+ {
+ $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w\|]+!', '_', $_template->compile_id) : null;
+ $_filepath = $compiled->source->uid;
+ // if use_sub_dirs, break file into directories
+ if ($_template->smarty->use_sub_dirs) {
+ $_filepath = substr($_filepath, 0, 2) . DS
+ . substr($_filepath, 2, 2) . DS
+ . substr($_filepath, 4, 2) . DS
+ . $_filepath;
+ }
+ $_compile_dir_sep = $_template->smarty->use_sub_dirs ? DS : '^';
+ if (isset($_compile_id)) {
+ $_filepath = $_compile_id . $_compile_dir_sep . $_filepath;
+ }
+ // caching token
+ if ($_template->caching) {
+ $_cache = '.cache';
+ } else {
+ $_cache = '';
+ }
+ $_compile_dir = $_template->smarty->getCompileDir();
+ // set basename if not specified
+ $_basename = $this->getBasename($compiled->source);
+ if ($_basename === null) {
+ $_basename = basename( preg_replace('![^\w\/]+!', '_', $compiled->source->name) );
+ }
+ // separate (optional) basename by dot
+ if ($_basename) {
+ $_basename = '.' . $_basename;
+ }
+
+ $compiled->filepath = $_compile_dir . $_filepath . '.' . $compiled->source->type . $_basename . $_cache . '.php';
+ }
+
+ /**
+ * Normalize Paths "foo/../bar" to "bar"
+ *
+ * @param string $_path path to normalize
+ * @param boolean $ds respect windows directory separator
+ * @return string normalized path
+ */
+ protected function normalizePath($_path, $ds=true)
+ {
+ if ($ds) {
+ // don't we all just love windows?
+ $_path = str_replace('\\', '/', $_path);
+ }
+
+ // resolve simples
+ $_path = preg_replace('#(/\./(\./)*)|/{2,}#', '/', $_path);
+ // resolve parents
+ while (true) {
+ $_parent = strpos($_path, '/../');
+ if ($_parent === false) {
+ break;
+ } else if ($_parent === 0) {
+ $_path = substr($_path, 3);
+ break;
+ }
+
+ $_pos = strrpos($_path, '/', $_parent - strlen($_path) - 1);
+ if ($_pos === false) {
+ // don't we all just love windows?
+ $_pos = $_parent;
+ }
+
+ $_path = substr_replace($_path, '', $_pos, $_parent + 3 - $_pos);
+ }
+
+ if ($ds && DS != '/') {
+ // don't we all just love windows?
+ $_path = str_replace('/', '\\', $_path);
+ }
+
+ return $_path;
+ }
+
+ /**
+ * build template filepath by traversing the template_dir array
+ *
+ * @param Smarty_Template_Source $source source object
+ * @param Smarty_Internal_Template $_template template object
+ * @return string fully qualified filepath
+ * @throws SmartyException if default template handler is registered but not callable
+ */
+ protected function buildFilepath(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
+ {
+ $file = $source->name;
+ if ($source instanceof Smarty_Config_Source) {
+ $_directories = $source->smarty->getConfigDir();
+ $_default_handler = $source->smarty->default_config_handler_func;
+ } else {
+ $_directories = $source->smarty->getTemplateDir();
+ $_default_handler = $source->smarty->default_template_handler_func;
+ }
+
+ // go relative to a given template?
+ $_file_is_dotted = $file[0] == '.' && ($file[1] == '.' || $file[1] == '/' || $file[1] == "\\");
+ if ($_template && $_template->parent instanceof Smarty_Internal_Template && $_file_is_dotted) {
+ if ($_template->parent->source->type != 'file' && $_template->parent->source->type != 'extends' && !$_template->parent->allow_relative_path) {
+ throw new SmartyException("Template '{$file}' cannot be relative to template of resource type '{$_template->parent->source->type}'");
+ }
+ $file = dirname($_template->parent->source->filepath) . DS . $file;
+ $_file_exact_match = true;
+ if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $file)) {
+ // the path gained from the parent template is relative to the current working directory
+ // as expansions (like include_path) have already been done
+ $file = getcwd() . DS . $file;
+ }
+ }
+
+ // resolve relative path
+ if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $file)) {
+ // don't we all just love windows?
+ $_path = str_replace('\\', '/', $file);
+ $_was_relative_prefix = $file[0] == '.' ? substr($file, 0, strpos($_path, '/')) : null;
+ $_path = DS . trim($file, '/');
+ $_was_relative = true;
+ } else {
+ // don't we all just love windows?
+ $_path = str_replace('\\', '/', $file);
+ }
+ $_path = $this->normalizePath($_path, false);
+ if (DS != '/') {
+ // don't we all just love windows?
+ $_path = str_replace('/', '\\', $_path);
+ }
+ // revert to relative
+ if (isset($_was_relative)) {
+ if (isset($_was_relative_prefix)){
+ $_path = $_was_relative_prefix . $_path;
+ } else {
+ $_path = substr($_path, 1);
+ }
+ }
+
+ // this is only required for directories
+ $file = rtrim($_path, '/\\');
+
+ // files relative to a template only get one shot
+ if (isset($_file_exact_match)) {
+ return $this->fileExists($source, $file) ? $file : false;
+ }
+
+ // template_dir index?
+ if (preg_match('#^\[(?P<key>[^\]]+)\](?P<file>.+)$#', $file, $match)) {
+ $_directory = null;
+ // try string indexes
+ if (isset($_directories[$match['key']])) {
+ $_directory = $_directories[$match['key']];
+ } else if (is_numeric($match['key'])) {
+ // try numeric index
+ $match['key'] = (int) $match['key'];
+ if (isset($_directories[$match['key']])) {
+ $_directory = $_directories[$match['key']];
+ } else {
+ // try at location index
+ $keys = array_keys($_directories);
+ $_directory = $_directories[$keys[$match['key']]];
+ }
+ }
+
+ if ($_directory) {
+ $_file = substr($file, strpos($file, ']') + 1);
+ $_filepath = $_directory . $_file;
+ if ($this->fileExists($source, $_filepath)) {
+ return $_filepath;
+ }
+ }
+ }
+
+ $_stream_resolve_include_path = function_exists('stream_resolve_include_path');
+
+ // relative file name?
+ if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $file)) {
+ foreach ($_directories as $_directory) {
+ $_filepath = $_directory . $file;
+ if ($this->fileExists($source, $_filepath)) {
+ return $this->normalizePath($_filepath);
+ }
+ if ($source->smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_directory)) {
+ // try PHP include_path
+ if ($_stream_resolve_include_path) {
+ $_filepath = stream_resolve_include_path($_filepath);
+ } else {
+ $_filepath = Smarty_Internal_Get_Include_Path::getIncludePath($_filepath);
+ }
+
+ if ($_filepath !== false) {
+ if ($this->fileExists($source, $_filepath)) {
+ return $this->normalizePath($_filepath);
+ }
+ }
+ }
+ }
+ }
+
+ // try absolute filepath
+ if ($this->fileExists($source, $file)) {
+ return $file;
+ }
+
+ // no tpl file found
+ if ($_default_handler) {
+ if (!is_callable($_default_handler)) {
+ if ($source instanceof Smarty_Config_Source) {
+ throw new SmartyException("Default config handler not callable");
+ } else {
+ throw new SmartyException("Default template handler not callable");
+ }
+ }
+ $_return = call_user_func_array($_default_handler,
+ array($source->type, $source->name, &$_content, &$_timestamp, $source->smarty));
+ if (is_string($_return)) {
+ $source->timestamp = @filemtime($_return);
+ $source->exists = !!$source->timestamp;
+ return $_return;
+ } elseif ($_return === true) {
+ $source->content = $_content;
+ $source->timestamp = $_timestamp;
+ $source->exists = true;
+ return $_filepath;
+ }
+ }
+
+ // give up
+ return false;
+ }
+
+ /**
+ * test is file exists and save timestamp
+ *
+ * @param Smarty_Template_Source $source source object
+ * @param string $file file name
+ * @return bool true if file exists
+ */
+ protected function fileExists(Smarty_Template_Source $source, $file)
+ {
+ $source->timestamp = @filemtime($file);
+ return $source->exists = !!$source->timestamp;
+
+ }
+
+ /**
+ * Determine basename for compiled filename
+ *
+ * @param Smarty_Template_Source $source source object
+ * @return string resource's basename
+ */
+ protected function getBasename(Smarty_Template_Source $source)
+ {
+ return null;
+ }
+
+ /**
+ * Load Resource Handler
+ *
+ * @param Smarty $smarty smarty object
+ * @param string $type name of the resource
+ * @return Smarty_Resource Resource Handler
+ */
+ public static function load(Smarty $smarty, $type)
+ {
+ // try smarty's cache
+ if (isset($smarty->_resource_handlers[$type])) {
+ return $smarty->_resource_handlers[$type];
+ }
+
+ // try registered resource
+ if (isset($smarty->registered_resources[$type])) {
+ if ($smarty->registered_resources[$type] instanceof Smarty_Resource) {
+ $smarty->_resource_handlers[$type] = $smarty->registered_resources[$type];
+ // note registered to smarty is not kept unique!
+ return $smarty->_resource_handlers[$type];
+ }
+
+ if (!isset(self::$resources['registered'])) {
+ self::$resources['registered'] = new Smarty_Internal_Resource_Registered();
+ }
+ if (!isset($smarty->_resource_handlers[$type])) {
+ $smarty->_resource_handlers[$type] = self::$resources['registered'];
+ }
+
+ return $smarty->_resource_handlers[$type];
+ }
+
+ // try sysplugins dir
+ if (isset(self::$sysplugins[$type])) {
+ if (!isset(self::$resources[$type])) {
+ $_resource_class = 'Smarty_Internal_Resource_' . ucfirst($type);
+ self::$resources[$type] = new $_resource_class();
+ }
+ return $smarty->_resource_handlers[$type] = self::$resources[$type];
+ }
+
+ // try plugins dir
+ $_resource_class = 'Smarty_Resource_' . ucfirst($type);
+ if ($smarty->loadPlugin($_resource_class)) {
+ if (isset(self::$resources[$type])) {
+ return $smarty->_resource_handlers[$type] = self::$resources[$type];
+ }
+
+ if (class_exists($_resource_class, false)) {
+ self::$resources[$type] = new $_resource_class();
+ return $smarty->_resource_handlers[$type] = self::$resources[$type];
+ } else {
+ $smarty->registerResource($type, array(
+ "smarty_resource_{$type}_source",
+ "smarty_resource_{$type}_timestamp",
+ "smarty_resource_{$type}_secure",
+ "smarty_resource_{$type}_trusted"
+ ));
+
+ // give it another try, now that the resource is registered properly
+ return self::load($smarty, $type);
+ }
+ }
+
+ // try streams
+ $_known_stream = stream_get_wrappers();
+ if (in_array($type, $_known_stream)) {
+ // is known stream
+ if (is_object($smarty->security_policy)) {
+ $smarty->security_policy->isTrustedStream($type);
+ }
+ if (!isset(self::$resources['stream'])) {
+ self::$resources['stream'] = new Smarty_Internal_Resource_Stream();
+ }
+ return $smarty->_resource_handlers[$type] = self::$resources['stream'];
+ }
+
+ // TODO: try default_(template|config)_handler
+
+ // give up
+ throw new SmartyException("Unkown resource type '{$type}'");
+ }
+
+ /**
+ * extract resource_type and resource_name from template_resource and config_resource
+ *
+ * @note "C:/foo.tpl" was forced to file resource up till Smarty 3.1.3 (including).
+ * @param string $resource_name template_resource or config_resource to parse
+ * @param string $default_resource the default resource_type defined in $smarty
+ * @param string &$name the parsed resource name
+ * @param string &$type the parsed resource type
+ * @return void
+ */
+ protected static function parseResourceName($resource_name, $default_resource, &$name, &$type)
+ {
+ $parts = explode(':', $resource_name, 2);
+ if (!isset($parts[1]) || !isset($parts[0][1])) {
+ // no resource given, use default
+ // or single character before the colon is not a resource type, but part of the filepath
+ $type = $default_resource;
+ $name = $resource_name;
+ } else {
+ $type = $parts[0];
+ $name = $parts[1];
+ }
+ }
+
+
+ /**
+ * modify resource_name according to resource handlers specifications
+ *
+ * @param Smarty $smarty Smarty instance
+ * @param string $resource_name resource_name to make unique
+ * @return string unique resource name
+ */
+
+ /**
+ * modify template_resource according to resource handlers specifications
+ *
+ * @param string $smarty Smarty instance
+ * @param string $template_resource template_resource to extracate resource handler and name of
+ * @return string unique resource name
+ */
+ public static function getUniqueTemplateName($smarty, $template_resource)
+ {
+ self::parseResourceName($template_resource, $smarty->default_resource_type, $name, $type);
+ // TODO: optimize for Smarty's internal resource types
+ $resource = Smarty_Resource::load($smarty, $type);
+ return $resource->buildUniqueResourceName($smarty, $name);
+ }
+
+ /**
+ * initialize Source Object for given resource
+ *
+ * Either [$_template] or [$smarty, $template_resource] must be specified
+ *
+ * @param Smarty_Internal_Template $_template template object
+ * @param Smarty $smarty smarty object
+ * @param string $template_resource resource identifier
+ * @return Smarty_Template_Source Source Object
+ */
+ public static function source(Smarty_Internal_Template $_template=null, Smarty $smarty=null, $template_resource=null)
+ {
+ if ($_template) {
+ $smarty = $_template->smarty;
+ $template_resource = $_template->template_resource;
+ }
+
+ // parse resource_name, load resource handler, identify unique resource name
+ self::parseResourceName($template_resource, $smarty->default_resource_type, $name, $type);
+ $resource = Smarty_Resource::load($smarty, $type);
+ $unique_resource_name = $resource->buildUniqueResourceName($smarty, $name);
+
+ // check runtime cache
+ $_cache_key = 'template|' . $unique_resource_name;
+ if ($smarty->compile_id) {
+ $_cache_key .= '|'.$smarty->compile_id;
+ }
+ if (isset(self::$sources[$_cache_key])) {
+ return self::$sources[$_cache_key];
+ }
+
+ // create source
+ $source = new Smarty_Template_Source($resource, $smarty, $template_resource, $type, $name, $unique_resource_name);
+ $resource->populate($source, $_template);
+
+ // runtime cache
+ self::$sources[$_cache_key] = $source;
+ return $source;
+ }
+
+ /**
+ * initialize Config Source Object for given resource
+ *
+ * @param Smarty_Internal_Config $_config config object
+ * @return Smarty_Config_Source Source Object
+ */
+ public static function config(Smarty_Internal_Config $_config)
+ {
+ static $_incompatible_resources = array('eval' => true, 'string' => true, 'extends' => true, 'php' => true);
+ $config_resource = $_config->config_resource;
+ $smarty = $_config->smarty;
+
+ // parse resource_name
+ self::parseResourceName($config_resource, $smarty->default_config_type, $name, $type);
+
+ // make sure configs are not loaded via anything smarty can't handle
+ if (isset($_incompatible_resources[$type])) {
+ throw new SmartyException ("Unable to use resource '{$type}' for config");
+ }
+
+ // load resource handler, identify unique resource name
+ $resource = Smarty_Resource::load($smarty, $type);
+ $unique_resource_name = $resource->buildUniqueResourceName($smarty, $name);
+
+ // check runtime cache
+ $_cache_key = 'config|' . $unique_resource_name;
+ if (isset(self::$sources[$_cache_key])) {
+ return self::$sources[$_cache_key];
+ }
+
+ // create source
+ $source = new Smarty_Config_Source($resource, $smarty, $config_resource, $type, $name, $unique_resource_name);
+ $resource->populate($source, null);
+
+ // runtime cache
+ self::$sources[$_cache_key] = $source;
+ return $source;
+ }
+
+}
+
+/**
+ * Smarty Resource Data Object
+ *
+ * Meta Data Container for Template Files
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Rodney Rehm
+ *
+ * @property integer $timestamp Source Timestamp
+ * @property boolean $exists Source Existance
+ * @property boolean $template Extended Template reference
+ * @property string $content Source Content
+ */
+class Smarty_Template_Source {
+
+ /**
+ * Name of the Class to compile this resource's contents with
+ * @var string
+ */
+ public $compiler_class = null;
+
+ /**
+ * Name of the Class to tokenize this resource's contents with
+ * @var string
+ */
+ public $template_lexer_class = null;
+
+ /**
+ * Name of the Class to parse this resource's contents with
+ * @var string
+ */
+ public $template_parser_class = null;
+
+ /**
+ * Unique Template ID
+ * @var string
+ */
+ public $uid = null;
+
+ /**
+ * Template Resource (Smarty_Internal_Template::$template_resource)
+ * @var string
+ */
+ public $resource = null;
+
+ /**
+ * Resource Type
+ * @var string
+ */
+ public $type = null;
+
+ /**
+ * Resource Name
+ * @var string
+ */
+ public $name = null;
+
+ /**
+ * Unique Resource Name
+ * @var string
+ */
+ public $unique_resource = null;
+
+ /**
+ * Source Filepath
+ * @var string
+ */
+ public $filepath = null;
+
+ /**
+ * Source is bypassing compiler
+ * @var boolean
+ */
+ public $uncompiled = null;
+
+ /**
+ * Source must be recompiled on every occasion
+ * @var boolean
+ */
+ public $recompiled = null;
+
+ /**
+ * The Components an extended template is made of
+ * @var array
+ */
+ public $components = null;
+
+ /**
+ * Resource Handler
+ * @var Smarty_Resource
+ */
+ public $handler = null;
+
+ /**
+ * Smarty instance
+ * @var Smarty
+ */
+ public $smarty = null;
+
+ /**
+ * create Source Object container
+ *
+ * @param Smarty_Resource $handler Resource Handler this source object communicates with
+ * @param Smarty $smarty Smarty instance this source object belongs to
+ * @param string $resource full template_resource
+ * @param string $type type of resource
+ * @param string $name resource name
+ * @param string $unique_resource unqiue resource name
+ */
+ public function __construct(Smarty_Resource $handler, Smarty $smarty, $resource, $type, $name, $unique_resource)
+ {
+ $this->handler = $handler; // Note: prone to circular references
+
+ $this->compiler_class = $handler->compiler_class;
+ $this->template_lexer_class = $handler->template_lexer_class;
+ $this->template_parser_class = $handler->template_parser_class;
+ $this->uncompiled = $this->handler instanceof Smarty_Resource_Uncompiled;
+ $this->recompiled = $this->handler instanceof Smarty_Resource_Recompiled;
+
+ $this->smarty = $smarty;
+ $this->resource = $resource;
+ $this->type = $type;
+ $this->name = $name;
+ $this->unique_resource = $unique_resource;
+ }
+
+ /**
+ * get a Compiled Object of this source
+ *
+ * @param Smarty_Internal_Template $_template template objet
+ * @return Smarty_Template_Compiled compiled object
+ */
+ public function getCompiled(Smarty_Internal_Template $_template)
+ {
+ // check runtime cache
+ $_cache_key = $this->unique_resource . '#' . $_template->compile_id;
+ if (isset(Smarty_Resource::$compileds[$_cache_key])) {
+ return Smarty_Resource::$compileds[$_cache_key];
+ }
+
+ $compiled = new Smarty_Template_Compiled($this);
+ $this->handler->populateCompiledFilepath($compiled, $_template);
+ $compiled->timestamp = @filemtime($compiled->filepath);
+ $compiled->exists = !!$compiled->timestamp;
+
+ // runtime cache
+ Smarty_Resource::$compileds[$_cache_key] = $compiled;
+
+ return $compiled;
+ }
+
+ /**
+ * render the uncompiled source
+ *
+ * @param Smarty_Internal_Template $_template template object
+ */
+ public function renderUncompiled(Smarty_Internal_Template $_template)
+ {
+ return $this->handler->renderUncompiled($this, $_template);
+ }
+
+ /**
+ * <<magic>> Generic Setter.
+ *
+ * @param string $property_name valid: timestamp, exists, content, template
+ * @param mixed $value new value (is not checked)
+ * @throws SmartyException if $property_name is not valid
+ */
+ public function __set($property_name, $value)
+ {
+ switch ($property_name) {
+ // regular attributes
+ case 'timestamp':
+ case 'exists':
+ case 'content':
+ // required for extends: only
+ case 'template':
+ $this->$property_name = $value;
+ break;
+
+ default:
+ throw new SmartyException("invalid source property '$property_name'.");
+ }
+ }
+
+ /**
+ * <<magic>> Generic getter.
+ *
+ * @param string $property_name valid: timestamp, exists, content
+ * @return mixed
+ * @throws SmartyException if $property_name is not valid
+ */
+ public function __get($property_name)
+ {
+ switch ($property_name) {
+ case 'timestamp':
+ case 'exists':
+ $this->handler->populateTimestamp($this);
+ return $this->$property_name;
+
+ case 'content':
+ return $this->content = $this->handler->getContent($this);
+
+ default:
+ throw new SmartyException("source property '$property_name' does not exist.");
+ }
+ }
+
+}
+
+/**
+ * Smarty Resource Data Object
+ *
+ * Meta Data Container for Template Files
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Rodney Rehm
+ *
+ * @property string $content compiled content
+ */
+class Smarty_Template_Compiled {
+
+ /**
+ * Compiled Filepath
+ * @var string
+ */
+ public $filepath = null;
+
+ /**
+ * Compiled Timestamp
+ * @var integer
+ */
+ public $timestamp = null;
+
+ /**
+ * Compiled Existance
+ * @var boolean
+ */
+ public $exists = false;
+
+ /**
+ * Compiled Content Loaded
+ * @var boolean
+ */
+ public $loaded = false;
+
+ /**
+ * Template was compiled
+ * @var boolean
+ */
+ public $isCompiled = false;
+
+ /**
+ * Source Object
+ * @var Smarty_Template_Source
+ */
+ public $source = null;
+
+ /**
+ * Metadata properties
+ *
+ * populated by Smarty_Internal_Template::decodeProperties()
+ * @var array
+ */
+ public $_properties = null;
+
+ /**
+ * create Compiled Object container
+ *
+ * @param Smarty_Template_Source $source source object this compiled object belongs to
+ */
+ public function __construct(Smarty_Template_Source $source)
+ {
+ $this->source = $source;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_resource_custom.php b/includes/Smarty/sysplugins/smarty_resource_custom.php
new file mode 100755
index 0000000..9ec1f35
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_resource_custom.php
@@ -0,0 +1,96 @@
+<?php
+/**
+ * Smarty Resource Plugin
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Rodney Rehm
+ */
+
+/**
+ * Smarty Resource Plugin
+ *
+ * Wrapper Implementation for custom resource plugins
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ */
+abstract class Smarty_Resource_Custom extends Smarty_Resource {
+
+ /**
+ * fetch template and its modification time from data source
+ *
+ * @param string $name template name
+ * @param string &$source template source
+ * @param integer &$mtime template modification timestamp (epoch)
+ */
+ protected abstract function fetch($name, &$source, &$mtime);
+
+ /**
+ * Fetch template's modification timestamp from data source
+ *
+ * {@internal implementing this method is optional.
+ * Only implement it if modification times can be accessed faster than loading the complete template source.}}
+ *
+ * @param string $name template name
+ * @return integer|boolean timestamp (epoch) the template was modified, or false if not found
+ */
+ protected function fetchTimestamp($name)
+ {
+ return null;
+ }
+
+ /**
+ * populate Source Object with meta data from Resource
+ *
+ * @param Smarty_Template_Source $source source object
+ * @param Smarty_Internal_Template $_template template object
+ */
+ public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null)
+ {
+ $source->filepath = strtolower($source->type . ':' . $source->name);
+ $source->uid = sha1($source->type . ':' . $source->name);
+
+ $mtime = $this->fetchTimestamp($source->name);
+ if ($mtime !== null) {
+ $source->timestamp = $mtime;
+ } else {
+ $this->fetch($source->name, $content, $timestamp);
+ $source->timestamp = isset($timestamp) ? $timestamp : false;
+ if( isset($content) )
+ $source->content = $content;
+ }
+ $source->exists = !!$source->timestamp;
+ }
+
+ /**
+ * Load template's source into current template object
+ *
+ * @param Smarty_Template_Source $source source object
+ * @return string template source
+ * @throws SmartyException if source cannot be loaded
+ */
+ public function getContent(Smarty_Template_Source $source)
+ {
+ $this->fetch($source->name, $content, $timestamp);
+ if (isset($content)) {
+ return $content;
+ }
+
+ throw new SmartyException("Unable to read template {$source->type} '{$source->name}'");
+ }
+
+ /**
+ * Determine basename for compiled filename
+ *
+ * @param Smarty_Template_Source $source source object
+ * @return string resource's basename
+ */
+ protected function getBasename(Smarty_Template_Source $source)
+ {
+ return basename($source->name);
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_resource_recompiled.php b/includes/Smarty/sysplugins/smarty_resource_recompiled.php
new file mode 100755
index 0000000..ab55b93
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_resource_recompiled.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Smarty Resource Plugin
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Rodney Rehm
+ */
+
+/**
+ * Smarty Resource Plugin
+ *
+ * Base implementation for resource plugins that don't compile cache
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ */
+abstract class Smarty_Resource_Recompiled extends Smarty_Resource {
+
+ /**
+ * populate Compiled Object with compiled filepath
+ *
+ * @param Smarty_Template_Compiled $compiled compiled object
+ * @param Smarty_Internal_Template $_template template object
+ * @return void
+ */
+ public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)
+ {
+ $compiled->filepath = false;
+ $compiled->timestamp = false;
+ $compiled->exists = false;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_resource_uncompiled.php b/includes/Smarty/sysplugins/smarty_resource_uncompiled.php
new file mode 100755
index 0000000..ea80235
--- /dev/null
+++ b/includes/Smarty/sysplugins/smarty_resource_uncompiled.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Smarty Resource Plugin
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Rodney Rehm
+ */
+
+/**
+ * Smarty Resource Plugin
+ *
+ * Base implementation for resource plugins that don't use the compiler
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ */
+abstract class Smarty_Resource_Uncompiled extends Smarty_Resource {
+
+ /**
+ * Render and output the template (without using the compiler)
+ *
+ * @param Smarty_Template_Source $source source object
+ * @param Smarty_Internal_Template $_template template object
+ * @throws SmartyException on failure
+ */
+ public abstract function renderUncompiled(Smarty_Template_Source $source, Smarty_Internal_Template $_template);
+
+ /**
+ * populate compiled object with compiled filepath
+ *
+ * @param Smarty_Template_Compiled $compiled compiled object
+ * @param Smarty_Internal_Template $_template template object (is ignored)
+ */
+ public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)
+ {
+ $compiled->filepath = false;
+ $compiled->timestamp = false;
+ $compiled->exists = false;
+ }
+
+}
+
+?>
\ No newline at end of file
diff --git a/includes/Smarty/sysplugins/smarty_security.php b/includes/Smarty/sysplugins/smarty_security.php
deleted file mode 100644
index 5464c0d..0000000
--- a/includes/Smarty/sysplugins/smarty_security.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage Security
-* @author Uwe Tews
-*/
-
-/**
-* This class does contain the security settings
-*/
-class Smarty_Security {
- /**
- * This determines how Smarty handles "<?php ... ?>" tags in templates.
- * possible values:
- * <ul>
- * <li>SMARTY_PHP_PASSTHRU -> echo PHP tags as they are</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
- */
- public $php_handling = SMARTY_PHP_PASSTHRU;
-
- /**
- * This is the list of template directories that are considered secure.
- * One directory per array element.
- * $template_dir is in this list implicitly.
- *
- * @var array
- */
- public $secure_dir = array();
-
-
- /**
- * This is an array of directories where trusted php scripts reside.
- * {@link $security} is disabled during their inclusion/execution.
- *
- * @var array
- */
- public $trusted_dir = array();
-
-
- /**
- * This is an array of trusted PHP functions.
- *
- * If empty all functions are allowed.
- * If set to 'none' none is allowed.
- * @var array
- */
- public $php_functions = array('isset', 'empty',
- 'count', 'sizeof','in_array', 'is_array','time','nl2br');
-
- /**
- * This is an array of trusted modifers.
- *
- * If empty all modifiers are allowed.
- * If set to 'none' none is allowed.
- * @var array
- */
- public $modifiers = array('escape','count');
-
- /**
- * This is an array of trusted streams.
- *
- * If empty all streams are allowed.
- * If set to 'none' none is allowed.
- * @var array
- */
- public $streams = array('file');
- /**
- + flag if constants can be accessed from template
- */
- public $allow_constants = true;
- /**
- + flag if {php} tag can be executed
- */
- public $allow_php_tag = false;
-}
-
-?>

File Metadata

Mime Type
text/x-diff
Expires
Mon, Nov 11, 11:18 (2 w, 1 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
21066
Default Alt Text
(964 KB)

Event Timeline