summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d6336a0)
raw | patch | inline | side by side (parent: d6336a0)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 26 Jul 2011 13:01:27 +0000 (13:01 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 26 Jul 2011 13:01:27 +0000 (13:01 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@20950 594d385d-05f5-0310-b6e9-bd551577e9d8
106 files changed:
index 6f28857311f6063262a09a46f4f2f370d34d8c90..c0bc78bb5a102f7abf61d1b4344656616f3fec56 100644 (file)
<?php
/**
-* Project: Smarty: the PHP compiling template engine
-* File: Smarty.class.php
-* SVN: $Id: Smarty.class.php 3420 2009-12-29 20:12:11Z 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 $
-*/
+ * Project: Smarty: the PHP compiling template engine
+ * File: Smarty.class.php
+ * SVN: $Id: Smarty.class.php 4074 2011-04-22 02:19:14Z uwe.tews@googlemail.com $
+ *
+ * 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.0.8
+ */
/**
-* define shorthand directory separator constant
-*/
+ * 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.
-*/
+ * 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.
-*/
+ * 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
-*/
+ * 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
-*/
+ * This is the main Smarty class
+ */
class Smarty extends Smarty_Internal_Data {
+ /**
+ * constant definitions
+ */
// smarty version
- const SMARTY_VERSION = 'Smarty3-b7';
+ const SMARTY_VERSION = 'Smarty-3.0.8';
+ //define variable scopes
+ const SCOPE_LOCAL = 0;
+ const SCOPE_PARENT = 1;
+ const SCOPE_ROOT = 2;
+ const SCOPE_GLOBAL = 3;
+ // define caching modes
+ const CACHING_OFF = 0;
+ const CACHING_LIFETIME_CURRENT = 1;
+ const CACHING_LIFETIME_SAVED = 2;
+ /** modes for handling of "<?php ... ?>" tags in templates. **/
+ const PHP_PASSTHRU = 0; //-> print tags as plain text
+ const PHP_QUOTE = 1; //-> escape tags as entities
+ const PHP_REMOVE = 2; //-> escape tags as entities
+ const PHP_ALLOW = 3; //-> escape tags as entities
+ // filter types
+ const FILTER_POST = 'post';
+ const FILTER_PRE = 'pre';
+ const FILTER_OUTPUT = 'output';
+ const FILTER_VARIABLE = 'variable';
+ // plugin types
+ const PLUGIN_FUNCTION = 'function';
+ const PLUGIN_BLOCK = 'block';
+ const PLUGIN_COMPILER = 'compiler';
+ const PLUGIN_MODIFIER = 'modifier';
+
+ /**
+ * static variables
+ */
+ // assigned global tpl vars
+ static $global_tpl_vars = array();
+
+ /**
+ * variables
+ */
// auto literal on delimiters with whitspace
- public $auto_literal = true;
+ public $auto_literal = true;
// display error on not assigned variables
- public $error_unassigned = false;
+ public $error_unassigned = false;
// template directory
- public $template_dir = null;
+ public $template_dir = null;
// default template handler
- public $default_template_handler_func = null;
+ public $default_template_handler_func = null;
// compile directory
- public $compile_dir = null;
+ public $compile_dir = null;
// plugins directory
- public $plugins_dir = null;
+ public $plugins_dir = null;
// cache directory
- public $cache_dir = null;
+ public $cache_dir = null;
// config directory
- public $config_dir = null;
+ public $config_dir = null;
// force template compiling?
- public $force_compile = false;
+ public $force_compile = false;
// check template for modifications?
- public $compile_check = true;
+ public $compile_check = true;
+ // locking concurrent compiles
+ public $compile_locking = true;
// use sub dirs for compiled/cached files?
- public $use_sub_dirs = false;
+ public $use_sub_dirs = false;
// compile_error?
- public $compile_error = false;
+ public $compile_error = false;
// caching enabled
- public $caching = false;
- // merge compiled includea
- public $merge_compiled_includes = false;
+ public $caching = false;
+ // merge compiled includes
+ public $merge_compiled_includes = false;
// cache lifetime
- public $cache_lifetime = 3600;
+ public $cache_lifetime = 3600;
// force cache file creation
- public $force_cache = false;
+ public $force_cache = false;
// cache_id
- public $cache_id = null;
+ public $cache_id = null;
// compile_id
- public $compile_id = null;
+ public $compile_id = null;
// template delimiters
public $left_delimiter = "{";
- public $right_delimiter = "}";
+ public $right_delimiter = "}";
// security
public $security_class = 'Smarty_Security';
- public $php_handling = SMARTY_PHP_PASSTHRU;
+ public $security_policy = null;
+ public $php_handling = self::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;
+ public $direct_access_security = true;
+ public $trusted_dir = array();
// debug mode
public $debugging = false;
- public $debugging_ctrl = 'URL';
+ public $debugging_ctrl = 'NONE';
public $smarty_debug_id = 'SMARTY_DEBUG';
- public $debug_tpl = null;
+ public $debug_tpl = null;
// When set, smarty does uses this value as error_reporting-level.
- public $error_reporting = null;
+ 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.
+ public $config_read_hidden = false; //Controls whether hidden config sections/vars are read from the file.
// config vars
- public $config_vars = array();
+ public $config_vars = array();
// assigned tpl vars
- public $tpl_vars = array();
- // assigned global tpl vars
- public $global_tpl_vars = array();
+ public $tpl_vars = array();
// dummy parent object
- public $parent = null;
+ public $parent = null;
// global template functions
- public $template_functions = array();
+ public $template_functions = array();
// resource type used if none given
- public $default_resource_type = 'file';
+ public $default_resource_type = 'file';
// caching type
- public $caching_type = 'file';
+ public $caching_type = 'file';
// internal cache resource types
- public $cache_resource_types = array('file');
+ public $cache_resource_types = array('file');
+ // internal config properties
+ public $properties = array();
// config type
- public $default_config_type = 'file';
- // exception handler: array('ExceptionClass','ExceptionMethod');
- public $exception_handler = null;
+ public $default_config_type = 'file';
// cached template objects
- public $template_objects = null;
+ public $template_objects = null;
// check If-Modified-Since headers
- public $cache_modified_check = false;
+ public $cache_modified_check = false;
// registered plugins
- public $registered_plugins = array();
+ public $registered_plugins = array();
// plugin search order
- public $plugin_search_order = array('function', 'block', 'compiler', 'class');
+ public $plugin_search_order = array('function', 'block', 'compiler', 'class');
// registered objects
- public $registered_objects = array();
+ public $registered_objects = array();
+ // registered classes
+ public $registered_classes = array();
// registered filters
- public $registered_filters = array();
+ public $registered_filters = array();
+ // registered resources
+ public $registered_resources = array();
// autoload filter
- public $autoload_filters = array();
+ public $autoload_filters = array();
// status of filter on variable output
- public $variable_filter = true;
+ public $variable_filter = true;
+ // default modifier
+ public $default_modifiers = array();
// global internal smarty vars
- public $_smarty_vars = array();
+ static $_smarty_vars = array();
// start time for execution time calculation
- public $start_time = 0;
+ public $start_time = 0;
// default file permissions
- public $_file_perms = 0644;
+ public $_file_perms = 0644;
// default dir permissions
- public $_dir_perms = 0771;
- // smarty object reference
- public $smarty = null;
+ public $_dir_perms = 0771;
+ // block tag hierarchy
+ public $_tag_stack = array();
+ // flag if {block} tag is compiled for template inheritance
+ public $inheritance = false;
+ // generate deprecated function call notices?
+ public $deprecation_notices = true;
+ // Smarty 2 BC
+ public $_version = self::SMARTY_VERSION;
+ // self pointer to Smarty object
+ public $smarty;
/**
- * Class constructor, initializes basic smarty properties
- */
- public function __construct() {
- // self reference needed by other classes methods
- $this->smarty = $this;
-
+ * Class constructor, initializes basic smarty properties
+ */
+ public function __construct()
+ {
+ // selfpointer need by some other class 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);
+ }
+ $this->start_time = microtime(true);
// 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->debug_tpl = 'file:' . SMARTY_DIR . 'debug.tpl';
+ if (isset($_SERVER['SCRIPT_NAME'])) {
+ $this->assignGlobal('SCRIPT_NAME', $_SERVER['SCRIPT_NAME']);
+ }
+ }
+
+ /**
+ * Class destructor
+ */
+ public function __destruct()
+ {
+ }
+
+ /**
+ * 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, $display = false)
+ {
+ if (!empty($cache_id) && 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, false);
+ if (isset($this->error_reporting)) {
+ $_smarty_old_error_level = error_reporting($this->error_reporting);
+ }
+ // check URL debugging control
if (!$this->debugging && $this->debugging_ctrl == 'URL') {
if (isset($_SERVER['QUERY_STRING'])) {
$_query_string = $_SERVER['QUERY_STRING'];
- }
- else {
+ } 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')) {
+ } elseif (false !== strpos($_query_string, $this->smarty_debug_id . '=off')) {
// disable debugging for this browser session
setcookie('SMARTY_DEBUG', false);
$this->debugging = false;
- }
- else {
+ } else {
// enable debugging for this page
$this->debugging = true;
- }
- }
- else {
+ }
+ } else {
if (isset($_COOKIE['SMARTY_DEBUG'])) {
$this->debugging = true;
- }
- }
- }
- $this->assign_global('SCRIPT_NAME', $_SERVER['SCRIPT_NAME']);
- }
+ }
+ }
+ }
+ // obtain data for cache modified check
+ if ($this->cache_modified_check && $this->caching && $display) {
+ $_isCached = $_template->isCached() && !$_template->has_nocache_code;
+ if ($_isCached) {
+ $_gmt_mtime = gmdate('D, d M Y H:i:s', $_template->getCachedTimestamp()) . ' GMT';
+ } else {
+ $_gmt_mtime = '';
+ }
+ }
+ // return rendered template
+ if ((!$this->caching || $_template->resource_object->isEvaluated) && (isset($this->autoload_filters['output']) || isset($this->registered_filters['output']))) {
+ $_output = Smarty_Internal_Filter_Handler::runFilter('output', $_template->getRenderedTemplate(), $_template);
+ } else {
+ $_output = $_template->getRenderedTemplate();
+ }
+ $_template->rendered_content = null;
+ if (isset($this->error_reporting)) {
+ error_reporting($_smarty_old_error_level);
+ }
+ // display or fetch
+ if ($display) {
+ if ($this->caching && $this->cache_modified_check) {
+ $_last_modified_date = @substr($_SERVER['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_SERVER['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3);
+ if ($_isCached && $_gmt_mtime == $_last_modified_date) {
+ if (php_sapi_name() == 'cgi')
+ header('Status: 304 Not Modified');
+ else
+ header('HTTP/1.1 304 Not Modified');
+ } else {
+ header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $_template->getCachedTimestamp()) . ' GMT');
+ echo $_output;
+ }
+ } else {
+ echo $_output;
+ }
+ // debug output
+ if ($this->debugging) {
+ Smarty_Internal_Debug::display_debug($this);
+ }
+ return;
+ } else {
+ // return fetched content
+ return $_output;
+ }
+ }
/**
- * Class destructor
- */
- public function __destruct() {
- // restore to previous exception handler, if any
- if (!empty($this->exception_handler))
- restore_exception_handler();
- }
+ * 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
+ $this->fetch ($template, $cache_id, $compile_id, $parent, true);
+ }
/**
- * 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)) {
+ * 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
+ * @param object $parent next higher level of Smarty variables
+ * @return boolean cache status
+ */
+ public function isCached($template, $cache_id = null, $compile_id = null, $parent = null)
+ {
+ if ($parent === null) {
+ $parent = $this;
+ }
+ if (!($template instanceof $this->template_class)) {
+ $template = $this->createTemplate ($template, $cache_id, $compile_id, $parent, false);
+ }
+ // return cache status of template
+ return $template->isCached();
+ }
+
+ /**
+ * creates a data object
+ *
+ * @param object $parent next higher level of Smarty variables
+ * @returns object data object
+ */
+ public function createData($parent = null)
+ {
+ return new Smarty_Data($parent, $this);
+ }
+
+ /**
+ * creates a template object
+ *
+ * @param string $template 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
+ * @param object $parent next higher level of Smarty variables
+ * @param boolean $do_clone flag is Smarty object shall be cloned
+ * @returns object template object
+ */
+ public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true)
+ {
+ if (!empty($cache_id) && (is_object($cache_id) || is_array($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 = Smarty_Internal_Filter_Handler::runFilter('output', $_template->getRenderedTemplate(), $this);
- }
- else {
- $_output = $_template->getRenderedTemplate();
- }
- $_template->rendered_content = null;
- error_reporting($_smarty_old_error_level);
- return $_output;
- }
+ }
+ if (!empty($parent) && is_array($parent)) {
+ $data = $parent;
+ $parent = null;
+ } else {
+ $data = null;
+ }
+ if (!is_object($template)) {
+ // we got a template resource
+ // already in template cache?
+ $_templateId = sha1($template . $cache_id . $compile_id);
+ if (isset($this->template_objects[$_templateId]) && $this->caching) {
+ // return cached template object
+ $tpl = $this->template_objects[$_templateId];
+ } else {
+ // create new template object
+ if ($do_clone) {
+ $tpl = new $this->template_class($template, clone $this, $parent, $cache_id, $compile_id);
+ } else {
+ $tpl = new $this->template_class($template, $this, $parent, $cache_id, $compile_id);
+ }
+ }
+ } else {
+ // just return a copy of template class
+ $tpl = $template;
+ }
+ // fill data if present
+ if (!empty($data) && is_array($data)) {
+ // set up variable values
+ foreach ($data as $_key => $_val) {
+ $tpl->tpl_vars[$_key] = new Smarty_variable($_val);
+ }
+ }
+ return $tpl;
+ }
+
+
+
+ /**
+ * Check if a template resource exists
+ *
+ * @param string $resource_name template name
+ * @return boolean status
+ */
+ function templateExists($resource_name)
+ {
+ // create template object
+ $save = $this->template_objects;
+ $tpl = new $this->template_class($resource_name, $this);
+ // check if it does exists
+ $result = $tpl->isExisting();
+ $this->template_objects = $save;
+ return $result;
+ }
+
+ /**
+ * 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 getGlobal($varname = null)
+ {
+ if (isset($varname)) {
+ if (isset(self::$global_tpl_vars[$varname])) {
+ return self::$global_tpl_vars[$varname]->value;
+ } else {
+ return '';
+ }
+ } else {
+ $_result = array();
+ foreach (self::$global_tpl_vars AS $key => $var) {
+ $_result[$key] = $var->value;
+ }
+ return $_result;
+ }
+ }
/**
- * 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
+ * Empty cache folder
+ *
+ * @param integer $exp_time expiration time
+ * @param string $type resource type
+ * @return integer number of cache files deleted
*/
- 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;
- }
+ function clearAllCache($exp_time = null, $type = null)
+ {
+ // load cache resource and call clearAll
+ return $this->loadCacheResource($type)->clearAll($exp_time);
+ }
/**
- * 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
+ * Empty cache for a specific template
+ *
+ * @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
*/
- 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();
- }
+ function clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null)
+ {
+ // load cache resource and call clear
+ return $this->loadCacheResource($type)->clear($template_name, $cache_id, $compile_id, $exp_time);
+ }
/**
- * Loads security class and enables security
+ * Loads security class and enables security
+ */
+ public function enableSecurity($security_class = null)
+ {
+ if ($security_class instanceof Smarty_Security) {
+ $this->security_policy = $security_class;
+ return;
+ }
+ if ($security_class == null) {
+ $security_class = $this->security_class;
+ }
+ if (class_exists($security_class)) {
+ $this->security_policy = new $security_class($this);
+ } else {
+ throw new SmartyException("Security class '$security_class' is not defined");
+ }
+ }
+
+ /**
+ * Disable security
+ */
+ public function disableSecurity()
+ {
+ $this->security_policy = null;
+ }
+
+ /**
+ * Loads cache resource.
+ *
+ * @param string $type cache resource type
+ * @return object of cache resource
*/
- 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;
- }
+ public function loadCacheResource($type = null) {
+ if (!isset($type)) {
+ $type = $this->caching_type;
+ }
+ if (in_array($type, $this->cache_resource_types)) {
+ $cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($type);
+ return new $cache_resource_class($this);
+ }
else {
- throw new Exception('Property security_class is not defined');
- }
- }
+ // try plugins dir
+ $cache_resource_class = 'Smarty_CacheResource_' . ucfirst($type);
+ if ($this->loadPlugin($cache_resource_class)) {
+ return new $cache_resource_class($this);
+ }
+ else {
+ throw new SmartyException("Unable to load cache resource '{$type}'");
+ }
+ }
+ }
+
/**
- * Set template directory
- *
- * @param string $ |array $template_dir folder(s) of template sorces
- */
- public function setTemplateDir($template_dir) {
+ * 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);
+ * 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_unique(array_merge((array)$this->template_dir, (array)$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;
+ * Adds directory of plugin files
+ *
+ * @param object $smarty
+ * @param string $ |array $ plugins folder
+ * @return
+ */
+ function addPluginsDir($plugins_dir)
+ {
+ $this->plugins_dir = array_unique(array_merge((array)$this->plugins_dir, (array)$plugins_dir));
return;
- }
+ }
+
+
/**
- * Set cache directory
- *
- * @param string $cache_dir folder of cache files
- */
- public function setCacheDir($cache_dir) {
- $this->cache_dir = $cache_dir;
- return;
- }
+ * return a reference to a registered object
+ *
+ * @param string $name object name
+ * @return object
+ */
+ function getRegisteredObject($name)
+ {
+ if (!isset($this->registered_objects[$name]))
+ throw new SmartyException("'$name' is not a registered object");
+
+ if (!is_object($this->registered_objects[$name][0]))
+ throw new SmartyException("registered '$name' is not an object");
+
+ return $this->registered_objects[$name][0];
+ }
+
+
/**
- * Enable Caching
- */
- public function enableCaching() {
- $this->caching = SMARTY_CACHING_LIFETIME_CURRENT;
- return;
- }
+ * return name of debugging template
+ *
+ * @return string
+ */
+ function getDebugTemplate()
+ {
+ return $this->debug_tpl;
+ }
+
/**
- * Set caching life time
- *
- * @param integer $lifetime lifetime of cached file in seconds
- */
- public function setCacheLifetime($lifetime) {
- $this->cache_lifetime = $lifetime;
- return;
- }
+ * set the debug template
+ *
+ * @param string $tpl_name
+ * @return bool
+ */
+ function setDebugTemplate($tpl_name)
+ {
+ return $this->debug_tpl = $tpl_name;
+ }
+
/**
- * 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 string|boolean filepath of loaded file or false
- */
- public function loadPlugin($plugin_name, $check = true) {
+ * 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 string |boolean filepath of loaded file or false
+ */
+ public function loadPlugin($plugin_name, $check = true)
+ {
// if function or class exists, exit silently (already loaded)
if ($check && (is_callable($plugin_name) || class_exists($plugin_name, false)))
- return true;
+ return true;
// Plugin name is expected to be: Smarty_[Type]_[Name]
$_plugin_name = strtolower($plugin_name);
- $_name_parts = explode('_', $_plugin_name, 3);
+ $_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");
+ throw new SmartyException("plugin {$plugin_name} is not a valid name format");
return false;
- }
+ }
// if type is "internal", get plugin from sysplugins
if ($_name_parts[1] == 'internal') {
$file = SMARTY_SYSPLUGINS_DIR . $_plugin_name . '.php';
if (file_exists($file)) {
require_once($file);
return $file;
- }
- else {
+ } else {
return false;
- }
- }
+ }
+ }
// plugin filename is expected to be: [type].[name].php
- $_plugin_filename = "{$_name_parts[1]}.{$_name_parts[2]}.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;
- }
+ }
$file = $_plugin_dir . $_plugin_filename;
if (file_exists($file)) {
require_once($file);
return $file;
- }
- }
+ }
+ }
// 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);
- }
+ * clean up properties on cloned object
+ */
+ public function __clone()
+ {
+ // clear config vars
+ $this->config_vars = array();
+ // clear assigned tpl vars
+ $this->tpl_vars = array();
+ // clear objects for external methods
+ unset($this->register);
+ unset($this->filter);
+ }
- /**
- * Loads cache resource.
- *
- * @return object of cache resource
- */
- public function loadCacheResource($type = null) {
- if (!isset($type)) {
- $type = $this->caching_type;
- }
- // already loaded?
- if (isset($this->cache_resource_objects[$type])) {
- return $this->cache_resource_objects[$type];
- }
- if (in_array($type, $this->cache_resource_types)) {
- $cache_resource_class = 'Smarty_Internal_CacheResource_' . ucfirst($type);
- return $this->cache_resource_objects[$type] = new $cache_resource_class($this);
- }
- else {
- // try plugins dir
- $cache_resource_class = 'Smarty_CacheResource_' . ucfirst($type);
- if ($this->loadPlugin($cache_resource_class)) {
- return $this->cache_resource_objects[$type] = new $cache_resource_class($this);
- }
- else {
- throw new Exception("Unable to load cache resource '{$type}'");
- }
- }
- }
/**
- * 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");
- }
+ * Handle unknown class methods
+ *
+ * @param string $name unknown methode name
+ * @param array $args aurgument array
+ */
+ public function __call($name, $args)
+ {
+ static $camel_func;
+ if (!isset($camel_func))
+ $camel_func = create_function('$c', 'return "_" . strtolower($c[1]);');
+ // see if this is a set/get for a property
+ $first3 = strtolower(substr($name, 0, 3));
+ if (in_array($first3, array('set', 'get')) && substr($name, 3, 1) !== '_') {
+ // try to keep case correct for future PHP 6.0 case-sensitive class methods
+ // lcfirst() not available < PHP 5.3.0, so improvise
+ $property_name = strtolower(substr($name, 3, 1)) . substr($name, 4);
+ // convert camel case to underscored name
+ $property_name = preg_replace_callback('/([A-Z])/', $camel_func, $property_name);
+ if (!property_exists($this, $property_name)) {
+ throw new SmartyException("property '$property_name' does not exist.");
+ return false;
+ }
+ if ($first3 == 'get')
+ return $this->$property_name;
+ else
+ return $this->$property_name = $args[0];
+ }
+ // Smarty Backward Compatible wrapper
+ if (strpos($name,'_') !== false) {
+ if (!isset($this->wrapper)) {
+ $this->wrapper = new Smarty_Internal_Wrapper($this);
+ }
+ return $this->wrapper->convert($name, $args);
+ }
+ // external Smarty methods ?
+ foreach(array('Filter','Register') as $external) {
+ if (class_exists("Smarty_Internal_{$external}") && method_exists("Smarty_Internal_{$external}",$name)) {
+ if (!isset($this->$external)) {
+ $class = "Smarty_Internal_{$external}";
+ $this->$external = new $class($this);
+ }
+ return call_user_func_array(array($this->$external,$name), $args);
+ }
+ }
+ if (in_array($name,array('clearCompiledTemplate','compileAllTemplates','compileAllConfig','testInstall','getTags'))) {
+ if (!isset($this->utility)) {
+ $this->utility = new Smarty_Internal_Utility($this);
+ }
+ return call_user_func_array(array($this->utility,$name), $args);
+ }
+ // PHP4 call to constructor?
+ if (strtolower($name) == 'smarty') {
+ throw new SmartyException('Please use parent::__construct() to call parent constuctor');
+ return false;
+ }
+ throw new SmartyException("Call of unknown function '$name'.");
+ }
+}
- /**
- * 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) {
+/**
+ * Autoloader
+ */
+function smartyAutoload($class)
+{
$_class = strtolower($class);
if (substr($_class, 0, 16) === 'smarty_internal_' || $_class == 'smarty_security') {
include SMARTY_SYSPLUGINS_DIR . $_class . '.php';
- }
-}
+ }
+}
+
+/**
+ * Smarty exception class
+ */
+Class SmartyException extends Exception {
+}
+
+/**
+ * Smarty compiler exception class
+ */
+Class SmartyCompilerException extends SmartyException {
+}
?>
index 9fd46b15354dd7e8ff322fde55774469118318bd..058c5b204a8a84ac252930b2d9f9abdd4aefe7c2 100644 (file)
-{capture assign=debug_output}
+{capture name='_smarty_debug' 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>
</head>
<body>
-<h1>Smarty Debug Console - Total Time {$execution_time|string_format:"%.5f"}</h1>
+<h1>Smarty Debug Console - {if isset($template_name)}{$template_name|debug_print_var}{else}Total Time {$execution_time|string_format:"%.5f"}{/if}</h1>
+{if !empty($template_data)}
<h2>included templates & config files (load time in seconds)</h2>
<div>
<br>
{/foreach}
</div>
+{/if}
<h2>assigned template variables</h2>
</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");
+{$id = $template_name|default:''|md5}
+ _smarty_console = window.open("","console{$id}","width=680,height=600,resizable,scrollbars=yes");
_smarty_console.document.write("{$debug_output|escape:'javascript'}");
_smarty_console.document.close();
</script>
diff --git a/gosa-core/include/smarty/plugins/block.php.php b/gosa-core/include/smarty/plugins/block.php.php
index d1de74002218e3206d0e4ecba47ef7064d6ffe7c..8fedd8b4352dfc247680d372fd4045100f29c76c 100644 (file)
<?php
/**
-* Smarty plugin to execute PHP code
-*
-* @package Smarty
-* @subpackage PluginsBlock
-* @author Uwe Tews
-*/
+ * 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)
+ * Smarty {php}{/php} block plugin
+ *
+ * @param string $content contents of the block
+ * @param object $template template object
+ * @param boolean $ &$repeat repeat flag
+ * @return string content re-formatted
+ */
+function smarty_block_php($params, $content, $template, &$repeat)
{
- if (!$smarty->allow_php_tag) {
- throw new Exception("{php} is deprecated, set allow_php_tag = true to enable");
+ if (!$template->allow_php_tag) {
+ throw new SmartyException("{php} is deprecated, set allow_php_tag = true to enable");
}
eval($content);
return '';
}
-?>
+
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/block.textformat.php b/gosa-core/include/smarty/plugins/block.textformat.php
index f578bfb9b62050f0aa0efe3c7966ebed023a7dd2..517fd62dd5274284c9f6256aa988a36c1b5f3271 100644 (file)
<?php
/**
-* Smarty plugin to format text blocks
-*
-* @package Smarty
-* @subpackage PluginsBlock
-*/
+ * 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)
+ * 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 $template template object
+ * @param boolean &$repeat repeat flag
+ * @return string content re-formatted
+ */
+function smarty_block_textformat($params, $content, $template, &$repeat)
{
if (is_null($content)) {
return;
break;
default:
- $smarty->trigger_error("textformat: unknown attribute '$_key'");
+ trigger_error("textformat: unknown attribute '$_key'");
}
}
return $assign ? $template->assign($assign, $_output) : $_output;
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/function.counter.php b/gosa-core/include/smarty/plugins/function.counter.php
index 88e49d80126241402aa9d4859eb5d482c11d2c7c..7c50bd44b7e0f51c3f102cd64f1cfb18a81a98f4 100644 (file)
* @subpackage PluginsFunction
*/
-
/**
* Smarty {counter} function plugin
*
* @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 array parameters
+ * @param Smarty
* @param object $template template object
* @return string|null
*/
-function smarty_function_counter($params, $smarty, $template)
+function smarty_function_counter($params, $template)
{
+ static $counters = array();
$name = (isset($params['name'])) ? $params['name'] : 'default';
- if (!isset($template->plugin_data['counter'][$name])) {
- $template->plugin_data['counter'][$name] = array(
+ if (!isset($counters[$name])) {
+ $counters[$name] = array(
'start'=>1,
'skip'=>1,
'direction'=>'up',
'count'=>1
);
}
- $counter = &$template->plugin_data['counter'][$name];
+ $counter =& $counters[$name];
if (isset($params['start'])) {
$counter['start'] = $counter['count'] = (int)$params['start'];
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/function.cycle.php b/gosa-core/include/smarty/plugins/function.cycle.php
index f1cb46ba65e27f0ce93cc54312e8e4cac87f117d..98e3e28781afba867951dd0eea59b017c02b2690 100644 (file)
<?php
/**
* Smarty plugin
+ *
* @package Smarty
* @subpackage PluginsFunction
*/
* Name: cycle<br>
* Date: May 3, 2002<br>
* Purpose: cycle through given values<br>
+ * 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.
*
* Examples:<br>
* <pre>
* @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
+ * @version 1.3
+ * @param array
* @param object $template template object
* @return string|null
*/
-function smarty_function_cycle($params, $smarty, $template)
+
+function smarty_function_cycle($params, $template)
{
+ static $cycle_vars;
+
$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'])) {
- trigger_error("cycle: missing 'values' parameter",E_USER_WARNING);
+ if(!isset($cycle_vars[$name]['values'])) {
+ trigger_error("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;
+ if(isset($cycle_vars[$name]['values'])
+ && $cycle_vars[$name]['values'] != $params['values'] ) {
+ $cycle_vars[$name]['index'] = 0;
}
- $template->plugin_data['cycle'][$name]['values'] = $params['values'];
+ $cycle_vars[$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'] = ',';
+ $cycle_vars[$name]['delimiter'] = $params['delimiter'];
+ } elseif (!isset($cycle_vars[$name]['delimiter'])) {
+ $cycle_vars[$name]['delimiter'] = ',';
}
- if(is_array($template->plugin_data['cycle'][$name]['values'])) {
- $cycle_array = $template->plugin_data['cycle'][$name]['values'];
+ if(is_array($cycle_vars[$name]['values'])) {
+ $cycle_array = $cycle_vars[$name]['values'];
} else {
- $cycle_array = explode($template->plugin_data['cycle'][$name]['delimiter'],$template->plugin_data['cycle'][$name]['values']);
+ $cycle_array = explode($cycle_vars[$name]['delimiter'],$cycle_vars[$name]['values']);
}
- if(!isset($template->plugin_data['cycle'][$name]['index']) || $reset ) {
- $template->plugin_data['cycle'][$name]['index'] = 0;
+ if(!isset($cycle_vars[$name]['index']) || $reset ) {
+ $cycle_vars[$name]['index'] = 0;
}
if (isset($params['assign'])) {
$print = false;
- $template->assign($params['assign'], $cycle_array[$template->plugin_data['cycle'][$name]['index']]);
+ $template->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]);
}
if($print) {
- $retval = $cycle_array[$template->plugin_data['cycle'][$name]['index']];
+ $retval = $cycle_array[$cycle_vars[$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;
+ if ( $cycle_vars[$name]['index'] >= count($cycle_array) -1 ) {
+ $cycle_vars[$name]['index'] = 0;
} else {
- $template->plugin_data['cycle'][$name]['index']++;
+ $cycle_vars[$name]['index']++;
}
}
return $retval;
}
-?>
+
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/function.fetch.php b/gosa-core/include/smarty/plugins/function.fetch.php
index 391ff1bb9ab3d12a2fd8405eec8425149323b8d3..2b09fb94752ee108378e123182e7129f0842257d 100644 (file)
<?php
/**
* Smarty plugin
+ *
* @package Smarty
* @subpackage PluginsFunction
*/
-
/**
* Smarty {fetch} plugin
*
* (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)
+function smarty_function_fetch($params, $template)
{
if (empty($params['file'])) {
trigger_error("[plugin] fetch parameter 'file' cannot be empty",E_USER_NOTICE);
}
$content = '';
- if ($template->security && !preg_match('!^(http|ftp)://!i', $params['file'])) {
- if(!$smarty->security_handler->isTrustedResourceDir($params['file'])) {
+ if (isset($template->security_policy) && !preg_match('!^(http|ftp)://!i', $params['file'])) {
+ if(!$template->security_policy->isTrustedResourceDir($params['file'])) {
return;
}
$host = $server_name = $uri_parts['host'];
$timeout = 30;
$accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*";
- $agent = "Smarty Template Engine ".$smarty->_version;
+ $agent = "Smarty Template Engine ".$template->_version;
$referer = "";
$uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/';
$uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : '';
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/function.html_checkboxes.php b/gosa-core/include/smarty/plugins/function.html_checkboxes.php
index ac72f3fdf3f14f1266d555e468508433cd385f9b..6a1a3ffdc71454beab3adadfbc1e62f697836bb6 100644 (file)
<?php
/**
* Smarty plugin
+ *
* @package Smarty
* @subpackage PluginsFunction
*/
-
/**
* Smarty {html_checkboxes} function plugin
*
* - separator (optional) - ie <br> or
* - 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)
+function smarty_function_html_checkboxes($params, $template)
{
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
- //$smarty->loadPlugin('Smarty_shared_escape_special_chars');
$name = 'checkbox';
$values = null;
@@ -142,4 +140,4 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte
return $_output;
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/function.html_image.php b/gosa-core/include/smarty/plugins/function.html_image.php
index 3f031dc00ed5ea948aeedd7aa68e10bf3b1a44e2..abb7b578981d45311ee186c82da633dd79861fd9 100644 (file)
<?php
/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsFunction
-*/
+ * 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)
+ * 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 $template template object
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_image($params, $template)
{
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
- //$smarty->loadPlugin('Smarty_shared_escape_special_chars');
-
+
$alt = '';
$file = '';
$height = '';
$prefix = '';
$suffix = '';
$path_prefix = '';
- $server_vars = ($smarty->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
+ $server_vars = $_SERVER;
$basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : '';
foreach($params as $_key => $_val) {
switch ($_key) {
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);
+ throw new SmartyException ("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
break;
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);
+ throw new SmartyException ("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
break;
}
return;
}
}
- if ($template->security) {
- if (!$smarty->security_handler->isTrustedResourceDir($_image_path)) {
+ if (isset($template->security_policy)) {
+ if (!$template->security_policy->isTrustedResourceDir($_image_path)) {
return;
}
}
return $prefix . '<img src="' . $path_prefix . $file . '" alt="' . $alt . '" width="' . $width . '" height="' . $height . '"' . $extra . ' />' . $suffix;
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/function.html_options.php b/gosa-core/include/smarty/plugins/function.html_options.php
index 69f56e8013820b4c6552768282c99b26c130d38a..7ac039028942509ce45e4dc2cb43c5ae38da047a 100644 (file)
<?php
/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsFunction
-*/
+ * 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)
+ * 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 $template template object
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_options($params, $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;
+ $id = null;
+ $class = null;
$extra = '';
+ $options_extra = '';
foreach($params as $_key => $_val) {
switch ($_key) {
case 'name':
+ case 'class':
+ case 'id':
$$_key = (string)$_val;
break;
/* raise error here? */
$_html_result = '';
+ $_idx = 0;
if (isset($options)) {
- foreach ($options as $_key => $_val)
- $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
+ foreach ($options as $_key => $_val) {
+ $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected, $id, $class, $_idx);
+ }
} else {
foreach ($values as $_i => $_key) {
$_val = isset($output[$_i]) ? $output[$_i] : '';
- $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
+ $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected, $id, $class, $_idx);
}
}
if (!empty($name)) {
- $_html_result = '<select name="' . $name . '"' . $extra . '>' . "\n" . $_html_result . '</select>' . "\n";
+ $_html_class = !empty($class) ? ' class="'.$class.'"' : '';
+ $_html_id = !empty($id) ? ' id="'.$id.'"' : '';
+ $_html_result = '<select name="' . $name . '"' . $_html_class . $_html_id . $extra . '>' . "\n" . $_html_result . '</select>' . "\n";
}
return $_html_result;
}
-function smarty_function_html_options_optoutput($key, $value, $selected)
+function smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, &$idx)
{
if (!is_array($value)) {
- $_html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' .
+ $_html_result = '<option 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";
+ $_html_class = !empty($class) ? ' class="'.$class.' option"' : '';
+ $_html_id = !empty($id) ? ' id="'.$id.'-'.$idx.'"' : '';
+ $_html_result .= $_html_class . $_html_id . '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n";
+ $idx++;
} else {
- $_html_result = smarty_function_html_options_optgroup($key, $value, $selected);
- }
+ $_idx = 0;
+ $_html_result = smarty_function_html_options_optgroup($key, $value, $selected, $id.'-'.$idx, $class, $_idx);
+ $idx++;
+ }
return $_html_result;
}
-function smarty_function_html_options_optgroup($key, $values, $selected)
+function smarty_function_html_options_optgroup($key, $values, $selected, $id, $class, &$idx)
{
$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 .= smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, $idx);
}
$optgroup_html .= "</optgroup>\n";
return $optgroup_html;
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/function.html_radios.php b/gosa-core/include/smarty/plugins/function.html_radios.php
index c7f72bf64b39ad038fdc0adf2b54c5affa081b39..c6b27edf2ca30d2e277e9707de72d52d169f8548 100644 (file)
<?php
/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsFunction
-*/
+ * 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
-* - 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)
+ * 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
+ * - output (optional) - the output next to each radio button
+ * - assign (optional) - assign the output as an array to this variable
+ * @param object $template template object
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_radios($params, $template)
{
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
- //$smarty->loadPlugin('Smarty_shared_escape_special_chars');
$name = 'radio';
$values = null;
@@ -153,4 +151,4 @@ function smarty_function_html_radios_output($name, $value, $output, $selected, $
return $_output;
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/function.html_select_date.php b/gosa-core/include/smarty/plugins/function.html_select_date.php
index 7001f887b135c8fb74ff55290ccaab75dc8b12b5..1d57fdc7a792fe78ea4a9fa76676bea9fb2c8fc4 100644 (file)
<?php
/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsFunction
-*/
+ * 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)
+ * 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 $template template object
+ * @return string
+ */
+function smarty_function_html_select_date($params, $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_";
'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);
+ $template);
$month_result .= '</select>';
}
'values' => $day_values,
'selected' => $time[2],
'print_result' => false),
- $smarty, $template);
+ $template);
$day_result .= '</select>';
}
'values' => $yearvals,
'selected' => $time[0],
'print_result' => false),
- $smarty, $template);
+ $template);
$year_result .= '</select>';
}
}
}
return $html_result;
-}
-?>
+}
+
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/function.html_select_time.php b/gosa-core/include/smarty/plugins/function.html_select_time.php
index 51d307ae27547d13ac48c81f4d604c9e6875202c..ddde4f5ac638fb488afaafd3c2ac83509de5323a 100644 (file)
<?php
/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsFunction
-*/
+ * 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)
+ * 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 $template template object
+ * @return string
+ * @uses smarty_make_timestamp()
+ */
+function smarty_function_html_select_time($params, $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_";
'values' => $hours,
'selected' => strftime($hour_fmt, $time),
'print_result' => false),
- $smarty, $template);
+ $template);
$html_result .= "</select>\n";
}
'values' => $minutes,
'selected' => $selected,
'print_result' => false),
- $smarty, $template);
+ $template);
$html_result .= "</select>\n";
}
'values' => $seconds,
'selected' => $selected,
'print_result' => false),
- $smarty, $template);
+ $template);
$html_result .= "</select>\n";
}
'values' => array('am', 'pm'),
'selected' => strtolower(strftime('%p', $time)),
'print_result' => false),
- $smarty, $template);
+ $template);
$html_result .= "</select>\n";
}
return $html_result;
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/function.html_table.php b/gosa-core/include/smarty/plugins/function.html_table.php
index 198b03ca07cd77ce515de59f05ce21a9297db39f..7986a9bcf99c2c664df7c1b6374e35ece99299d3 100644 (file)
<?php
/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsFunction
-*/
+ * 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)
+ * 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 $template template object
+ * @return string
+ */
+function smarty_function_html_table($params, $template)
{
$table_attr = 'border="1"';
$tr_attr = '';
$hdir = 'right';
$inner = 'cols';
$caption = '';
+ $loop = null;
if (!isset($params['loop'])) {
trigger_error("html_table: missing 'loop' parameter",E_USER_WARNING);
}
return ($ret) ? ' ' . $ret : '';
-}
-?>
+}
+
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/function.mailto.php b/gosa-core/include/smarty/plugins/function.mailto.php
index 29a87c6918099aa2f28cb816d7702d0eb0e976b4..976218f53885fd221cb86fba476f80d3d2a6c1fc 100644 (file)
<?php
/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsFunction
-*/
+ * 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)
+ * 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 $template template object
+ * @return string
+ */
+function smarty_function_mailto($params, $template)
{
$extra = '';
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/function.math.php b/gosa-core/include/smarty/plugins/function.math.php
index d7ac9f8f0e5faf96414819df601f59e479e49629..cd90020a43d0850363041444f9fa19e736fadc01 100644 (file)
* @subpackage PluginsFunction
*/
-
/**
* Smarty {math} function plugin
*
* (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)
+function smarty_function_math($params, $template)
{
// be sure equation parameter is present
if (empty($params['equation'])) {
}
// 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);
+ 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');
$equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation);
}
}
-
+ $smarty_math_result = null;
eval("\$smarty_math_result = ".$equation.";");
if (empty($params['format'])) {
}
}
}
-?>
+
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifier.capitalize.php b/gosa-core/include/smarty/plugins/modifier.capitalize.php
index acff0bc9dce538003c8fb56c69c9eb2a34df82dc..cd24589d8df3bbc70f9415077a60983fc21d8d8c 100644 (file)
<?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
+ *
+ * @link
+ * @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);
-}
+{
+ // uppercase with php function ucwords
+ $upper_string = ucwords($string);
+ // check for any missed hyphenated words
+ $upper_string = preg_replace("!(^|[^\p{L}'])([\p{Ll}])!ue", "'\\1'.ucfirst('\\2')", $upper_string);
+ // check uc_digits case
+ if (!$uc_digits) {
+ if (preg_match_all("!\b([\p{L}]*[\p{N}]+[\p{L}]*)\b!u", $string, $matches, PREG_OFFSET_CAPTURE)) {
+ foreach($matches[1] as $match)
+ $upper_string = substr_replace($upper_string, $match[0], $match[1], strlen($match[0]));
+ }
+ }
+ return $upper_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];
-}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifier.date_format.php b/gosa-core/include/smarty/plugins/modifier.date_format.php
index 950a1958789033b475d9b0ee47b71e36cb62c35d..3656c1c8838af7ffcc5b222c20964872b263cec6 100644 (file)
<?php
/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
+ * 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()
-*/
+ * 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 = '',$formatter='auto')
{
/**
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifier.debug_print_var.php b/gosa-core/include/smarty/plugins/modifier.debug_print_var.php
index f0f83d274e3e705c2b329833e33bc9eca4b40136..013337ae0db4157354ad2e1da859e35b121ff64c 100644 (file)
<?php
/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage Debug
-*/
+ * 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
-*/
+ * 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
+ */
function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40)
{
$_replace = array("\n" => '<i>\n</i>',
return $results;
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifier.escape.php b/gosa-core/include/smarty/plugins/modifier.escape.php
index 0e58d8b21a93ecbfc6d8a105f47886b331edbf1f..37bc0e30e9e186eea810bf781bd0dcb95f317354 100644 (file)
<?php
-
/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
-
+ * 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
-*/
+ * 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) {
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);
- }
+ require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php');
+ return smarty_mb_str_replace(array('@', '.'), array(' [AT] ', ' [DOT] '), $string);
case 'nonstd':
// escape non-standard chars, such as ms document quotes
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;
- }
- }
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifier.regex_replace.php b/gosa-core/include/smarty/plugins/modifier.regex_replace.php
index 100b58ce4b1e7a969bef4fdee59f17d36f56f41c..9f148800e98d2e3401769f36ec6c7e37ca223ee5 100644 (file)
<?php
/**
* Smarty plugin
+ *
* @package Smarty
- * @subpackage plugins
+ * @subpackage PluginsModifier
*/
-
/**
* Smarty regex_replace modifier plugin
*
return $search;
}
-/* vim: set expandtab: */
-
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifier.replace.php b/gosa-core/include/smarty/plugins/modifier.replace.php
index 5f70979f6d3ba8d1715aba4042fb5b5cd435fe89..6a6698164312e52bf43a269f99057a49d9f2bc33 100644 (file)
<?php
/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
+ * 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
-*/
+ * 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);
- }
+ if (function_exists('mb_split')) {
+ require_once(SMARTY_PLUGINS_DIR . 'shared.mb_str_replace.php');
+ return smarty_mb_str_replace($search, $replace, $string);
+ }
+ return str_replace($search, $replace, $string);
}
-
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifier.spacify.php b/gosa-core/include/smarty/plugins/modifier.spacify.php
index d2593ec3eec84908b55ecdeb024b2ef716614e02..f14e026bcfb08d43c6d2f3eaaaa3574eb2077785 100644 (file)
<?php
/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
+ * 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
-*/
+ * 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));
+{
+ // mb_ functions available?
+ if (function_exists('mb_strlen') && mb_detect_encoding($string, 'UTF-8, ISO-8859-1') === 'UTF-8') {
+ $strlen = mb_strlen($string);
+ while ($strlen) {
+ $array[] = mb_substr($string, 0, 1, "UTF-8");
+ $string = mb_substr($string, 1, $strlen, "UTF-8");
+ $strlen = mb_strlen($string);
+ }
+ return implode($spacify_char, $array);
+ } else {
+ return implode($spacify_char, preg_split('//', $string, -1));
+ }
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifier.truncate.php b/gosa-core/include/smarty/plugins/modifier.truncate.php
index 943a8ab6591f8a3a115f79f8afc559de24662e64..0e9d4b9f2124ec935aa953a31cd35250d049d533 100644 (file)
<?php
/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsModifier
-*/
-
+ * 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
-*/
+ * 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)
{
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;
+ if (mb_detect_encoding($string, 'UTF-8, ISO-8859-1') === 'UTF-8') {
+ // $string has utf-8 encoding
+ if (mb_strlen($string) > $length) {
+ $length -= min($length, mb_strlen($etc));
+ if (!$break_words && !$middle) {
+ $string = preg_replace('/\s+?(\S+)?$/u', '', mb_substr($string, 0, $length + 1));
+ }
+ 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 mb_substr($string, 0, $length / 2) . $etc . mb_substr($string, - $length / 2);
+ return $string;
}
- } 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);
- }
+ }
+ // $string has no utf-8 encoding
+ 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 $string;
+ return substr($string, 0, $length / 2) . $etc . substr($string, - $length / 2);
}
+ } else {
+ return $string;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifiercompiler.cat.php b/gosa-core/include/smarty/plugins/modifiercompiler.cat.php
--- /dev/null
@@ -0,0 +1,29 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty cat modifier plugin\r
+ *\r
+ * Type: modifier<br>\r
+ * Name: cat<br>\r
+ * Date: Feb 24, 2003\r
+ * Purpose: catenate a value to a variable\r
+ * Input: string to catenate\r
+ * Example: {$var|cat:"foo"}\r
+ * @link http://smarty.php.net/manual/en/language.modifier.cat.php cat\r
+ * (Smarty online manual)\r
+ * @author Uwe Tews\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_cat($params, $compiler)\r
+{\r
+ return '('.implode(').(', $params).')';\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifiercompiler.count_characters.php b/gosa-core/include/smarty/plugins/modifiercompiler.count_characters.php
--- /dev/null
@@ -0,0 +1,39 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty count_characters modifier plugin\r
+ * \r
+ * Type: modifier<br>\r
+ * Name: count_characteres<br>\r
+ * Purpose: count the number of characters in a text\r
+ * \r
+ * @link http://smarty.php.net/manual/en/language.modifier.count.characters.php count_characters (Smarty online manual)\r
+ * @author Uwe Tews \r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_count_characters($params, $compiler)\r
+{\r
+ // mb_ functions available?\r
+ if (function_exists('mb_strlen')) {\r
+ // count also spaces?\r
+ if (isset($params[1]) && $params[1] == 'true') {\r
+ return '((mb_detect_encoding(' . $params[0] . ', \'UTF-8, ISO-8859-1\') === \'UTF-8\') ? mb_strlen(' . $params[0] . ', SMARTY_RESOURCE_CHAR_SET) : strlen(' . $params[0] . '))';\r
+ } \r
+ return '((mb_detect_encoding(' . $params[0] . ', \'UTF-8, ISO-8859-1\') === \'UTF-8\') ? preg_match_all(\'#[^\s\pZ]#u\', ' . $params[0] . ', $tmp) : preg_match_all(\'/[^\s]/\',' . $params[0] . ', $tmp))';\r
+ } else {\r
+ // count also spaces?\r
+ if (isset($params[1]) && $params[1] == 'true') {\r
+ return 'strlen(' . $params[0] . ')';\r
+ } \r
+ return 'preg_match_all(\'/[^\s]/\',' . $params[0] . ', $tmp)';\r
+ } \r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifiercompiler.count_paragraphs.php b/gosa-core/include/smarty/plugins/modifiercompiler.count_paragraphs.php
--- /dev/null
@@ -0,0 +1,27 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty count_paragraphs modifier plugin\r
+ *\r
+ * Type: modifier<br>\r
+ * Name: count_paragraphs<br>\r
+ * Purpose: count the number of paragraphs in a text\r
+ * @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php\r
+ * count_paragraphs (Smarty online manual)\r
+ * @author Uwe Tews \r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_count_paragraphs($params, $compiler)\r
+{\r
+ // count \r or \n characters\r
+ return '(preg_match_all(\'#[\r\n]+#\', ' . $params[0] . ', $tmp)+1)';\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifiercompiler.count_sentences.php b/gosa-core/include/smarty/plugins/modifiercompiler.count_sentences.php
--- /dev/null
@@ -0,0 +1,27 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty count_sentences modifier plugin\r
+ *\r
+ * Type: modifier<br>\r
+ * Name: count_sentences\r
+ * Purpose: count the number of sentences in a text\r
+ * @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php\r
+ * count_sentences (Smarty online manual)\r
+ * @author Uwe Tews \r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_count_sentences($params, $compiler)\r
+{\r
+ // find periods with a word before but not after.\r
+ return 'preg_match_all(\'/[^\s]\.(?!\w)/\', ' . $params[0] . ', $tmp)';\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifiercompiler.count_words.php b/gosa-core/include/smarty/plugins/modifiercompiler.count_words.php
--- /dev/null
@@ -0,0 +1,31 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ * \r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty count_words modifier plugin\r
+ * \r
+ * Type: modifier<br>\r
+ * Name: count_words<br>\r
+ * Purpose: count the number of words in a text\r
+ * \r
+ * @link http://smarty.php.net/manual/en/language.modifier.count.words.php count_words (Smarty online manual)\r
+ * @author Uwe Tews \r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+*/\r
+function smarty_modifiercompiler_count_words($params, $compiler)\r
+{ \r
+ // mb_ functions available?\r
+ if (function_exists('mb_strlen')) {\r
+ return '((mb_detect_encoding(' . $params[0] . ', \'UTF-8, ISO-8859-1\') === \'UTF-8\') ? preg_match_all(\'#[\w\pL]+#u\', ' . $params[0] . ', $tmp) : preg_match_all(\'#\w+#\',' . $params[0] . ', $tmp))';\r
+ } else {\r
+ return 'str_word_count(' . $params[0] . ')';\r
+ } \r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifiercompiler.default.php b/gosa-core/include/smarty/plugins/modifiercompiler.default.php
--- /dev/null
@@ -0,0 +1,33 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty default modifier plugin\r
+ * \r
+ * Type: modifier<br>\r
+ * Name: default<br>\r
+ * Purpose: designate default value for empty variables\r
+ * \r
+ * @link http://smarty.php.net/manual/en/language.modifier.default.php default (Smarty online manual)\r
+ * @author Uwe Tews \r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_default ($params, $compiler)\r
+{\r
+ $output = $params[0];\r
+ if (!isset($params[1])) {\r
+ $params[1] = "''";\r
+ } \r
+ for ($i = 1, $cnt = count($params); $i < $cnt; $i++) {\r
+ $output = '(($tmp = @' . $output . ')===null||$tmp===\'\' ? ' . $params[$i] . ' : $tmp)';\r
+ } \r
+ return $output;\r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifiercompiler.indent.php b/gosa-core/include/smarty/plugins/modifiercompiler.indent.php
--- /dev/null
@@ -0,0 +1,32 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty indent modifier plugin\r
+ *\r
+ * Type: modifier<br>\r
+ * Name: indent<br>\r
+ * Purpose: indent lines of text\r
+ * @link http://smarty.php.net/manual/en/language.modifier.indent.php\r
+ * indent (Smarty online manual)\r
+ * @author Uwe Tews \r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+\r
+function smarty_modifiercompiler_indent($params, $compiler)\r
+{\r
+ if (!isset($params[1])) {\r
+ $params[1] = 4;\r
+ } \r
+ if (!isset($params[2])) {\r
+ $params[2] = "' '";\r
+ } \r
+ return 'preg_replace(\'!^!m\',str_repeat(' . $params[2] . ',' . $params[1] . '),' . $params[0] . ')';\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifiercompiler.lower.php b/gosa-core/include/smarty/plugins/modifiercompiler.lower.php
--- /dev/null
@@ -0,0 +1,31 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty lower modifier plugin\r
+ * \r
+ * Type: modifier<br>\r
+ * Name: lower<br>\r
+ * Purpose: convert string to lowercase\r
+ * \r
+ * @link http://smarty.php.net/manual/en/language.modifier.lower.php lower (Smarty online manual)\r
+ * @author Monte Ohrt <monte at ohrt dot com> \r
+ * @author Uwe Tews \r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+\r
+function smarty_modifiercompiler_lower($params, $compiler)\r
+{\r
+ if (function_exists('mb_strtolower')) {\r
+ return '((mb_detect_encoding(' . $params[0] . ', \'UTF-8, ISO-8859-1\') === \'UTF-8\') ? mb_strtolower(' . $params[0] . ',SMARTY_RESOURCE_CHAR_SET) : strtolower(' . $params[0] . '))' ;\r
+ } else {\r
+ return 'strtolower(' . $params[0] . ')';\r
+ } \r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifiercompiler.noprint.php b/gosa-core/include/smarty/plugins/modifiercompiler.noprint.php
--- /dev/null
@@ -0,0 +1,24 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty noprint modifier plugin\r
+ *\r
+ * Type: modifier<br>\r
+ * Name: noprint<br>\r
+ * Purpose: return an empty string\r
+ * @author Uwe Tews\r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_noprint($params, $compiler)\r
+{\r
+ return "''";\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifiercompiler.string_format.php b/gosa-core/include/smarty/plugins/modifiercompiler.string_format.php
--- /dev/null
@@ -0,0 +1,26 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ * \r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty string_format modifier plugin\r
+ * \r
+ * Type: modifier<br>\r
+ * Name: string_format<br>\r
+ * Purpose: format strings via sprintf\r
+ * \r
+ * @link http://smarty.php.net/manual/en/language.modifier.string.format.php string_format (Smarty online manual)\r
+ * @author Uwe Tews \r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_string_format($params, $compiler)\r
+{\r
+ return 'sprintf(' . $params[1] . ',' . $params[0] . ')';\r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifiercompiler.strip.php b/gosa-core/include/smarty/plugins/modifiercompiler.strip.php
--- /dev/null
@@ -0,0 +1,33 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty strip modifier plugin\r
+ * \r
+ * Type: modifier<br>\r
+ * Name: strip<br>\r
+ * Purpose: Replace all repeated spaces, newlines, tabs\r
+ * with a single space or supplied replacement string.<br>\r
+ * Example: {$var|strip} {$var|strip:" "}\r
+ * Date: September 25th, 2002\r
+ * \r
+ * @link http://smarty.php.net/manual/en/language.modifier.strip.php strip (Smarty online manual)\r
+ * @author Uwe Tews \r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+\r
+function smarty_modifiercompiler_strip($params, $compiler)\r
+{\r
+ if (!isset($params[1])) {\r
+ $params[1] = "' '";\r
+ }\r
+ return "preg_replace('!\s+!u', {$params[1]},{$params[0]})";\r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifiercompiler.strip_tags.php b/gosa-core/include/smarty/plugins/modifiercompiler.strip_tags.php
--- /dev/null
@@ -0,0 +1,34 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty strip_tags modifier plugin\r
+ * \r
+ * Type: modifier<br>\r
+ * Name: strip_tags<br>\r
+ * Purpose: strip html tags from text\r
+ * \r
+ * @link http://smarty.php.net/manual/en/language.modifier.strip.tags.php strip_tags (Smarty online manual)\r
+ * @author Uwe Tews \r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+\r
+function smarty_modifiercompiler_strip_tags($params, $compiler)\r
+{\r
+ if (!isset($params[1])) {\r
+ $params[1] = true;\r
+ } \r
+ if ($params[1] === true) {\r
+ return "preg_replace('!<[^>]*?>!', ' ', {$params[0]})";\r
+ } else {\r
+ return 'strip_tags(' . $params[0] . ')';\r
+ } \r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifiercompiler.upper.php b/gosa-core/include/smarty/plugins/modifiercompiler.upper.php
--- /dev/null
@@ -0,0 +1,30 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty upper modifier plugin\r
+ * \r
+ * Type: modifier<br>\r
+ * Name: lower<br>\r
+ * Purpose: convert string to uppercase\r
+ * \r
+ * @link http://smarty.php.net/manual/en/language.modifier.upper.php lower (Smarty online manual)\r
+ * @author Uwe Tews \r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_upper($params, $compiler)\r
+{\r
+ if (function_exists('mb_strtoupper')) {\r
+ return '((mb_detect_encoding(' . $params[0] . ', \'UTF-8, ISO-8859-1\') === \'UTF-8\') ? mb_strtoupper(' . $params[0] . ',SMARTY_RESOURCE_CHAR_SET) : strtoupper(' . $params[0] . '))' ;\r
+ } else {\r
+ return 'strtoupper(' . $params[0] . ')';\r
+ } \r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/modifiercompiler.wordwrap.php b/gosa-core/include/smarty/plugins/modifiercompiler.wordwrap.php
--- /dev/null
@@ -0,0 +1,35 @@
+<?php\r
+/**\r
+ * Smarty plugin\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsModifierCompiler\r
+ */\r
+\r
+/**\r
+ * Smarty wordwrap modifier plugin\r
+ * \r
+ * Type: modifier<br>\r
+ * Name: wordwrap<br>\r
+ * Purpose: wrap a string of text at a given length\r
+ * \r
+ * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php wordwrap (Smarty online manual)\r
+ * @author Uwe Tews \r
+ * @param array $params parameters\r
+ * @return string with compiled code\r
+ */\r
+function smarty_modifiercompiler_wordwrap($params, $compiler)\r
+{\r
+ if (!isset($params[1])) {\r
+ $params[1] = 80;\r
+ } \r
+ if (!isset($params[2])) {\r
+ $params[2] = '"\n"';\r
+ } \r
+ if (!isset($params[3])) {\r
+ $params[3] = 'false';\r
+ } \r
+ return 'wordwrap(' . $params[0] . ',' . $params[1] . ',' . $params[2] . ',' . $params[3] . ')';\r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/outputfilter.trimwhitespace.php b/gosa-core/include/smarty/plugins/outputfilter.trimwhitespace.php
index ce5fde985570eac016560fb34a74bdd166dbf827..20e9bb60084f991c11bc149644a8b07bd4b5ad69 100644 (file)
<?php
/**
* Smarty plugin
+ *
* @package Smarty
* @subpackage PluginsFilter
*/
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/shared.escape_special_chars.php b/gosa-core/include/smarty/plugins/shared.escape_special_chars.php
index f7142f917311297e06f69f1d04ef6c062ad38fea..e36b2c897c1cdb4196df5b4fe6f8739073e5f3c9 100644 (file)
<?php
/**
* Smarty shared plugin
+ *
* @package Smarty
* @subpackage PluginsShared
*/
-
/**
* escape_special_chars common function
*
return $string;
}
-/* vim: set expandtab: */
-
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/plugins/shared.make_timestamp.php b/gosa-core/include/smarty/plugins/shared.make_timestamp.php
index 4e652ad157e0c8457e23b17bde723c010df23496..9789f53f7f8d9505a2fadc04ad87174e262f9914 100644 (file)
<?php
/**
* Smarty shared plugin
+ *
* @package Smarty
* @subpackage PluginsShared
*/
-
/**
* Function: smarty_make_timestamp<br>
* Purpose: used by other smarty functions to make a timestamp
* @param string $string
* @return string
*/
+
function smarty_make_timestamp($string)
{
if(empty($string)) {
// use "now":
- $time = time();
-
- } elseif (preg_match('/^\d{14}$/', $string)) {
+ return time();
+ } elseif ($string instanceof DateTime) {
+ return $string->getTimestamp();
+ } elseif (strlen($string)==14 && ctype_digit($string)) {
// it is mysql timestamp format of YYYYMMDDHHMMSS?
- $time = mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2),
+ return 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;
-
+ return (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();
}
+ return $time;
}
- return $time;
-
}
+
?>
diff --git a/gosa-core/include/smarty/plugins/shared.mb_str_replace.php b/gosa-core/include/smarty/plugins/shared.mb_str_replace.php
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+
+if(!function_exists('smarty_mb_str_replace')) {
+ 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/gosa-core/include/smarty/plugins/variablefilter.htmlspecialchars.php b/gosa-core/include/smarty/plugins/variablefilter.htmlspecialchars.php
index 08a578337885318c1fe610daa965370a2ed2cd0f..4d3550c04761626496328db47ac3c435af31641a 100644 (file)
<?php
/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage PluginsFilter
-*/
+ * 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)
+ * 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);
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_cacheresource_file.php b/gosa-core/include/smarty/sysplugins/smarty_internal_cacheresource_file.php
index c2614c3cf6215b33d12fa8afe82b09dc83a33ed6..512f6fbf723ce2732de3a07b64b95e0b9f8a541a 100644 (file)
<?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
-*/
+ * 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
-*/
+ * 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
- */
+ * Returns the filepath of the cached template output
+ *
+ * @param object $_template current template
+ * @return string the cache filepath
+ */
public function getCachedFilepath($_template)
{
$_source_file_path = str_replace(':', '.', $_template->getTemplateFilepath());
$_cache_id = isset($_template->cache_id) ? preg_replace('![^\w\|]+!', '_', $_template->cache_id) : null;
- $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w\|]+!', '_', $_template->compile_id) : null;
+ $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w\|]+!', '_', $_template->compile_id) : null;
$_filepath = $_template->templateUid;
// if use_sub_dirs, break file into directories
if ($this->smarty->use_sub_dirs) {
}
/**
- * 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
- */
+ * 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 @filemtime ($_template->getCachedFilepath());
}
/**
- * 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)
+ * 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, $no_render = false)
{
- ob_start();
+ if (!$no_render) {
+ ob_start();
+ }
$_smarty_tpl = $_template;
include $_template->getCachedFilepath();
- return ob_get_clean();
+ if ($no_render) {
+ return null;
+ } else {
+ return ob_get_clean();
+ }
}
/**
- * Writes the rendered template output to cache file
- *
- * @param object $_template current template
- * @return boolean status
- */
+ * Writes the rendered template output to cache file
+ *
+ * @param object $_template current template
+ * @return boolean status
+ */
public function writeCachedContent($_template, $content)
{
if (!$_template->resource_object->isEvaluated) {
}
/**
- * Empty cache folder
- *
- * @param integer $exp_time expiration time
- * @return integer number of cache files deleted
- */
+ * 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
- */
+ * 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;
if (isset($_cache_id)) {
$_cache_id_parts = explode('|', $_cache_id);
$_cache_id_parts_count = count($_cache_id_parts);
- }
- $_count = 0;
- $_cacheDirs = new RecursiveDirectoryIterator($_dir);
- $_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST);
- foreach ($_cache as $_file) {
- if (strpos($_file, '.svn') !== false) continue;
- // directory ?
- if ($_file->isDir()) {
- if (!$_cache->isDot()) {
- // delete folder if empty
- @rmdir($_file->getPathname());
+ if ($this->smarty->use_sub_dirs) {
+ foreach ($_cache_id_parts as $id_part) {
+ $_dir .= $id_part . DS;
}
+ }
+ }
+ if (isset($resource_name)) {
+ $_save_stat = $this->smarty->caching;
+ $this->smarty->caching = true;
+ $tpl = new $this->smarty->template_class($resource_name, $this->smarty);
+ $this->smarty->caching = $_save_stat;
+ if ($tpl->isExisting()) {
+ $_resourcename_parts = basename(str_replace('^', '/', $tpl->getCachedFilepath()));
+ // remove from template cache
+ unset($this->smarty->template_objects[sha1($tpl->template_resource . $tpl->cache_id . $tpl->compile_id)]);
} else {
- $_parts = explode($_dir_sep, str_replace('\\', '/', substr((string)$_file, $_dir_length)));
- $_parts_count = count($_parts);
- // check name
- if (isset($resource_name)) {
- $_filename_parts = explode('.', $_parts[$_parts_count-1]);
- $_resourcename_parts = explode('.', $resource_name . '.php');
- if (count($_filename_parts)-1 != count($_resourcename_parts)) {
- continue;
+ // remove from template cache
+ unset($this->smarty->template_objects[sha1($tpl->template_resource . $tpl->cache_id . $tpl->compile_id)]);
+ return 0;
+ }
+ }
+ $_count = 0;
+ if (file_exists($_dir)) {
+ $_cacheDirs = new RecursiveDirectoryIterator($_dir);
+ $_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST);
+ foreach ($_cache as $_file) {
+ if (substr($_file->getBasename(),0,1) == '.') continue;
+ // directory ?
+ if ($_file->isDir()) {
+ if (!$_cache->isDot()) {
+ // delete folder if empty
+ @rmdir($_file->getPathname());
}
- for ($i = 0; $i < count($_resourcename_parts); $i++) {
- if ($_filename_parts[$i + 1] != $_resourcename_parts[$i]) continue 2;
+ } else {
+ $_parts = explode($_dir_sep, str_replace('\\', '/', substr((string)$_file, $_dir_length)));
+ $_parts_count = count($_parts);
+ // check name
+ if (isset($resource_name)) {
+ if ($_parts[$_parts_count-1] != $_resourcename_parts) {
+ continue;
+ }
}
- }
- // check compile id
- if (isset($_compile_id) && $_parts[$_parts_count-2 - $_compile_id_offset] != $_compile_id) {
- continue;
- }
- // check cache id
- if (isset($_cache_id)) {
- // count of cache id parts
- $_parts_count = (isset($_compile_id)) ? $_parts_count - 2 - $_compile_id_offset : $_parts_count - 1 - $_compile_id_offset;
- if ($_parts_count < $_cache_id_parts_count) {
+ // check compile id
+ if (isset($_compile_id) && (!isset($_parts[$_parts_count-2 - $_compile_id_offset]) || $_parts[$_parts_count-2 - $_compile_id_offset] != $_compile_id)) {
continue;
}
- for ($i = 0; $i < $_cache_id_parts_count; $i++) {
- if ($_parts[$i] != $_cache_id_parts[$i]) continue 2;
+ // check cache id
+ if (isset($_cache_id)) {
+ // count of cache id parts
+ $_parts_count = (isset($_compile_id)) ? $_parts_count - 2 - $_compile_id_offset : $_parts_count - 1 - $_compile_id_offset;
+ if ($_parts_count < $_cache_id_parts_count) {
+ continue;
+ }
+ for ($i = 0; $i < $_cache_id_parts_count; $i++) {
+ if ($_parts[$i] != $_cache_id_parts[$i]) continue 2;
+ }
}
+ // expired ?
+ if (isset($exp_time) && time() - @filemtime($_file) < $exp_time) {
+ continue;
+ }
+ $_count += @unlink((string) $_file) ? 1 : 0;
}
- // expired ?
- if (isset($exp_time) && time() - @filemtime($_file) < $exp_time) {
- continue;
- }
- $_count += @unlink((string) $_file) ? 1 : 0;
}
}
return $_count;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_append.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_append.php
index d60d808934517b8f873b6e452e73a1a55beffd61..98e696e30e2a8f4eecaa532a98acc395e63bb9f4 100644 (file)
<?php
/**
-* Smarty Internal Plugin Compile Append
-*
-* Compiles the {append} tag
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * 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 {
+ * Smarty Internal Plugin Compile Append Class
+ */
+class Smarty_Internal_Compile_Append extends Smarty_Internal_Compile_Assign {
+
/**
- * 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)
+ * Compiles code for the {append} 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)
{
$this->compiler = $compiler;
+ // the following must be assigned at runtime because it will be overwritten in parent class
$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']);
- }
+ $this->shorttag_order = array('var', 'value');
+ $this->optional_attributes = array('scope','index');
// 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
+ $_attr = $this->_get_attributes($args);
+ // map to compile assign attributes
if (isset($_attr['index'])) {
- return "<?php \$_smarty_tpl->append($_attr[var],array($_attr[index] => $_attr[value]),true,$_nocache,$_scope);?>";
+ $_params['smarty_internal_index'] = '[' . $_attr['index'] . ']';
+ unset($_attr['index']);
} else {
- return "<?php \$_smarty_tpl->append($_attr[var],$_attr[value],false,$_nocache,$_scope);?>";
+ $_params['smarty_internal_index'] = '[]';
+ }
+ $_new_attr = array();
+ foreach ($_attr as $key => $value) {
+ $_new_attr[] = array($key => $value);
}
+ // call compile assign
+ return parent::compile($_new_attr, $compiler, $_params);
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_assign.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_assign.php
index 57c4ce7020528e03327a85184b716a3c8693f06b..8d8c643afceacbdb90fb78eba511e1338432f91d 100644 (file)
<?php
/**
-* Smarty Internal Plugin Compile Assign
-*
-* Compiles the {assign} tag
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Compile Assign
+ *
+ * Compiles the {assign} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Assign Class
-*/
+ * 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)
+ * Compiles code for the {assign} 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)
{
$this->compiler = $compiler;
+ // the following must be assigned at runtime because it will be overwritten in Smarty_Internal_Compile_Append
$this->required_attributes = array('var', 'value');
- $this->optional_attributes = array('scope', 'nocache', 'smarty_internal_index');
-
+ $this->shorttag_order = array('var', 'value');
+ $this->optional_attributes = array('scope');
$_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);
-
+ $_attr = $this->_get_attributes($args);
+ // nocache ?
+ if ($this->compiler->tag_nocache || $this->compiler->nocache) {
+ $_nocache = 'true';
+ // create nocache var to make it know for further compiling
+ $compiler->template->tpl_vars[trim($_attr['var'], "'")] = new Smarty_variable(null, true);
+ }
+ // scope setup
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;
+ $_attr['scope'] = trim($_attr['scope'], "'\"");
+ if ($_attr['scope'] == 'parent') {
+ $_scope = Smarty::SCOPE_PARENT;
+ } elseif ($_attr['scope'] == 'root') {
+ $_scope = Smarty::SCOPE_ROOT;
+ } elseif ($_attr['scope'] == 'global') {
+ $_scope = Smarty::SCOPE_GLOBAL;
+ } else {
+ $this->compiler->trigger_template_error('illegal value for "scope" attribute', $this->compiler->lex->taglineno);
}
}
// compiled output
- if (isset($_attr['smarty_internal_index'])) {
- if ($_attr['smarty_internal_index'] == '') {
- return "<?php \$_smarty_tpl->append($_attr[var],$_attr[value],false,$_nocache,$_scope);?>";
- } else {
- return "<?php \$_tmp$_attr[smarty_internal_index] = $_attr[value]; \$_smarty_tpl->append($_attr[var],\$_tmp,true,$_nocache,$_scope); unset (\$_tmp);?>";
- }
+ if (isset($parameter['smarty_internal_index'])) {
+ return "<?php if (!isset(\$_smarty_tpl->tpl_vars[$_attr[var]]) || !is_array(\$_smarty_tpl->tpl_vars[$_attr[var]]->value)) \$_smarty_tpl->createLocalArrayVariable($_attr[var], $_nocache, $_scope);\n\$_smarty_tpl->tpl_vars[$_attr[var]]->value$parameter[smarty_internal_index] = $_attr[value];?>";
} else {
- return "<?php \$_smarty_tpl->assign($_attr[var],$_attr[value],$_nocache,$_scope);?>";
+ return "<?php \$_smarty_tpl->tpl_vars[$_attr[var]] = new Smarty_variable($_attr[value], $_nocache, $_scope);?>";
}
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_block.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_block.php
index 45bca20449513609740a4b46a2522342323d7085..fc003dd71526f1c16747580ffd6c358188a9aa49 100644 (file)
<?php
/**
-* Smarty Internal Plugin Compile Block
-*
-* Compiles the {block}{/block} tags
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Compile Block
+ *
+ * Compiles the {block}{/block} tags
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Block Class
-*/
+ * Smarty Internal Plugin Compile Block Class
+ */
class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
+ // attribute definitions
+ public $required_attributes = array('name');
+ public $shorttag_order = array('name');
/**
- * Compiles code for the {block} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return boolean true
- */
+ * 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','nocache');
// check and get attributes
$_attr = $this->_get_attributes($args);
- $save = array($_attr, $compiler->template->extracted_compiled_code, $compiler->template->extract_code, $this->compiler->nocache);
+ $save = array($_attr, $compiler->parser->current_buffer, $this->compiler->nocache, $this->compiler->smarty->merge_compiled_includes, $compiler->smarty->inheritance);
$this->_open_tag('block', $save);
- if (isset($_attr['nocache'])) {
- if ($_attr['nocache'] == 'true') {
- $compiler->nocache = true;
- }
- }
+ if ($_attr['nocache'] == true) {
+ $compiler->nocache = true;
+ }
+ // set flag for {block} tag
+ $compiler->smarty->inheritance = true;
+ // must merge includes
+ $this->compiler->smarty->merge_compiled_includes = true;
- $compiler->template->extract_code = true;
- $compiler->template->extracted_compiled_code = '';
+ $compiler->parser->current_buffer = new _smarty_template_buffer($compiler->parser);
$compiler->has_code = false;
return true;
- }
-}
+ }
+
+
+ static function saveBlockData($block_content, $block_tag, $template, $filepath)
+ {
+ $_rdl = preg_quote($template->smarty->right_delimiter);
+ $_ldl = preg_quote($template->smarty->left_delimiter);
+
+ if (0 == preg_match("!({$_ldl}block\s+)(name=)?(\w+|'.*'|\".*\")(\s*?)?((append|prepend|nocache)(=true)?)?(\s*{$_rdl})!", $block_tag, $_match)) {
+ $error_text = 'Syntax Error in template "' . $template->getTemplateFilepath() . '" "' . htmlspecialchars($block_tag) . '" illegal options';
+ throw new SmartyCompilerException($error_text);
+ } else {
+ $_name = trim($_match[3], '\'"');
+ // replace {$smarty.block.child}
+ if (strpos($block_content, $template->smarty->left_delimiter . '$smarty.block.child' . $template->smarty->right_delimiter) !== false) {
+ if (isset($template->block_data[$_name])) {
+ $block_content = str_replace($template->smarty->left_delimiter . '$smarty.block.child' . $template->smarty->right_delimiter,
+ $template->block_data[$_name]['source'], $block_content);
+ unset($template->block_data[$_name]);
+ } else {
+ $block_content = str_replace($template->smarty->left_delimiter . '$smarty.block.child' . $template->smarty->right_delimiter,
+ '', $block_content);
+ }
+ }
+ if (isset($template->block_data[$_name])) {
+ if (strpos($template->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) {
+ $template->block_data[$_name]['source'] =
+ str_replace('%%%%SMARTY_PARENT%%%%', $block_content, $template->block_data[$_name]['source']);
+ } elseif ($template->block_data[$_name]['mode'] == 'prepend') {
+ $template->block_data[$_name]['source'] .= $block_content;
+ } elseif ($template->block_data[$_name]['mode'] == 'append') {
+ $template->block_data[$_name]['source'] = $block_content . $template->block_data[$_name]['source'];
+ }
+ } else {
+ $template->block_data[$_name]['source'] = $block_content;
+ }
+ if ($_match[6] == 'append') {
+ $template->block_data[$_name]['mode'] = 'append';
+ } elseif ($_match[6] == 'prepend') {
+ $template->block_data[$_name]['mode'] = 'prepend';
+ } else {
+ $template->block_data[$_name]['mode'] = 'replace';
+ }
+ $template->block_data[$_name]['file'] = $filepath;
+ }
+ }
+
+ static function compileChildBlock ($compiler, $_name = null)
+ {
+ $_output = '';
+ // if called by {$smarty.block.child} we must search the name of enclosing {block}
+ if ($_name == null) {
+ $stack_count = count($compiler->_tag_stack);
+ while (--$stack_count >= 0) {
+ if ($compiler->_tag_stack[$stack_count][0] == 'block') {
+ $_name = trim($compiler->_tag_stack[$stack_count][1][0]['name'] ,"'\"");
+ break;
+ }
+ }
+ // flag that child is already compile by {$smarty.block.child} inclusion
+ $compiler->template->block_data[$_name]['compiled'] = true;
+ }
+ if ($_name == null) {
+ $compiler->trigger_template_error('{$smarty.block.child} used out of context', $compiler->lex->taglineno);
+ }
+ // undefined child?
+ if (!isset($compiler->template->block_data[$_name])) {
+ return '';
+ }
+ $_tpl = new Smarty_Internal_template ('eval:' . $compiler->template->block_data[$_name]['source'], $compiler->smarty, $compiler->template, $compiler->template->cache_id,
+ $compiler->template->compile_id = null, $compiler->template->caching, $compiler->template->cache_lifetime);
+ $_tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash'];
+ $_tpl->template_filepath = $compiler->template->block_data[$_name]['file'];
+ if ($compiler->nocache) {
+ $_tpl->forceNocache = 2;
+ } else {
+ $_tpl->forceNocache = 1;
+ }
+ $_tpl->suppressHeader = true;
+ $_tpl->suppressFileDependency = true;
+ if (strpos($compiler->template->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) {
+ $_output = str_replace('%%%%SMARTY_PARENT%%%%', $compiler->parser->current_buffer->to_smarty_php(), $_tpl->getCompiledTemplate());
+ } elseif ($compiler->template->block_data[$_name]['mode'] == 'prepend') {
+ $_output = $_tpl->getCompiledTemplate() . $compiler->parser->current_buffer->to_smarty_php();
+ } elseif ($compiler->template->block_data[$_name]['mode'] == 'append') {
+ $_output = $compiler->parser->current_buffer->to_smarty_php() . $_tpl->getCompiledTemplate();
+ } elseif (!empty($compiler->template->block_data[$_name])) {
+ $_output = $_tpl->getCompiledTemplate();
+ }
+ $compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $_tpl->properties['file_dependency']);
+ $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $_tpl->properties['function']);
+ if ($_tpl->has_nocache_code) {
+ $compiler->template->has_nocache_code = true;
+ }
+ foreach($_tpl->required_plugins as $code => $tmp1) {
+ foreach($tmp1 as $name => $tmp) {
+ foreach($tmp as $type => $data) {
+ $compiler->template->required_plugins[$code][$name][$type] = $data;
+ }
+ }
+ }
+ unset($_tpl);
+ return $_output;
+ }
+
+}
/**
-* Smarty Internal Plugin Compile BlockClose Class
-*/
+ * 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
- */
+ * 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;
+ $this->compiler->has_code = true;
// 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'] . '"');
- }
+ $saved_data = $this->_close_tag(array('block'));
$_name = trim($saved_data[0]['name'], "\"'");
- if (isset($this->smarty->block_data[$_name])) {
- $_tpl = $this->smarty->createTemplate('string:' . $this->smarty->block_data[$_name]['source'], null, null, $compiler->template);
- $_tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash'];
- $_tpl->template_filepath = $this->smarty->block_data[$_name]['file'];
- if ($compiler->nocache) {
- $_tpl->forceNocache = 2;
- } else {
- $_tpl->forceNocache = 1;
- }
- $_tpl->suppressHeader = true;
- $_tpl->suppressFileDependency = true;
- if (strpos($this->smarty->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) {
- $_output = str_replace('%%%%SMARTY_PARENT%%%%', $compiler->template->extracted_compiled_code, $_tpl->getCompiledTemplate());
- } elseif ($this->smarty->block_data[$_name]['mode'] == 'prepend') {
- $_output = $_tpl->getCompiledTemplate() . $compiler->template->extracted_compiled_code;
- } elseif ($this->smarty->block_data[$_name]['mode'] == 'append') {
- $_output = $compiler->template->extracted_compiled_code . $_tpl->getCompiledTemplate();
- } elseif (!empty($this->smarty->block_data[$_name])) {
- $_output = $_tpl->getCompiledTemplate();
- }
- $compiler->template->properties['file_dependency'] = array_merge($compiler->template->properties['file_dependency'], $_tpl->properties['file_dependency']);
- $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $_tpl->properties['function']);
- $compiler->template->required_plugins['compiled'] = array_merge($compiler->template->required_plugins['compiled'], $_tpl->required_plugins['compiled']);
- $compiler->template->required_plugins['cache'] = array_merge($compiler->template->required_plugins['cache'], $_tpl->required_plugins['cache']);
- unset($_tpl);
+ if (isset($compiler->template->block_data[$_name]) && !isset($compiler->template->block_data[$_name]['compiled'])) {
+ $_output = Smarty_Internal_Compile_Block::compileChildBlock($compiler, $_name);
} else {
- $_output = $compiler->template->extracted_compiled_code;
- }
- $compiler->template->extracted_compiled_code = $saved_data[1];
- $compiler->template->extract_code = $saved_data[2];
- $compiler->nocache = $saved_data[3];
+ $_output = $compiler->parser->current_buffer->to_smarty_php();
+ unset ($compiler->template->block_data[$_name]['compiled']);
+ }
+ // reset flags
+ $compiler->parser->current_buffer = $saved_data[1];
+ $compiler->nocache = $saved_data[2];
+ $compiler->smarty->merge_compiled_includes = $saved_data[3];
+ $compiler->smarty->inheritance = $saved_data[4];
// $_output content has already nocache code processed
$compiler->suppressNocacheProcessing = true;
return $_output;
- }
-}
-
-?>
+ }
+}
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_break.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_break.php
--- /dev/null
@@ -0,0 +1,65 @@
+<?php\r
+\r
+/**\r
+ * Smarty Internal Plugin Compile Break\r
+ * \r
+ * Compiles the {break} tag\r
+ * \r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Uwe Tews \r
+ */\r
+/**\r
+ * Smarty Internal Plugin Compile Break Class\r
+ */\r
+class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase {\r
+ // attribute definitions\r
+ public $optional_attributes = array('levels'); \r
+ public $shorttag_order = array('levels');\r
+\r
+\r
+ /**\r
+ * Compiles code for the {break} tag\r
+ * \r
+ * @param array $args array with attributes from parser\r
+ * @param object $compiler compiler object\r
+ * @param array $parameter array with compilation parameter\r
+ * @return string compiled code\r
+ */\r
+ public function compile($args, $compiler, $parameter)\r
+ { \r
+ $this->compiler = $compiler;\r
+ $this->smarty = $compiler->smarty;\r
+ // check and get attributes\r
+ $_attr = $this->_get_attributes($args);\r
+\r
+ if ($_attr['nocache'] === true) {\r
+ $this->compiler->trigger_template_error('nocache option not allowed', $this->compiler->lex->taglineno);\r
+ }\r
+\r
+ if (isset($_attr['levels'])) {\r
+ if (!is_numeric($_attr['levels'])) {\r
+ $this->compiler->trigger_template_error('level attribute must be a numeric constant', $this->compiler->lex->taglineno);\r
+ } \r
+ $_levels = $_attr['levels'];\r
+ } else {\r
+ $_levels = 1;\r
+ } \r
+ $level_count = $_levels;\r
+ $stack_count = count($compiler->_tag_stack) - 1;\r
+ while ($level_count > 0 && $stack_count >= 0) {\r
+ if (in_array($compiler->_tag_stack[$stack_count][0], array('for', 'foreach', 'while', 'section'))) {\r
+ $level_count--;\r
+ } \r
+ $stack_count--;\r
+ } \r
+ if ($level_count != 0) {\r
+ $this->compiler->trigger_template_error("cannot break {$_levels} level(s)", $this->compiler->lex->taglineno);\r
+ } \r
+ // this tag does not return compiled code\r
+ $this->compiler->has_code = true;\r
+ return "<?php break {$_levels}?>";\r
+ } \r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_call.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_call.php
index 6fd8aa89f0543e77c67f8952a8af3012420f8b79..50ba6328d3209906ced4a6ae272ac0f26c4b3d7c 100644 (file)
<?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
+ *
+ * Compiles the calls of user defined tags defined by {function}
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Function_Call Class
-*/
+ * Smarty Internal Plugin Compile Function_Call Class
+ */
class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase {
+ // attribute definitions
+ public $required_attributes = array('name');
+ public $shorttag_order = array('name');
+ 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
- * @return string compiled code
- */
+ * 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)
{
$this->compiler = $compiler;
- $this->required_attributes = array('name');
- $this->optional_attributes = array('_any');
+ $this->smarty = $compiler->smarty;
// check and get attributes
$_attr = $this->_get_attributes($args);
- // save posible attributes
+ // 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'];
+ unset($_attr['name'], $_attr['assign'], $_attr['nocache']);
// set flag (compiled code of {function} must be included in cache file
- if ($this->compiler->nocache || $this->compiler->tag_nocache) {
- $nocache = 'true';
+ if ($compiler->nocache || $compiler->tag_nocache) {
+ $_nocache = 'true';
} else {
- $nocache = 'false';
+ $_nocache = 'false';
}
- // create template object
- $_output = "<?php \$_template = new Smarty_Internal_Function_Call_Handler ({$_attr['name']}, \$_smarty_tpl->smarty, \$_smarty_tpl, {$nocache});\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";
+ $_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($this->smarty->template_functions[$_name]['parameter'])) {
+ foreach ($this->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)) {
- $_output .= "\$_smarty_tpl->assign({$_assign},\$_template->getRenderedTemplate());\n";
+ 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 {
- $_output .= "echo \$_template->getRenderedTemplate();\n";
+ 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";
+ }
}
- $_output .= 'unset($_template);?>';
return $_output;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_capture.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_capture.php
index 752cb3ae0d41823c540675b1c6624565c823d468..74ade6804288aebfcfe1ed4e64b4eb0f5359577e 100644 (file)
<?php
/**
-* Smarty Internal Plugin Compile Capture
-*
-* Compiles the {capture} tag
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Compile Capture
+ *
+ * Compiles the {capture} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Capture Class
-*/
+ * Smarty Internal Plugin Compile Capture Class
+ */
class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase {
+ // attribute definitions
+ public $shorttag_order = array('name');
+ public $optional_attributes = array('name', 'assign', 'append');
+
/**
- * Compiles code for the {capture} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
+ * 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);
$assign = isset($_attr['assign']) ? $_attr['assign'] : null;
$append = isset($_attr['append']) ? $_attr['append'] : null;
- $this->compiler->_capture_stack[] = array($buffer, $assign, $append);
-
+ $this->compiler->_capture_stack[] = array($buffer, $assign, $append, $this->compiler->nocache);
+ // maybe nocache because of nocache variables
+ $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
$_output = "<?php ob_start(); ?>";
return $_output;
}
/**
-* Smarty Internal Plugin Compile Captureclose Class
-*/
+ * 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
- */
+ * 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);
+ // must endblock be nocache?
+ if ($this->compiler->nocache) {
+ $this->compiler->tag_nocache = true;
+ }
- list($buffer, $assign, $append) = array_pop($this->compiler->_capture_stack);
+ list($buffer, $assign, $append, $this->compiler->nocache) = array_pop($this->compiler->_capture_stack);
$_output = "<?php ";
if (isset($assign)) {
if (isset($append)) {
$_output .= " \$_smarty_tpl->append($append, ob_get_contents());";
}
- $_output .= " \$_smarty_tpl->smarty->_smarty_vars['capture'][$buffer]=ob_get_clean();?>";
+ $_output .= " Smarty::\$_smarty_vars['capture'][$buffer]=ob_get_clean();?>";
return $_output;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_config_load.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_config_load.php
index 0dd1ba8287f8c3ff361bbd1ce122a417c3d83aae..733e1ac5d2782f5f6fa080ea1c3b567342488b8a 100644 (file)
<?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
+ *
+ * Compiles the {config load} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Config Load Class
-*/
+ * Smarty Internal Plugin Compile Config Load Class
+ */
class Smarty_Internal_Compile_Config_Load extends Smarty_Internal_CompileBase {
+ // attribute definitions
+ public $required_attributes = array('file');
+ public $shorttag_order = array('file','section');
+ public $optional_attributes = array('section', 'scope');
+
/**
- * Compiles code for the {config_load} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
+ * 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);
+ $_attr = $this->_get_attributes($args);
+
+ if ($_attr['nocache'] === true) {
+ $this->compiler->trigger_template_error('nocache option not allowed', $this->compiler->lex->taglineno);
+ }
+
+
// save posible attributes
$conf_file = $_attr['file'];
if (isset($_attr['section'])) {
} else {
$section = 'null';
}
- $scope = '$_smarty_tpl->smarty';
+ $scope = 'local';
+ // scope setup
if (isset($_attr['scope'])) {
- if ($_attr['scope'] == '\'local\'') {
- $scope = '$_smarty_tpl';
- } elseif ($_attr['scope'] == '\'parent\'') {
- $scope = '$_smarty_tpl->parent';
- }
+ $_attr['scope'] = trim($_attr['scope'], "'\"");
+ if (in_array($_attr['scope'],array('local','parent','root','global'))) {
+ $scope = $_attr['scope'];
+ } else {
+ $this->compiler->trigger_template_error('illegal value for "scope" attribute', $this->compiler->lex->taglineno);
+ }
}
-
// create config object
$_output = "<?php \$_config = new Smarty_Internal_Config($conf_file, \$_smarty_tpl->smarty, \$_smarty_tpl);";
- $_output .= "\$_config->loadConfigVars($section, $scope); ?>";
+ $_output .= "\$_config->loadConfigVars($section, '$scope'); ?>";
return $_output;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_continue.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_continue.php
--- /dev/null
@@ -0,0 +1,64 @@
+<?php\r
+\r
+/**\r
+ * Smarty Internal Plugin Compile Continue\r
+ * \r
+ * Compiles the {continue} tag\r
+ * \r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Uwe Tews \r
+ */\r
+/**\r
+ * Smarty Internal Plugin Compile Continue Class\r
+ */\r
+class Smarty_Internal_Compile_Continue extends Smarty_Internal_CompileBase {\r
+ // attribute definitions\r
+ public $optional_attributes = array('levels'); \r
+ public $shorttag_order = array('levels');\r
+\r
+ /**\r
+ * Compiles code for the {continue} tag\r
+ * \r
+ * @param array $args array with attributes from parser\r
+ * @param object $compiler compiler object\r
+ * @param array $parameter array with compilation parameter\r
+ * @return string compiled code\r
+ */\r
+ public function compile($args, $compiler, $parameter)\r
+ {\r
+ $this->compiler = $compiler;\r
+ $this->smarty = $compiler->smarty;\r
+ // check and get attributes\r
+ $_attr = $this->_get_attributes($args);\r
+\r
+ if ($_attr['nocache'] === true) {\r
+ $this->compiler->trigger_template_error('nocache option not allowed', $this->compiler->lex->taglineno);\r
+ }\r
+\r
+ if (isset($_attr['levels'])) {\r
+ if (!is_numeric($_attr['levels'])) {\r
+ $this->compiler->trigger_template_error('level attribute must be a numeric constant', $this->compiler->lex->taglineno);\r
+ } \r
+ $_levels = $_attr['levels'];\r
+ } else {\r
+ $_levels = 1;\r
+ } \r
+ $level_count = $_levels;\r
+ $stack_count = count($compiler->_tag_stack) - 1;\r
+ while ($level_count > 0 && $stack_count >= 0) {\r
+ if (in_array($compiler->_tag_stack[$stack_count][0], array('for', 'foreach', 'while', 'section'))) {\r
+ $level_count--;\r
+ } \r
+ $stack_count--;\r
+ } \r
+ if ($level_count != 0) {\r
+ $this->compiler->trigger_template_error("cannot continue {$_levels} level(s)", $this->compiler->lex->taglineno);\r
+ } \r
+ // this tag does not return compiled code\r
+ $this->compiler->has_code = true;\r
+ return "<?php continue {$_levels}?>";\r
+ } \r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_debug.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_debug.php
index 8ff9671a8ba7b07b0975ad3db19a65d6361fdc4a..f6189e7e1cc24904574d3f6bf5dc7f1687911ce7 100644 (file)
<?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
+ *
+ * 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
-*/
+ * 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
- */
+ * 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);
+ // compile always as nocache
+ $this->compiler->tag_nocache = true;
+
// display debug template
- $_output = "<?php \$_smarty_tpl->smarty->loadPlugin('Smarty_Internal_Debug'); Smarty_Internal_Debug::display_debug(\$_smarty_tpl->smarty); ?>";
+ $_output = "<?php \$_smarty_tpl->smarty->loadPlugin('Smarty_Internal_Debug'); Smarty_Internal_Debug::display_debug(\$_smarty_tpl); ?>";
return $_output;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_eval.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_eval.php
index 6f17de77a7a5ce0bd884eddd1a23c7526eafef6c..aa3c25807751b79a6096155e5c0695be5c5b0df2 100644 (file)
<?php
/**
-* Smarty Internal Plugin Compile Eval
-*
-* Compiles the {eval} tag
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Compile Eval
+ *
+ * Compiles the {eval} tag
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Eval Class
-*/
+ * Smarty Internal Plugin Compile Eval Class
+ */
class Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase {
+ public $required_attributes = array('var');
+ public $optional_attributes = array('assign');
+ public $shorttag_order = array('var','assign');
+
/**
- * Compiles code for the {eval} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
+ * 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;
}
// create template object
- $_output = "\$_template = new {$compiler->smarty->template_class}('string:'.".$_attr['var'].", \$_smarty_tpl->smarty, \$_smarty_tpl);";
+ $_output = "\$_template = new {$compiler->smarty->template_class}('eval:'.".$_attr['var'].", \$_smarty_tpl->smarty, \$_smarty_tpl);";
//was there an assign attribute?
if (isset($_assign)) {
$_output .= "\$_smarty_tpl->assign($_assign,\$_template->getRenderedTemplate());";
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_extends.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_extends.php
index cf4a18704231a361f8b7414e6efdb9291ad85057..b76cf98d4f2a2df6ce1efbbe19b8854df9f6f25a 100644 (file)
<?php
/**
-* Smarty Internal Plugin Compile extend
-*
-* Compiles the {extends} tag
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Compile extend
+ *
+ * Compiles the {extends} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile extend Class
-*/
+ * Smarty Internal Plugin Compile extend Class
+ */
class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase {
+ // attribute definitions
+ public $required_attributes = array('file');
+ public $shorttag_order = array('file');
+
/**
- * Compiles code for the {extends} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
+ * 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->_rdl = preg_quote($this->smarty->right_delimiter);
$this->_ldl = preg_quote($this->smarty->left_delimiter);
- $this->required_attributes = array('file');
+ $filepath = $compiler->template->getTemplateFilepath();
// check and get attributes
$_attr = $this->_get_attributes($args);
- $_smarty_tpl = $compiler->template;
- // $include_file = '';
- eval('$include_file = ' . $_attr['file'] . ';');
+ if ($_attr['nocache'] === true) {
+ $this->compiler->trigger_template_error('nocache option not allowed', $this->compiler->lex->taglineno);
+ }
+
+ $_smarty_tpl = $compiler->template;
+ $include_file = null;
+ if (strpos($_attr['file'],'$_tmp') !== false || strpos($_attr['file'],'$_smarty_tpl') !== false || strpos($_attr['file'],'::') !== false) {
+ $this->compiler->trigger_template_error('a variable file attribute is illegal', $this->compiler->lex->taglineno);
+ }
+ eval('$include_file = ' . $_attr['file'] . ';');
// create template object
- $_template = new $compiler->smarty->template_class($include_file, $this->smarty, $compiler->template);
+ $_template = new $compiler->smarty->template_class($include_file, $this->smarty, $compiler->template);
// save file dependency
- $compiler->template->properties['file_dependency'][sha1($_template->getTemplateFilepath())] = array($_template->getTemplateFilepath(), $_template->getTemplateTimestamp());
- $_old_source = $compiler->template->template_source;
- if (preg_match_all("!({$this->_ldl}block(.+?){$this->_rdl})!", $_old_source, $s, PREG_OFFSET_CAPTURE) !=
- preg_match_all("!({$this->_ldl}/block(.*?){$this->_rdl})!", $_old_source, $c, PREG_OFFSET_CAPTURE)) {
+ if (in_array($_template->resource_type,array('eval','string'))) {
+ $template_sha1 = sha1($include_file);
+ } else {
+ $template_sha1 = sha1($_template->getTemplateFilepath());
+ }
+ if (isset($compiler->template->properties['file_dependency'][$template_sha1])) {
+ $this->compiler->trigger_template_error("illegal recursive call of \"{$include_file}\"",$compiler->lex->line-1);
+ }
+ $compiler->template->properties['file_dependency'][$template_sha1] = array($_template->getTemplateFilepath(), $_template->getTemplateTimestamp(),$_template->resource_type);
+ $_content = substr($compiler->template->template_source,$compiler->lex->counter-1);
+ if (preg_match_all("!({$this->_ldl}block\s(.+?){$this->_rdl})!", $_content, $s) !=
+ preg_match_all("!({$this->_ldl}/block{$this->_rdl})!", $_content, $c)) {
$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);
- }
+ }
+ preg_match_all("!{$this->_ldl}block\s(.+?){$this->_rdl}|{$this->_ldl}/block{$this->_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE);
+ $_result_count = count($_result[0]);
+ $_start = 0;
+ while ($_start < $_result_count) {
+ $_end = 0;
+ $_level = 1;
+ while ($_level != 0) {
+ $_end++;
+ if (!strpos($_result[0][$_start + $_end][0], '/')) {
+ $_level++;
+ } else {
+ $_level--;
+ }
+ }
+ $_block_content = str_replace($this->smarty->left_delimiter . '$smarty.block.parent' . $this->smarty->right_delimiter, '%%%%SMARTY_PARENT%%%%',
+ substr($_content, $_result[0][$_start][1] + strlen($_result[0][$_start][0]), $_result[0][$_start + $_end][1] - $_result[0][$_start][1] - + strlen($_result[0][$_start][0])));
+ Smarty_Internal_Compile_Block::saveBlockData($_block_content, $_result[0][$_start][0], $compiler->template, $filepath);
+ $_start = $_start + $_end + 1;
+ }
$compiler->template->template_source = $_template->getTemplateSource();
$compiler->template->template_filepath = $_template->getTemplateFilepath();
$compiler->abort_and_recompile = true;
- return ' ';
- }
-
- protected function saveBlockData($block_content, $block_tag, $template)
- {
- if (0 == preg_match("!(.?)(name=)(.*?)(?=(\s|{$this->_rdl}))!", $block_tag, $_match)) {
- $this->compiler->trigger_template_error("\"" . $block_tag . "\" missing name attribute");
- } else {
- $_name = trim($_match[3], '\'"');
- if (isset($this->smarty->block_data[$_name])) {
- if (strpos($this->smarty->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) {
- $this->smarty->block_data[$_name]['source'] =
- str_replace('%%%%SMARTY_PARENT%%%%', $block_content, $this->smarty->block_data[$_name]['source']);
- } elseif ($this->smarty->block_data[$_name]['mode'] == 'prepend') {
- $this->smarty->block_data[$_name]['source'] .= $block_content;
- } elseif ($this->smarty->block_data[$_name]['mode'] == 'append') {
- $this->smarty->block_data[$_name]['source'] = $block_content . $this->smarty->block_data[$_name]['source'];
- }
- } else {
- $this->smarty->block_data[$_name]['source'] = $block_content;
- }
- if (preg_match('/(.?)(append)(.*)/', $block_tag, $_match) != 0) {
- $this->smarty->block_data[$_name]['mode'] = 'append';
- } elseif (preg_match('/(.?)(prepend)(.*)/', $block_tag, $_match) != 0) {
- $this->smarty->block_data[$_name]['mode'] = 'prepend';
- } else {
- $this->smarty->block_data[$_name]['mode'] = 'replace';
- }
- $this->smarty->block_data[$_name]['file'] = $template->getTemplateFilepath();
- }
- }
-}
+ return '';
+ }
-?>
+}
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_for.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_for.php
index 7b9889e242cebafbee07680808c3b55c56f7cebc..2e5d0a11f9197f61f7896d1690698c0638c5f043 100644 (file)
<?php
/**
-* Smarty Internal Plugin Compile For
-*
-* Compiles the {for} {forelse} {/for} tags
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Compile For
+ *
+ * Compiles the {for} {forelse} {/for} tags
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile For Class
-*/
+ * 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)
+ * 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
+ * @param array $parameter array with compilation parameter
+ * @return string compiled code
+ */
+ public function compile($args, $compiler, $parameter)
{
$this->compiler = $compiler;
- // {for $x=0; $x<$y; $x++} syntax
- if (isset($args['ifexp'])) {
- $this->required_attributes = array('ifexp', 'start', 'loop', 'varloop');
+ if ($parameter == 0) {
+ $this->required_attributes = array('start','to');
+ $this->optional_attributes = array('max','step');
} else {
- $this->required_attributes = array('start', 'to');
- $this->optional_attributes = array('step', 'max');
- }
+ $this->required_attributes = array('start','ifexp','var','step');
+ $this->optional_attributes = array();
+ }
// 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;
+ $local_vars = array();
$output = "<?php ";
- if (isset($_attr['ifexp'])) {
+ if ($parameter == 1) {
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";
+ $compiler->local_var[$_statement['var']] = true;
+ $local_vars[] = $_statement['var'];
}
- $output .= " if ($_attr[ifexp]){ for (\$_foo=true;$_attr[ifexp]; \$_smarty_tpl->tpl_vars[$_attr[varloop]]->value$_attr[loop]){\n";
+ $output .= " if ($_attr[ifexp]){ for (\$_foo=true;$_attr[ifexp]; \$_smarty_tpl->tpl_vars[$_attr[var]]->value$_attr[step]){\n";
} else {
$_statement = $_attr['start'];
$output .= "\$_smarty_tpl->tpl_vars[$_statement[var]] = new Smarty_Variable;";
+ $compiler->local_var[$_statement['var']] = true;
+ $local_vars[] = $_statement['var'];
if (isset($_attr['step'])) {
$output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->step = $_attr[step];";
} else {
- $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->step = ($_attr[to] - ($_statement[value]) < 0) ? -1 : 1;";
+ $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->step = 1;";
}
if (isset($_attr['max'])) {
- $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->total = (int)min(ceil((\$_smarty_tpl->tpl_vars[$_statement[var]]->step > 0 ? $_attr[to]+1 - $_statement[value] : $_statement[value]-($_attr[to])+1)/abs(\$_smarty_tpl->tpl_vars[$_statement[var]]->step)),$_attr[max]);\n";
+ $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->total = (int)min(ceil((\$_smarty_tpl->tpl_vars[$_statement[var]]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\$_smarty_tpl->tpl_vars[$_statement[var]]->step)),$_attr[max]);\n";
} else {
- $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->total = (int)ceil((\$_smarty_tpl->tpl_vars[$_statement[var]]->step > 0 ? $_attr[to]+1 - $_statement[value] : $_statement[value]-($_attr[to])+1)/abs(\$_smarty_tpl->tpl_vars[$_statement[var]]->step));\n";
+ $output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->total = (int)ceil((\$_smarty_tpl->tpl_vars[$_statement[var]]->step > 0 ? $_attr[to]+1 - ($_statement[value]) : $_statement[value]-($_attr[to])+1)/abs(\$_smarty_tpl->tpl_vars[$_statement[var]]->step));\n";
}
$output .= "if (\$_smarty_tpl->tpl_vars[$_statement[var]]->total > 0){\n";
$output .= "for (\$_smarty_tpl->tpl_vars[$_statement[var]]->value = $_statement[value], \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration = 1;\$_smarty_tpl->tpl_vars[$_statement[var]]->iteration <= \$_smarty_tpl->tpl_vars[$_statement[var]]->total;\$_smarty_tpl->tpl_vars[$_statement[var]]->value += \$_smarty_tpl->tpl_vars[$_statement[var]]->step, \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration++){\n";
$output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->first = \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration == 1;";
$output .= "\$_smarty_tpl->tpl_vars[$_statement[var]]->last = \$_smarty_tpl->tpl_vars[$_statement[var]]->iteration == \$_smarty_tpl->tpl_vars[$_statement[var]]->total;";
}
- $output .= "?>";
+ $output .= "?>";
+
+ $this->_open_tag('for', array('for', $this->compiler->nocache, $local_vars));
+ // maybe nocache because of nocache variables
+ $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
// return compiled code
return $output;
}
}
/**
-* Smarty Internal Plugin Compile Forelse Class
-*/
+ * 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)
+ * Compiles code for the {forelse} 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)
{
$this->compiler = $compiler;
// check and get attributes
- $_attr = $this->_get_attributes($args);
+ $_attr = $this->_get_attributes($args);
- list($_open_tag, $nocache) = $this->_close_tag(array('for'));
- $this->_open_tag('forelse', array('forelse', $nocache));
+ list($_open_tag, $nocache, $local_vars) = $this->_close_tag(array('for'));
+ $this->_open_tag('forelse', array('forelse', $nocache, $local_vars));
return "<?php }} else { ?>";
}
}
/**
-* Smarty Internal Plugin Compile Forclose Class
-*/
+ * 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)
+ * Compiles code for the {/for} 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)
{
$this->compiler = $compiler;
// check and get attributes
- $_attr = $this->_get_attributes($args);
+ $_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'));
+ list($_open_tag, $this->compiler->nocache, $local_vars) = $this->_close_tag(array('for', 'forelse'));
+
+ foreach ($local_vars as $var) {
+ unset($compiler->local_var[$var]);
+ }
if ($_open_tag == 'forelse')
return "<?php } ?>";
else
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_foreach.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_foreach.php
index 09801fda5721c908147c002f3b4f702edcfcf90e..6ad1e07ef3d64a32f7f285219f717380e99b6353 100644 (file)
<?php
/**
-* Smarty Internal Plugin Compile Foreach
-*
-* Compiles the {foreach} {foreachelse} {/foreach} tags
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Compile Foreach
+ *
+ * Compiles the {foreach} {foreachelse} {/foreach} tags
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Foreach Class
-*/
+ * Smarty Internal Plugin Compile Foreach Class
+ */
class Smarty_Internal_Compile_Foreach extends Smarty_Internal_CompileBase {
+ // attribute definitions
+ public $required_attributes = array('from', 'item');
+ public $optional_attributes = array('name', 'key');
+ public $shorttag_order = array('from','item','key','name');
+
/**
- * 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)
+ * Compiles code for the {foreach} 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)
{
$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 (substr_compare("\$_smarty_tpl->getVariable($item)", $from,0, strlen("\$_smarty_tpl->getVariable($item)")) == 0) {
+ $this->compiler->trigger_template_error("item variable {$item} may not be the same variable as at 'from'", $this->compiler->lex->taglineno);
+ }
+
if (isset($_attr['key'])) {
$key = $_attr['key'];
} else {
$key = null;
}
+ $this->_open_tag('foreach', array('foreach', $this->compiler->nocache, $item, $key));
+ // maybe nocache because of nocache variables
+ $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
+
if (isset($_attr['name'])) {
$name = $_attr['name'];
$has_name = true;
- $SmartyVarName = '$smarty.foreach.' . trim($name,'\'"') . '.';
+ $SmartyVarName = '$smarty.foreach.' . trim($name, '\'"') . '.';
} else {
$name = null;
$has_name = false;
}
- $ItemVarName = '$' . trim($item,'\'"') . '@';
+ $ItemVarName = '$' . trim($item, '\'"') . '@';
// evaluates which Smarty variables and properties have to be computed
if ($has_name) {
$usesSmartyFirst = strpos($tpl->template_source, $SmartyVarName . 'first') !== 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;
+ $usesSmartyTotal = strpos($tpl->template_source, $SmartyVarName . 'total') !== false;
} else {
$usesSmartyFirst = false;
$usesSmartyLast = false;
$usesSmartyTotal = false;
- }
+ $usesSmartyShow = 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;
+ $usesPropTotal = $usesSmartyTotal || $usesSmartyShow || $usesPropShow || $usesPropLast || strpos($tpl->template_source, $ItemVarName . 'total') !== false;
// generate output code
$output = "<?php ";
$output .= " \$_smarty_tpl->tpl_vars[$item] = new Smarty_Variable;\n";
+ $compiler->local_var[$item] = true;
if ($key != null) {
$output .= " \$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable;\n";
+ $compiler->local_var[$key] = true;
}
$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";
+ $output .= " \$_smarty_tpl->tpl_vars[$item]->total= \$_smarty_tpl->_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 ($usesPropShow) {
+ $output .= " \$_smarty_tpl->tpl_vars[$item]->show = (\$_smarty_tpl->tpl_vars[$item]->total > 0);\n";
+ }
if ($has_name) {
if ($usesSmartyTotal) {
$output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['total'] = \$_smarty_tpl->tpl_vars[$item]->total;\n";
if ($usesSmartyIndex) {
$output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['index']=-1;\n";
}
+ if ($usesSmartyShow) {
+ $output .= " \$_smarty_tpl->tpl_vars['smarty']->value['foreach'][$name]['show']=(\$_smarty_tpl->tpl_vars[$item]->total > 0);\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 ($usesPropTotal) {
+ $output .= "if (\$_smarty_tpl->tpl_vars[$item]->total > 0){\n";
+ } else {
+ $output .= "if (\$_smarty_tpl->_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";
}
}
/**
-* Smarty Internal Plugin Compile Foreachelse Class
-*/
+ * 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)
+ * Compiles code for the {foreachelse} 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)
{
$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));
+ list($_open_tag, $nocache, $item, $key) = $this->_close_tag(array('foreach'));
+ $this->_open_tag('foreachelse', array('foreachelse', $nocache, $item, $key));
return "<?php }} else { ?>";
}
}
/**
-* Smarty Internal Plugin Compile Foreachclose Class
-*/
+ * 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)
+ * Compiles code for the {/foreach} 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)
{
$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;
- }
+ $_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'));
+ list($_open_tag, $this->compiler->nocache, $item, $key) = $this->_close_tag(array('foreach', 'foreachelse'));
+ unset($compiler->local_var[$item]);
+ if ($key != null) {
+ unset($compiler->local_var[$key]);
+ }
if ($_open_tag == 'foreachelse')
return "<?php } ?>";
else
return "<?php }} ?>";
}
-}
+}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_function.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_function.php
index 23fc27d68d73ccd58fc63f1792e1fb8393065c7e..db2409a30552150e7ea511f4a2ba52e174497b4c 100644 (file)
<?php
/**
-* Smarty Internal Plugin Compile Function
-*
-* Compiles the {function} {/function} tags
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Compile Function
+ *
+ * Compiles the {function} {/function} tags
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Function Class
-*/
+ * Smarty Internal Plugin Compile Function Class
+ */
class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase {
+ // attribute definitions
+ public $required_attributes = array('name');
+ public $shorttag_order = array('name');
+ public $optional_attributes = array('_any');
+
/**
- * Compiles code for the {function} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
+ * Compiles code for the {function} tag
+ *
+ * @param array $args array with attributes from parser
+ * @param object $compiler compiler object
+ * @param array $parameter array with compilation parameter
* @return boolean true
- */
- public function compile($args, $compiler)
+ */
+ public function compile($args, $compiler, $parameter)
{
$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,
+
+ if ($_attr['nocache'] === true) {
+ $this->compiler->trigger_template_error('nocache option not allowed', $this->compiler->lex->taglineno);
+ }
+ unset($_attr['nocache']);
+ $save = array($_attr, $compiler->parser->current_buffer,
$compiler->template->has_nocache_code, $compiler->template->required_plugins);
$this->_open_tag('function', $save);
$_name = trim($_attr['name'], "'\"");
unset($_attr['name']);
+ $compiler->template->properties['function'][$_name]['parameter'] = array();
+ $_smarty_tpl = $compiler->template;
foreach ($_attr as $_key => $_data) {
- $compiler->template->properties['function'][$_name]['parameter'][$_key] = $_data;
+ eval ('$tmp='.$_data.';');
+ $compiler->template->properties['function'][$_name]['parameter'][$_key] = $tmp;
+ }
+ $compiler->smarty->template_functions[$_name]['parameter'] = $compiler->template->properties['function'][$_name]['parameter'];
+ if ($compiler->template->caching) {
+ $output = '';
+ } else {
+ $output = "<?php if (!function_exists('smarty_template_function_{$_name}')) {
+ function smarty_template_function_{$_name}(\$_smarty_tpl,\$params) {
+ \$saved_tpl_vars = \$_smarty_tpl->tpl_vars;
+ foreach (\$_smarty_tpl->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);}?>";
}
- // make function known for recursive calls
- $this->compiler->smarty->template_functions[$_name]['compiled'] = '';
// Init temporay context
- $compiler->template->required_plugins = array('compiled' => array(), 'cache' => array());
- $compiler->template->extract_code = true;
- $compiler->template->extracted_compiled_code = '';
+ $compiler->template->required_plugins = array('compiled' => array(), 'nocache' => array());
+ $compiler->parser->current_buffer = new _smarty_template_buffer($compiler->parser);
+ $compiler->parser->current_buffer->append_subtree(new _smarty_tag($compiler->parser, $output));
$compiler->template->has_nocache_code = false;
$compiler->has_code = false;
+ $compiler->template->properties['function'][$_name]['compiled'] = '';
return true;
}
}
/**
-* Smarty Internal Plugin Compile Functionclose Class
-*/
+ * 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)
+ * Compiles code for the {/function} tag
+ *
+ * @param array $args array with attributes from parser
+ * @param object $compiler compiler object
+ * @param array $parameter array with compilation parameter
+ * @return boolean true
+ */
+ public function compile($args, $compiler, $parameter)
{
$this->compiler = $compiler;
- $this->compiler->has_code = false;
$_attr = $this->_get_attributes($args);
$saved_data = $this->_close_tag(array('function'));
- $_name = trim($saved_data[0]['name'], "'");
+ $_name = trim($saved_data[0]['name'], "'\"");
// build plugin include code
$plugins_string = '';
if (!empty($compiler->template->required_plugins['compiled'])) {
$plugins_string = '<?php ';
- foreach($compiler->template->required_plugins['compiled'] as $plugin_name => $data) {
- $plugin = 'smarty_' . $data['type'] . '_' . $plugin_name;
- $plugins_string .= "if (!is_callable('{$plugin}')) include '{$data['file']}';\n";
+ foreach($compiler->template->required_plugins['compiled'] as $tmp) {
+ foreach($tmp as $data) {
+ $plugins_string .= "if (!is_callable('{$data['function']}')) include '{$data['file']}';\n";
+ }
}
$plugins_string .= '?>';
}
- if (!empty($compiler->template->required_plugins['cache'])) {
+ if (!empty($compiler->template->required_plugins['nocache'])) {
$plugins_string .= "<?php echo '/*%%SmartyNocache:{$compiler->template->properties['nocache_hash']}%%*/<?php ";
- foreach($compiler->template->required_plugins['cache'] as $plugin_name => $data) {
- $plugin = 'smarty_' . $data['type'] . '_' . $plugin_name;
- $plugins_string .= "if (!is_callable(\'{$plugin}\')) include \'{$data['file']}\';\n";
+ foreach($compiler->template->required_plugins['nocache'] as $tmp) {
+ foreach($tmp as $data) {
+ $plugins_string .= "if (!is_callable(\'{$data['function']}\')) include \'{$data['file']}\';\n";
+ }
}
$plugins_string .= "?>/*/%%SmartyNocache:{$compiler->template->properties['nocache_hash']}%%*/';?>\n";
}
- $compiler->template->properties['function'][$_name]['compiled'] = $plugins_string . $compiler->template->extracted_compiled_code;
- $compiler->template->properties['function'][$_name]['nocache_hash'] = $compiler->template->properties['nocache_hash'];
- $compiler->template->properties['function'][$_name]['has_nocache_code'] = $compiler->template->has_nocache_code;
-// $compiler->template->properties['function'][$_name]['plugins'] = $compiler->template->required_plugins;
- $this->compiler->smarty->template_functions[$_name] = $compiler->template->properties['function'][$_name];
+ // remove last line break from function definition
+ $last = count($compiler->parser->current_buffer->subtrees) - 1;
+ if ($compiler->parser->current_buffer->subtrees[$last] instanceof _smarty_linebreak) {
+ unset($compiler->parser->current_buffer->subtrees[$last]);
+ }
+ // if caching save template function for possible nocache call
+ if ($compiler->template->caching) {
+ $compiler->template->properties['function'][$_name]['compiled'] .= $plugins_string
+ . $compiler->parser->current_buffer->to_smarty_php();
+ $compiler->template->properties['function'][$_name]['nocache_hash'] = $compiler->template->properties['nocache_hash'];
+ $compiler->template->properties['function'][$_name]['has_nocache_code'] = $compiler->template->has_nocache_code;
+ $compiler->smarty->template_functions[$_name] = $compiler->template->properties['function'][$_name];
+ $compiler->has_code = false;
+ $output = true;
+ } else {
+ $output = $plugins_string . $compiler->parser->current_buffer->to_smarty_php() . "<?php \$_smarty_tpl->tpl_vars = \$saved_tpl_vars;}}?>\n";
+ }
// restore old compiler status
- $compiler->template->extracted_compiled_code = $saved_data[1];
- $compiler->template->extract_code = $saved_data[2];
- $compiler->template->has_nocache_code = $saved_data[3];
- $compiler->template->required_plugins = $saved_data[4];
- return true;
+ $compiler->parser->current_buffer = $saved_data[1];
+ $compiler->template->has_nocache_code = $compiler->template->has_nocache_code | $saved_data[2];
+ $compiler->template->required_plugins = $saved_data[3];
+ return $output;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_if.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_if.php
index 9d05f4245ebdb491ecf31c311f2cc7fb815dba5f..41e6597e46f409ace28b748e7c3f41c2e700e174 100644 (file)
<?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
+ *
+ * Compiles the {if} {else} {elseif} {/if} tags
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile If Class
-*/
+ * 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)
+ * Compiles code for the {if} 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)
{
$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']."){?>";
+ $this->_open_tag('if',array(1,$this->compiler->nocache));
+ // must whole block be nocache ?
+ $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
+ if (is_array($parameter['if condition'])) {
+ if ($this->compiler->nocache) {
+ $_nocache = ',true';
+ // create nocache var to make it know for further compiling
+ if (is_array($parameter['if condition']['var'])) {
+ $this->compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_variable(null, true);
+ } else {
+ $this->compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_variable(null, true);
+ }
+ } else {
+ $_nocache = '';
+ }
+ if (is_array($parameter['if condition']['var'])) {
+ $_output = "<?php if (!isset(\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]) || !is_array(\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]->value)) \$_smarty_tpl->createLocalArrayVariable(".$parameter['if condition']['var']['var']."$_nocache);\n";
+ $_output .= "if (\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]->value".$parameter['if condition']['var']['smarty_internal_index']." = ".$parameter['if condition']['value']."){?>";
+ } else {
+ $_output = "<?php \$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']."] = new Smarty_Variable(\$_smarty_tpl->getVariable(".$parameter['if condition']['var'].",null,true,false)->value{$_nocache});";
+ $_output .= "if (\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']."]->value = ".$parameter['if condition']['value']."){?>";
+ }
return $_output;
} else {
- return "<?php if ({$args['if condition']}){?>";
+ return "<?php if ({$parameter['if condition']}){?>";
}
}
}
/**
-* Smarty Internal Plugin Compile Else Class
-*/
+ * 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)
+ * Compiles code for the {else} 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)
{
$this->compiler = $compiler;
list($nesting, $compiler->tag_nocache) = $this->_close_tag(array('if', 'elseif'));
}
/**
-* Smarty Internal Plugin Compile ElseIf Class
-*/
+ * 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)
+ * Compiles code for the {elseif} 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)
{
$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 (is_array($parameter['if condition'])) {
+ $condition_by_assign = true;
+ if ($this->compiler->nocache) {
+ $_nocache = ',true';
+ // create nocache var to make it know for further compiling
+ if (is_array($parameter['if condition']['var'])) {
+ $this->compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_variable(null, true);
+ } else {
+ $this->compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_variable(null, true);
+ }
+ } else {
+ $_nocache = '';
+ }
+ } else {
+ $condition_by_assign = false;
+ }
+
if (empty($this->compiler->prefix_code)) {
- $this->_open_tag('elseif', array($nesting, $compiler->tag_nocache));
- return "<?php }elseif({$args['if condition']}){?>";
+ if ($condition_by_assign) {
+ $this->_open_tag('elseif', array($nesting + 1, $compiler->tag_nocache));
+ if (is_array($parameter['if condition']['var'])) {
+ $_output = "<?php }else{ if (!isset(\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]) || !is_array(\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]->value)) \$_smarty_tpl->createLocalArrayVariable(".$parameter['if condition']['var']['var']."$_nocache);\n";
+ $_output .= "if (\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]->value".$parameter['if condition']['var']['smarty_internal_index']." = ".$parameter['if condition']['value']."){?>";
+ } else {
+ $_output = "<?php }else{ \$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']."] = new Smarty_Variable(\$_smarty_tpl->getVariable(".$parameter['if condition']['var'].",null,true,false)->value{$_nocache});";
+ $_output .= "if (\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']."]->value = ".$parameter['if condition']['value']."){?>";
+ }
+ return $_output;
+ } else {
+ $this->_open_tag('elseif', array($nesting, $compiler->tag_nocache));
+ return "<?php }elseif({$parameter['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']}){?>";
+ if ($condition_by_assign) {
+ if (is_array($parameter['if condition']['var'])) {
+ $_output = "<?php }else{?>{$tmp}<?php if (!isset(\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]) || !is_array(\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]->value)) \$_smarty_tpl->createLocalArrayVariable(".$parameter['if condition']['var']['var']."$_nocache);\n";
+ $_output .= "if (\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]->value".$parameter['if condition']['var']['smarty_internal_index']." = ".$parameter['if condition']['value']."){?>";
+ } else {
+ $_output = "<?php }else{?>{$tmp}<?php \$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']."] = new Smarty_Variable(\$_smarty_tpl->getVariable(".$parameter['if condition']['var'].",null,true,false)->value{$_nocache});";
+ $_output .= "if (\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']."]->value = ".$parameter['if condition']['value']."){?>";
+ }
+ return $_output;
+ } else {
+ return "<?php }else{?>{$tmp}<?php if ({$parameter['if condition']}){?>";
+ }
}
}
}
*
* @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)
+ public function compile($args, $compiler, $parameter)
{
$this->compiler = $compiler;
- list($nesting, $compiler->tag_nocache) = $this->_close_tag(array('if', 'else', 'elseif'));
+ // must endblock be nocache?
+ if ($this->compiler->nocache) {
+ $this->compiler->tag_nocache = true;
+ }
+ list($nesting, $this->compiler->nocache) = $this->_close_tag(array('if', 'else', 'elseif'));
$tmp = '';
for ($i = 0; $i < $nesting ; $i++) $tmp .= '}';
return "<?php {$tmp}?>";
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_include.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_include.php
index f82f038e8846224f1f052440904ccc510d8cc091..a3b3c9444a3da22ca45003e37183ccaa8d531a1a 100644 (file)
<?php
/**
-* Smarty Internal Plugin Compile Include
-*
-* Compiles the {include} tag
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Compile Include
+ *
+ * Compiles the {include} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Include Class
-*/
+ * Smarty Internal Plugin Compile Include Class
+ */
class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase {
+ // caching mode to create nocache code but no cache file
+ const CACHING_NOCACHE_CODE = 9999;
+ // attribute definitions
+ public $required_attributes = array('file');
+ public $shorttag_order = array('file');
+ public $option_flags = array('nocache','inline','caching');
+ public $optional_attributes = array('_any');
+
/**
- * Compiles code for the {include} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
+ * 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 || isset($_attr['inline'])) {
+ if ($compiler->smarty->merge_compiled_includes || $_attr['inline'] === true) {
// 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;");
+ $tmp = null;
+ 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);
+ $tpl = new $compiler->smarty->template_class ($tmp, $compiler->smarty, $compiler->template, $compiler->template->cache_id, $compiler->template->compile_id);
+ // suppress writing of compiled file
+ $tpl->write_compiled_code = false;
if ($this->compiler->template->caching) {
// needs code for cached page but no cache file
- $tpl->caching = 9999;
+ $tpl->caching = self::CACHING_NOCACHE_CODE;
}
+// if ($this->compiler->template->mustCompile) {
+ // make sure whole chain gest compiled
+ $tpl->mustCompile = true;
+// }
if ($tpl->resource_object->usesCompiler && $tpl->isExisting()) {
- // make sure that template is up to date and merge template properties
- $tpl->renderTemplate();
- // compiled code for {function} tags
- $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $tpl->properties['function']);
// get compiled code
$compiled_tpl = $tpl->getCompiledTemplate();
+ // merge compiled code for {function} tags
+ $compiler->template->properties['function'] = array_merge($compiler->template->properties['function'], $tpl->properties['function']);
+ // merge filedependency by evaluating header code
+ preg_match_all("/(<\?php \/\*%%SmartyHeaderCode:{$tpl->properties['nocache_hash']}%%\*\/(.+?)\/\*\/%%SmartyHeaderCode%%\*\/\?>\n)/s", $compiled_tpl, $result);
+ $saved_has_nocache_code = $compiler->template->has_nocache_code;
+ $saved_nocache_hash = $compiler->template->properties['nocache_hash'];
+ $_smarty_tpl = $compiler->template;
+ eval($result[2][0]);
+ $compiler->template->properties['nocache_hash'] = $saved_nocache_hash;
+ $compiler->template->has_nocache_code = $saved_has_nocache_code;
// remove header code
$compiled_tpl = preg_replace("/(<\?php \/\*%%SmartyHeaderCode:{$tpl->properties['nocache_hash']}%%\*\/(.+?)\/\*\/%%SmartyHeaderCode%%\*\/\?>\n)/s", '', $compiled_tpl);
if ($tpl->has_nocache_code) {
$_assign = $_attr['assign'];
}
- $_parent_scope = SMARTY_LOCAL_SCOPE;
+ $_parent_scope = Smarty::SCOPE_LOCAL;
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;
+ $_attr['scope'] = trim($_attr['scope'], "'\"");
+ if ($_attr['scope'] == 'parent') {
+ $_parent_scope = Smarty::SCOPE_PARENT;
+ } elseif ($_attr['scope'] == 'root') {
+ $_parent_scope = Smarty::SCOPE_ROOT;
+ } elseif ($_attr['scope'] == 'global') {
+ $_parent_scope = Smarty::SCOPE_GLOBAL;
}
}
- $_caching = 'null';
+ $_caching = 'null';
+ if ($this->compiler->nocache || $this->compiler->tag_nocache) {
+ $_caching = Smarty::CACHING_OFF;
+ }
// default for included templates
- if ($this->compiler->template->caching && !$this->compiler->nocache) {
- $_caching = 9999;
+ if ($compiler->template->caching && !$this->compiler->nocache && !$this->compiler->tag_nocache) {
+ $_caching = self::CACHING_NOCACHE_CODE;
}
/*
* if the {include} tag provides individual parameter for caching
if (isset($_attr['cache_lifetime'])) {
$_cache_lifetime = $_attr['cache_lifetime'];
$this->compiler->tag_nocache = true;
- $_caching = SMARTY_CACHING_LIFETIME_CURRENT;
+ $_caching = Smarty::CACHING_LIFETIME_CURRENT;
} else {
$_cache_lifetime = 'null';
}
- if (isset($_attr['nocache'])) {
- if ($_attr['nocache'] == 'true') {
- $this->compiler->tag_nocache = true;
- $_caching = SMARTY_CACHING_OFF;
- }
+ if (isset($_attr['cache_id'])) {
+ $_cache_id = $_attr['cache_id'];
+ $this->compiler->tag_nocache = true;
+ $_caching = Smarty::CACHING_LIFETIME_CURRENT;
+ } else {
+ $_cache_id = '$_smarty_tpl->cache_id';
}
- if (isset($_attr['caching'])) {
- if ($_attr['caching'] == 'true') {
- $_caching = SMARTY_CACHING_LIFETIME_CURRENT;
- } else {
- $this->compiler->tag_nocache = true;
- $_caching = SMARTY_CACHING_OFF;
- }
+ if (isset($_attr['compile_id'])) {
+ $_compile_id = $_attr['compile_id'];
+ } else {
+ $_compile_id = '$_smarty_tpl->compile_id';
+ }
+ if ($_attr['caching'] === true) {
+ $_caching = Smarty::CACHING_LIFETIME_CURRENT;
+ }
+ if ($_attr['nocache'] === true) {
+ $this->compiler->tag_nocache = true;
+ $_caching = Smarty::CACHING_OFF;
}
// create template object
- $_output = "<?php \$_template = new {$compiler->smarty->template_class}($include_file, \$_smarty_tpl->smarty, \$_smarty_tpl, \$_smarty_tpl->cache_id, \$_smarty_tpl->compile_id, $_caching, $_cache_lifetime);\n";
+ $_output = "<?php ";
+ if ($_caching != 'null' && $_caching != Smarty::CACHING_OFF) {
+ $_output .= "\$sha = sha1($include_file . $_cache_id . $_compile_id);\n";
+ $_output .= "if (isset(\$_smarty_tpl->smarty->template_objects[\$sha])) {\n";
+ $_output .= "\$_template = \$_smarty_tpl->smarty->template_objects[\$sha]; \$_template->caching = $_caching; \$_template->cache_lifetime = $_cache_lifetime;\n";
+ $_output .= "} else {\n";
+ }
+ $_output .= "\$_template = new {$compiler->smarty->template_class}($include_file, \$_smarty_tpl->smarty, \$_smarty_tpl, $_cache_id, $_compile_id, $_caching, $_cache_lifetime);\n";
+ if ($_caching != 'null' && $_caching != Smarty::CACHING_OFF) {
+ $_output .= "}\n";
+ }
// delete {include} standard attributes
- unset($_attr['file'], $_attr['assign'], $_attr['cache_lifetime'], $_attr['nocache'], $_attr['caching'], $_attr['scope'], $_attr['inline']);
+ unset($_attr['file'], $_attr['assign'], $_attr['cache_id'], $_attr['compile_id'], $_attr['cache_lifetime'], $_attr['nocache'], $_attr['caching'], $_attr['scope'], $_attr['inline']);
// remaining attributes must be assigned as smarty variable
if (!empty($_attr)) {
- if ($_parent_scope == SMARTY_LOCAL_SCOPE) {
+ if ($_parent_scope == Smarty::SCOPE_LOCAL) {
// 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');
+ $this->compiler->trigger_template_error('variable passing not allowed in parent/global scope', $this->compiler->lex->taglineno);
}
}
// was there an assign attribute
$_output .= "<?php /* End of included template \"" . $tpl->getTemplateFilepath() . "\" */ ?>\n";
$_output .= "<?php \$_smarty_tpl = array_pop(\$_tpl_stack);?>";
} else {
- $_output .= " echo \$_template->getRenderedTemplate();?>";
- $_output .= "<?php \$_template->updateParentVariables($_parent_scope);?>";
+ $_output .= " echo \$_template->getRenderedTemplate(); \$_template->rendered_content = null;?>";
+ if ($_parent_scope != Smarty::SCOPE_LOCAL) {
+ $_output .= "<?php \$_template->updateParentVariables($_parent_scope);?>";
+ }
}
}
- $_output .= "<?php unset(\$_template);?>\n";
+ $_output .= "<?php unset(\$_template);?>";
return $_output;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_include_php.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_include_php.php
index e71f978d94dfd410d345e26acae6581298db6ef9..19ee186bc9e572836afaf6d366a249c38ec21714 100644 (file)
<?php
/**
-* Smarty Internal Plugin Compile Include PHP
-*
-* Compiles the {include_php} tag
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Compile Include PHP
+ *
+ * Compiles the {include_php} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Insert Class
-*/
+ * Smarty Internal Plugin Compile Insert Class
+ */
class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase {
+ // attribute definitions
+ public $required_attributes = array('file');
+ public $shorttag_order = array('file');
+ public $optional_attributes = array('once', 'assign');
+
/**
- * Compiles code for the {include_php} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
+ * 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)
{
+ if (!$compiler->smarty->allow_php_tag) {
+ throw new SmartyException("{include_php} is deprecated, set allow_php_tag = true to enable");
+ }
$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;
+ $_filepath = false;
eval('$_file = ' . $_attr['file'] . ';');
-
- $_file = realpath($_file);
-
- if ($this->compiler->smarty->security) {
- $this->compiler->smarty->security_handler->isTrustedPHPDir($_file);
+ if (!isset($this->compiler->smarty->security_policy) && file_exists($_file)) {
+ $_filepath = $_file;
+ } else {
+ if (isset($this->compiler->smarty->security_policy)) {
+ $_dir = $this->compiler->smarty->security_policy->trusted_dir;
+ } else {
+ $_dir = $this->compiler->smarty->trusted_dir;
+ }
+ if (!empty($_dir)) {
+ foreach((array)$_dir as $_script_dir) {
+ if (strpos('/\\', substr($_script_dir, -1)) === false) {
+ $_script_dir .= DS;
+ }
+ if (file_exists($_script_dir . $_file)) {
+ $_filepath = $_script_dir . $_file;
+ break;
+ }
+ }
+ }
}
-
- if ($_file === false) {
- $this->compiler->trigger_template_error('include_php: file "' . $_attr['file'] . '" is not readable');
+ if ($_filepath == false) {
+ $this->compiler->trigger_template_error("{include_php} file '{$_file}' is not readable", $this->compiler->lex->taglineno);
}
- if ($this->compiler->smarty->security) {
- $this->compiler->smarty->security_handler->isTrustedPHPDir($_file);
+ if (isset($this->compiler->smarty->security_policy)) {
+ $this->compiler->smarty->security_policy->isTrustedPHPDir($_filepath);
}
+
if (isset($_attr['assign'])) {
// output will be stored in a smarty variable instead of being displayed
$_assign = $_attr['assign'];
}
if (isset($_assign)) {
- return "<?php ob_start(); include{$_once} ('{$_file}'); \$_smarty_tpl->assign({$_assign},ob_get_contents()); ob_end_clean();?>";
+ return "<?php ob_start(); include{$_once} ('{$_filepath}'); \$_smarty_tpl->assign({$_assign},ob_get_contents()); ob_end_clean();?>";
} else {
- return "<?php include{$_once} ('{$_file}');?>\n";
+ return "<?php include{$_once} ('{$_filepath}');?>\n";
}
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_insert.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_insert.php
index 189fe6d379588c2a1d97095bb9e5754ac9458d69..898e5315ae8678b5eed6fbd06d03a31adf299433 100644 (file)
<?php
/**
-* Smarty Internal Plugin Compile Insert
-*
-* Compiles the {insert} tag
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Compile Insert
+ *
+ * Compiles the {insert} tag
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Insert Class
-*/
+ * Smarty Internal Plugin Compile Insert Class
+ */
class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase {
+ // attribute definitions
+ public $required_attributes = array('name');
+ public $shorttag_order = array('name');
+ public $optional_attributes = array('_any');
+
/**
- * Compiles code for the {insert} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
+ * 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
+ // never compile as nocache code
+ $this->compiler->suppressNocacheProcessing = true;
$this->compiler->tag_nocache = true;
$_smarty_tpl = $compiler->template;
+ $_name = null;
+ $_script = null;
$_output = '<?php ';
// save posible attributes
eval('$_name = ' . $_attr['name'] . ';');
- $_function = "insert_{$_name}";
if (isset($_attr['assign'])) {
- // output will be stored in a smarty variable instead of beind displayed
+ // output will be stored in a smarty variable instead of being 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
+ $_function = "smarty_insert_{$_name}";
$_smarty_tpl = $compiler->template;
+ $_filepath = false;
eval('$_script = ' . $_attr['script'] . ';');
- if (!file_exists($_script)) {
- $this->compiler->trigger_template_error("{insert} missing script file '{$_script}'");
+ if (!isset($this->compiler->smarty->security_policy) && file_exists($_script)) {
+ $_filepath = $_script;
+ } else {
+ if (isset($this->compiler->smarty->security_policy)) {
+ $_dir = $this->compiler->smarty->security_policy->trusted_dir;
+ } else {
+ $_dir = $this->compiler->smarty->trusted_dir;
+ }
+ if (!empty($_dir)) {
+ foreach((array)$_dir as $_script_dir) {
+ if (strpos('/\\', substr($_script_dir, -1)) === false) {
+ $_script_dir .= DS;
+ }
+ if (file_exists($_script_dir . $_script)) {
+ $_filepath = $_script_dir . $_script;
+ break;
+ }
+ }
+ }
+ }
+ if ($_filepath == false) {
+ $this->compiler->trigger_template_error("{insert} missing script file '{$_script}'", $this->compiler->lex->taglineno);
}
// code for script file loading
- $_output .= "require_once {$_script} ;";
- require_once $_script;
+ $_output .= "require_once '{$_filepath}' ;";
+ require_once $_filepath;
if (!is_callable($_function)) {
- $this->compiler->trigger_template_error(" {insert} function '{$_name}' is not callable");
+ $this->compiler->trigger_template_error(" {insert} function '{$_function}' is not callable in script file '{$_script}'", $this->compiler->lex->taglineno);
}
} else {
+ $_filepath = 'null';
+ $_function = "insert_{$_name}";
+ // function in PHP script ?
if (!is_callable($_function)) {
+ // try plugin
if (!$_function = $this->compiler->getPlugin($_name, 'insert')) {
- $this->compiler->trigger_template_error("{insert} no function or plugin found for '{$_name}'");
+ $this->compiler->trigger_template_error("{insert} no function or plugin found for '{$_name}'", $this->compiler->lex->taglineno);
}
}
}
// delete {insert} standard attributes
- unset($_attr['name'], $_attr['assign'], $_attr['script']);
+ unset($_attr['name'], $_attr['assign'], $_attr['script'], $_attr['nocache']);
// convert attributes into parameter array string
$_paramsArray = array();
foreach ($_attr as $_key => $_value) {
$_params = 'array(' . implode(", ", $_paramsArray) . ')';
// call insert
if (isset($_assign)) {
- $_output .= "\$_smarty_tpl->assign({$_assign} , {$_function} ({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl), true);?>";
+ if ($_smarty_tpl->caching) {
+ $_output .= "echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \$_smarty_tpl, '{$_filepath}',{$_assign});?>";
+ } else {
+ $_output .= "\$_smarty_tpl->assign({$_assign} , {$_function} ({$_params},\$_smarty_tpl), true);?>";
+ }
} else {
$this->compiler->has_output = true;
- $_output .= "echo {$_function}({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl);?>";
+ if ($_smarty_tpl->caching) {
+ $_output .= "echo Smarty_Internal_Nocache_Insert::compile ('{$_function}',{$_params}, \$_smarty_tpl, '{$_filepath}');?>";
+ } else {
+ $_output .= "echo {$_function}({$_params},\$_smarty_tpl);?>";
+ }
}
return $_output;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_ldelim.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_ldelim.php
index c809990cae151a96ddf7514bf9021a26492b6956..bdf86de4c5a6875e8c6e14ae5fd7e30041288169 100644 (file)
<?php
/**
-* Smarty Internal Plugin Compile Ldelim
-*
-* Compiles the {ldelim} tag
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Compile Ldelim
+ *
+ * Compiles the {ldelim} tag
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Ldelim Class
-*/
+ * 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
- */
+ * 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);
+ if ($_attr['nocache'] === true) {
+ $this->compiler->trigger_template_error('nocache option not allowed', $this->compiler->lex->taglineno);
+ }
// this tag does not return compiled code
$this->compiler->has_code = true;
return $this->compiler->smarty->left_delimiter;
}
-}
+}
+
?>
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_nocache.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_nocache.php
index ebeef9dd0529fa54a42b77e968c272f15888986d..0c88b14bd57d7c9111cc7018773558ebe94351ce 100644 (file)
<?php
/**
-* Smarty Internal Plugin Compile Nocache
-*
-* Compiles the {nocache} {/nocache} tags
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Compile Nocache
+ *
+ * Compiles the {nocache} {/nocache} tags
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Nocache Class
-*/
+ * 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
- */
+ * 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);
+ if ($_attr['nocache'] === true) {
+ $this->compiler->trigger_template_error('nocache option not allowed', $this->compiler->lex->taglineno);
+ }
// enter nocache mode
$this->compiler->nocache = true;
// this tag does not return compiled code
}
/**
-* Smarty Internal Plugin Compile Nocacheclose Class
-*/
+ * 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
- */
+ * 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;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_block_plugin.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_block_plugin.php
index 030f3a2f02d2a74c86138b3c6852b61358f28dd5..f61ff49094467e897f2bfeb0e685edaa7f3ef5de 100644 (file)
<?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
+ *
+ * Compiles code for the execution of block plugin
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Block Plugin Class
-*/
+ * Smarty Internal Plugin Compile Block Plugin Class
+ */
class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_CompileBase {
+ // attribute definitions
+ public $optional_attributes = array('_any');
+
/**
- * 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, $function)
+ * 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)
{
$this->compiler = $compiler;
- if (strlen($tag) < 6 || substr_compare($tag, 'close', -5, 5) != 0) {
+ if (strlen($tag) < 6 || substr($tag, -5) != 'close') {
// opening tag of block plugin
- $this->required_attributes = array();
- $this->optional_attributes = array('_any');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
+ // check and get attributes
+ $_attr = $this->_get_attributes($args);
+ if ($_attr['nocache'] === true) {
+ $this->compiler->tag_nocache = true;
+ }
+ unset($_attr['nocache']);
// convert attributes into parameter array string
$_paramsArray = array();
foreach ($_attr as $_key => $_value) {
// maybe nocache because of nocache variables or nocache plugin
$this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
// compile code
- if (is_array($function)) {
- $output = '<?php $_block_repeat=true; call_user_func_array(array(\'' . $function[0] . '\',\'' . $function[1] . '\'),(array(' . $_params . ', null, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl));while ($_block_repeat) { ob_start();?>';
- } else {
- $output = '<?php $_block_repeat=true; ' . $function . '(' . $_params . ', null, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl);while ($_block_repeat) { ob_start();?>';
- }
+ $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
} else {
// must endblock be nocache?
if ($this->compiler->nocache) {
@@ -59,15 +63,16 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi
// This tag does create output
$this->compiler->has_output = true;
// compile code
- if (is_array($function)) {
- var_dump('error');
- $output = '<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo call_user_func_array(array(\'' . $function[0] . '\',\'' . $function[1] . '\'),(array(' . $_params . ', $_block_content, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl)); }?>';
+ if (!isset($parameter['modifier_list'])) {
+ $mod_pre = $mod_post ='';
} else {
- $output = '<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo ' . $function . '(' . $_params . ', $_block_content, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl); }?>';
- }
+ $mod_pre = ' ob_start(); ';
+ $mod_post = 'echo '.$this->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;
+ return $output . "\n";
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_function_plugin.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_function_plugin.php
index 129b5d75228225ff4184e8a92bc7b45bfa3e37d3..965d696ef887abe43c068618a3d99607a02cee43 100644 (file)
<?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
+ *
+ * Compiles code for the execution of function plugin
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Function Plugin Class
-*/
+ * Smarty Internal Plugin Compile Function Plugin Class
+ */
class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_CompileBase {
+ // attribute definitions
+ public $required_attributes = array();
+ public $optional_attributes = array('_any');
+
/**
- * 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, $function)
+ * 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->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);
+ if ($_attr['nocache'] === true) {
+ $this->compiler->tag_nocache = true;
+ }
+ unset($_attr['nocache']);
// convert attributes into parameter array string
$_paramsArray = array();
foreach ($_attr as $_key => $_value) {
}
$_params = 'array(' . implode(",", $_paramsArray) . ')';
// compile code
- if (is_array($function)) {
- $output = '<?php echo call_user_func_array(array(\'' . $function[0] . '\',\'' . $function[1] . '\'),(array(' . $_params . ',$_smarty_tpl->smarty,$_smarty_tpl));?>';
- } else {
- $output = '<?php echo ' . $function . '(' . $_params . ',$_smarty_tpl->smarty,$_smarty_tpl);?>';
- }
+ $output = "<?php echo {$function}({$_params},\$_smarty_tpl);?>\n";
return $output;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_modifier.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_modifier.php
index 0b54712db7e8d1de63881421c2b943046fb93ba2..1648db2ed7649c086016555bcb2a47e390407887 100644 (file)
-<?php
-/**
-* Smarty Internal Plugin Compile Modifier
-*
-* Compiles code for modifier execution
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
-/**
-* Smarty Internal Plugin Compile Modifier Class
-*/
-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
- * @return string compiled code
- */
- public function compile($args, $compiler)
- {
- $this->compiler = $compiler;
- $this->smarty = $this->compiler->smarty;
- $this->required_attributes = array('modifier', 'params');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
- // check for registered modifier
- if (isset($compiler->smarty->registered_plugins['modifier'][$_attr['modifier']])) {
- $function = $compiler->smarty->registered_plugins['modifier'][$_attr['modifier']][0];
- if (!is_array($function)) {
- $output = "{$function}({$_attr['params']})";
- } else if (is_object($function[0])) {
- $output = 'call_user_func_array($_smarty_tpl->smarty->registered_plugins[\'modifier\'][\'' . $_attr['modifier'] . '\'][0],array(' . $_attr['params'] . '))';
- } else {
- $output = 'call_user_func_array(array(\'' . $function[0] . '\',\'' . $function[1] . '\'),array(' . $_attr['params'] . '))';
- }
- // check for plugin modifier
- } else if ($function = $this->compiler->getPlugin($_attr['modifier'], 'modifier')) {
- if (!is_array($function)) {
- $output = "{$function}({$_attr['params']})";
- } else {
- $output = 'call_user_func_array(array(\'' . $function[0] . '\',\'' . $function[1] . '\'),array(' . $_attr['params'] . '))';
- }
- // check if trusted PHP function
- } else if (is_callable($_attr['modifier'])) {
- // check if modifier allowed
- if (!$this->compiler->template->security || $this->smarty->security_handler->isTrustedModifier($_attr['modifier'], $this->compiler)) {
- $output = "{$_attr['modifier']}({$_attr['params']})";
- }
- } else {
- $this->compiler->trigger_template_error ("unknown modifier \"" . $_attr['modifier'] . "\"");
- }
- return $output;
- }
-}
-
-?>
+<?php\r
+/**\r
+ * Smarty Internal Plugin Compile Modifier\r
+ * \r
+ * Compiles code for modifier execution\r
+ * \r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Uwe Tews \r
+ */\r
+\r
+/**\r
+ * Smarty Internal Plugin Compile Modifier Class\r
+ */\r
+class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBase {\r
+ /**\r
+ * Compiles code for modifier execution\r
+ * \r
+ * @param array $args array with attributes from parser\r
+ * @param object $compiler compiler object\r
+ * @param array $parameter array with compilation parameter\r
+ * @return string compiled code\r
+ */\r
+ public function compile($args, $compiler, $parameter)\r
+ {\r
+ $this->compiler = $compiler;\r
+ $this->smarty = $this->compiler->smarty;\r
+ // check and get attributes\r
+ $_attr = $this->_get_attributes($args);\r
+ $output = $parameter['value']; \r
+ // loop over list of modifiers\r
+ foreach ($parameter['modifierlist'] as $single_modifier) {\r
+ $modifier = $single_modifier[0];\r
+ $single_modifier[0] = $output;\r
+ $params = implode(',', $single_modifier); \r
+ // check for registered modifier\r
+ if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][$modifier])) {\r
+ $function = $compiler->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][$modifier][0];\r
+ if (!is_array($function)) {\r
+ $output = "{$function}({$params})";\r
+ } else {\r
+ if (is_object($function[0])) {\r
+ $output = '$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER][\'' . $modifier . '\'][0][0]->' . $function[1] . '(' . $params . ')';\r
+ } else {\r
+ $output = $function[0] . '::' . $function[1] . '(' . $params . ')';\r
+ } \r
+ } \r
+ // check for plugin modifiercompiler\r
+ } else if ($compiler->smarty->loadPlugin('smarty_modifiercompiler_' . $modifier)) {\r
+ $plugin = 'smarty_modifiercompiler_' . $modifier;\r
+ $output = $plugin($single_modifier, $compiler); \r
+ // check for plugin modifier\r
+ } else if ($function = $this->compiler->getPlugin($modifier, Smarty::PLUGIN_MODIFIER)) {\r
+ $output = "{$function}({$params})"; \r
+ // check if trusted PHP function\r
+ } else if (is_callable($modifier)) {\r
+ // check if modifier allowed\r
+ if (!is_object($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedModifier($modifier, $this->compiler)) {\r
+ $output = "{$modifier}({$params})";\r
+ } \r
+ } else {\r
+ $this->compiler->trigger_template_error ("unknown modifier \"" . $modifier . "\"", $this->compiler->lex->taglineno);\r
+ } \r
+ } \r
+ return $output;\r
+ } \r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_object_block_function.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_object_block_function.php
index 03c2d34015cf09f75dfae6327d317b3ddf090d14..97737e8d24a39c3aee8935a88b63e8d3bff84d97 100644 (file)
<?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
+ *
+ * Compiles code for registered objects as block function
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Object Block Function Class
-*/
+ * Smarty Internal Plugin Compile Object Block Function Class
+ */
class Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Internal_CompileBase {
+ // attribute definitions
+ public $required_attributes = array();
+ public $optional_attributes = array('_any');
+
/**
- * 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)
+ * 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 $methode name of methode to call
+ * @return string compiled code
+ */
+ public function compile($args, $compiler, $parameter, $tag, $methode)
{
$this->compiler = $compiler;
- if (strlen($tag) < 5 || substr_compare($tag, 'close', -5, 5) != 0) {
+ if (strlen($tag) < 5 || substr($tag, -5) != 'close') {
// opening tag of block plugin
- $this->required_attributes = array();
- $this->optional_attributes = array('_any');
- // check and get attributes
- $_attr = $this->_get_attributes($args);
+ // check and get attributes
+ $_attr = $this->_get_attributes($args);
+ if ($_attr['nocache'] === true) {
+ $this->compiler->tag_nocache = true;
+ }
+ unset($_attr['nocache']);
// convert attributes into parameter array string
$_paramsArray = array();
foreach ($_attr as $_key => $_value) {
@@ -41,19 +49,32 @@ class Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Inter
}
$_params = 'array(' . implode(",", $_paramsArray) . ')';
- $this->_open_tag($tag . '->' . $methode, $_params);
+ $this->_open_tag($tag . '->' . $methode, array($_params, $this->compiler->nocache));
+ // maybe nocache because of nocache variables or nocache plugin
+ $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
// 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();?>';
+ $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}->{$methode}', {$_params}); \$_block_repeat=true; \$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$methode}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";
} else {
- // closing tag of block plugin
- $_params = $this->_close_tag(substr($tag, 0, -5) . '->' . $methode);
+ $base_tag = substr($tag, 0, -5);
+ // 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($base_tag . '->' . $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); }?>';
+ if (!isset($parameter['modifier_list'])) {
+ $mod_pre = $mod_post ='';
+ } else {
+ $mod_pre = ' ob_start(); ';
+ $mod_post = 'echo '.$this->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]->{$methode}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); ".$mod_post." } array_pop(\$_smarty_tpl->smarty->_tag_stack);?>";
}
- return $output;
+ return $output."\n";
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_object_function.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_object_function.php
index 573f6040e4e46e4369ee6cf6b042d9bc63cd470b..f0755f062ec38eb9a4e35180bfd6389c235aa799 100644 (file)
<?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 Funtion
+ *
+ * Compiles code for registered objects as function
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Object Function Class
-*/
+ * Smarty Internal Plugin Compile Object Function Class
+ */
class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_CompileBase {
+ // attribute definitions
+ public $required_attributes = array();
+ public $optional_attributes = array('_any');
+
/**
- * 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)
+ * 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 $methode name of methode to call
+ * @return string compiled code
+ */
+ public function compile($args, $compiler, $parameter, $tag, $methode)
{
- $this->compiler = $compiler;
- // This tag does create output
- $this->compiler->has_output = true;
-
- $this->required_attributes = array();
- $this->optional_attributes = array('_any');
+ $this->compiler = $compiler;
// check and get attributes
$_attr = $this->_get_attributes($args);
+ if ($_attr['nocache'] === true) {
+ $this->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 ($this->compiler->smarty->registered_objects[$tag][2]) {
$_paramsArray = array();
@@ -42,13 +52,20 @@ class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_Co
}
}
$_params = 'array(' . implode(",", $_paramsArray) . ')';
- $output = "<?php echo \$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$methode}({$_params},\$_smarty_tpl->smarty,\$_smarty_tpl);?>";
+ $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$methode}({$_params},\$_smarty_tpl)";
} else {
$_params = implode(",", $_attr);
- $output = "<?php echo \$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$methode}({$_params});?>";
+ $return = "\$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$methode}({$_params})";
}
+ if (empty($_assign)) {
+ // This tag does create output
+ $this->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/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_print_expression.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_print_expression.php
index 7cfe473d8a860c9aacc17ad11d5dae876f68cc00..5a9c9319199c391e903d21ba515850f2c9f6c95f 100644 (file)
<?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
+ *
+ * Compiles any tag which will output an expression or variable
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Print Expression Class
-*/
+ * Smarty Internal Plugin Compile Print Expression Class
+ */
class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_CompileBase {
+ // attribute definitions
+ public $optional_attributes = array('assign');
+ 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
- * @return string compiled code
- */
- public function compile($args, $compiler)
+ * 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)
{
$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;
- }
+ $_attr = $this->_get_attributes($args);
+ // nocache option
+ 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';
- }
+ // filter handling
+ if ($_attr['nofilter'] === true) {
+ $_filter = 'false';
+ } else {
+ $_filter = 'true';
}
-
+ // compiled output
+ // compiled output
if (isset($_attr['assign'])) {
// assign output to variable
- $output = '<?php $_smarty_tpl->assign(' . $_attr['assign'] . ',' . $_attr['value'] . ');?>';
+ $output = "<?php \$_smarty_tpl->assign({$_attr['assign']},{$parameter['value']});?>";
} else {
// display value
- $this->compiler->has_output = true;
- if (isset($this->compiler->smarty->registered_filters['variable'])) {
- $output = '<?php echo Smarty_Internal_Filter_Handler::runFilter(\'variable\', ' . $_attr['value'] . ',$this->smarty, ' . $_attr['filter'] . ');?>';
+ if (!$_attr['nofilter'] && isset($this->compiler->smarty->registered_filters['variable'])) {
+ $output = "Smarty_Internal_Filter_Handler::runFilter('variable', {$parameter['value']}, \$_smarty_tpl, {$_filter})";
} else {
- $output = '<?php echo ' . $_attr['value'] . ';?>';
+ $output = $parameter['value'];
}
+ if (!$_attr['nofilter'] && !empty($this->compiler->smarty->default_modifiers)) {
+ $modifierlist = array();
+ foreach ($this->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];
+ }
+ }
+ }
+ $output = $this->compiler->compileTag('private_modifier', array(), array('modifierlist' => $modifierlist, 'value' => $output));
+ }
+ if (!empty($parameter['modifierlist'])) {
+ $output = $this->compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifierlist'], 'value' => $output));
+ }
+ $this->compiler->has_output = true;
+ $output = "<?php echo {$output};?>";
}
return $output;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_registered_block.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_registered_block.php
index 1e836da07a34cfaf96df87c382fbeabea2bbc843..054036241175a0696a068d96e9a1733813cff9bc 100644 (file)
-<?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
-*/
-class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the execution of a block function
- *
- * @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));
- // maybe nocache because of nocache variables or nocache plugin
- $this->compiler->nocache = !$compiler->smarty->registered_plugins['block'][$tag][1] | $this->compiler->nocache | $this->compiler->tag_nocache;
- $function = $compiler->smarty->registered_plugins['block'][$tag][0];
- // compile code
- if (!is_array($function)) {
- $output = '<?php $_block_repeat=true; ' . $function . '(' . $_params . ', null, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl);while ($_block_repeat) { ob_start();?>';
- } else if (is_object($function[0])) {
- $output = '<?php $_block_repeat=true; call_user_func_array($_smarty_tpl->smarty->registered_plugins[\'block\'][\'' . $tag . '\'][0],array(' . $_params . ', null, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl));while ($_block_repeat) { ob_start();?>';
- } else {
- $output = '<?php $_block_repeat=true; call_user_func_array(array(\'' . $function[0] . '\',\'' . $function[1] . '\'),array(' . $_params . ', null, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl));while ($_block_repeat) { ob_start();?>';
- }
- } else {
- // must endblock be nocache?
- if ($this->compiler->nocache) {
- $this->compiler->tag_nocache = true;
- }
- $base_tag = substr($tag, 0, -5);
- // closing tag of block plugin, restore nocache
- list($_params, $this->compiler->nocache) = $this->_close_tag($base_tag);
- // This tag does create output
- $this->compiler->has_output = true;
- $function = $compiler->smarty->registered_plugins['block'][$base_tag][0];
- // compile code
- if (!is_array($function)) {
- $output = '<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo ' . $function . '(' . $_params . ', $_block_content, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl); }?>';
- } else if (is_object($function[0])) {
- $output = '<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo call_user_func_array($_smarty_tpl->smarty->registered_plugins[\'block\'][\'' . $base_tag . '\'][0],array(' . $_params . ', $_block_content, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl)); }?>';
- } else {
- $output = '<?php $_block_content = ob_get_clean(); $_block_repeat=false; echo call_user_func_array(array(\'' . $function[0] . '\',\'' . $function[1] . '\'),array(' . $_params . ', $_block_content, $_smarty_tpl->smarty, $_block_repeat, $_smarty_tpl)); }?>';
- }
- }
- return $output;
- }
-}
-
-?>
+<?php\r
+/**\r
+ * Smarty Internal Plugin Compile Registered Block\r
+ * \r
+ * Compiles code for the execution of a registered block function\r
+ * \r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Uwe Tews \r
+ */\r
+\r
+/**\r
+ * Smarty Internal Plugin Compile Registered Block Class\r
+ */\r
+class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_CompileBase {\r
+ // attribute definitions\r
+ public $optional_attributes = array('_any'); \r
+\r
+ /**\r
+ * Compiles code for the execution of a block function\r
+ * \r
+ * @param array $args array with attributes from parser\r
+ * @param object $compiler compiler object\r
+ * @param array $parameter array with compilation parameter\r
+ * @param string $tag name of block function\r
+ * @return string compiled code\r
+ */\r
+ public function compile($args, $compiler, $parameter, $tag)\r
+ {\r
+ $this->compiler = $compiler;\r
+ if (strlen($tag) < 6 || substr($tag,-5) != 'close') {\r
+ // opening tag of block plugin\r
+ // check and get attributes\r
+ $_attr = $this->_get_attributes($args); \r
+ if ($_attr['nocache']) {\r
+ $this->compiler->tag_nocache = true;\r
+ }\r
+ unset($_attr['nocache']);\r
+ // convert attributes into parameter array string\r
+ $_paramsArray = array();\r
+ foreach ($_attr as $_key => $_value) {\r
+ if (is_int($_key)) {\r
+ $_paramsArray[] = "$_key=>$_value";\r
+ } elseif ($this->compiler->template->caching && in_array($_key,$compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$tag][2])) {\r
+ $_value = str_replace("'","^#^",$_value);\r
+ $_paramsArray[] = "'$_key'=>^#^.var_export($_value,true).^#^";\r
+ } else {\r
+ $_paramsArray[] = "'$_key'=>$_value";\r
+ } \r
+ } \r
+ $_params = 'array(' . implode(",", $_paramsArray) . ')';\r
+\r
+ $this->_open_tag($tag, array($_params, $this->compiler->nocache)); \r
+ // maybe nocache because of nocache variables or nocache plugin\r
+ $this->compiler->nocache = !$compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$tag][1] | $this->compiler->nocache | $this->compiler->tag_nocache;\r
+ $function = $compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$tag][0]; \r
+ // compile code\r
+ if (!is_array($function)) {\r
+ $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";\r
+ } else if (is_object($function[0])) {\r
+ $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; \$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0][0]->{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";\r
+ } else {\r
+ $output = "<?php \$_smarty_tpl->smarty->_tag_stack[] = array('{$tag}', {$_params}); \$_block_repeat=true; {$function[0]}::{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>";\r
+ } \r
+ } else {\r
+ // must endblock be nocache?\r
+ if ($this->compiler->nocache) {\r
+ $this->compiler->tag_nocache = true;\r
+ } \r
+ $base_tag = substr($tag, 0, -5); \r
+ // closing tag of block plugin, restore nocache\r
+ list($_params, $this->compiler->nocache) = $this->_close_tag($base_tag); \r
+ // This tag does create output\r
+ $this->compiler->has_output = true;\r
+ $function = $compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$base_tag][0]; \r
+ // compile code\r
+ if (!isset($parameter['modifier_list'])) {\r
+ $mod_pre = $mod_post ='';\r
+ } else {\r
+ $mod_pre = ' ob_start(); ';\r
+ $mod_post = 'echo '.$this->compiler->compileTag('private_modifier',array(),array('modifierlist'=>$parameter['modifier_list'],'value'=>'ob_get_clean()')).';';\r
+ }\r
+ if (!is_array($function)) {\r
+ $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);?>";\r
+ } else if (is_object($function[0])) {\r
+ $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);?>";\r
+ } else {\r
+ $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);?>";\r
+ } \r
+ } \r
+ return $output."\n";\r
+ } \r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_registered_function.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_registered_function.php
index 7e90324d1d2fd790f228d1aebc8bd00c605e5ba5..f79edf6849c836c96cc9e4023afdf501d26a435c 100644 (file)
-<?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
-*/
-class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Internal_CompileBase {
- /**
- * Compiles code for the execution of a registered function
- *
- * @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?
- $this->compiler->tag_nocache = !$compiler->smarty->registered_plugins['function'][$tag][1];
- // 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 call_user_func_array($_smarty_tpl->smarty->registered_plugins[\'function\'][\'' . $tag . '\'][0],array(' . $_params . ',$_smarty_tpl->smarty,$_smarty_tpl));?>';
- return $output;
- }
-}
-
-?>
+<?php\r
+/**\r
+ * Smarty Internal Plugin Compile Registered Function\r
+ * \r
+ * Compiles code for the execution of a registered function\r
+ * \r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Uwe Tews \r
+ */\r
+ \r
+/**\r
+ * Smarty Internal Plugin Compile Registered Function Class\r
+ */\r
+class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Internal_CompileBase {\r
+ // attribute definitions\r
+ public $optional_attributes = array('_any'); \r
+\r
+ /**\r
+ * Compiles code for the execution of a registered function\r
+ * \r
+ * @param array $args array with attributes from parser\r
+ * @param object $compiler compiler object\r
+ * @param array $parameter array with compilation parameter\r
+ * @param string $tag name of function\r
+ * @return string compiled code\r
+ */\r
+ public function compile($args, $compiler, $parameter, $tag)\r
+ {\r
+ $this->compiler = $compiler; \r
+ // This tag does create output\r
+ $this->compiler->has_output = true;\r
+ // check and get attributes\r
+ $_attr = $this->_get_attributes($args); \r
+ if ($_attr['nocache']) {\r
+ $this->compiler->tag_nocache = true;\r
+ }\r
+ unset($_attr['nocache']);\r
+ // not cachable?\r
+ $this->compiler->tag_nocache = $this->compiler->tag_nocache || !$compiler->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION][$tag][1]; \r
+ // convert attributes into parameter array string\r
+ $_paramsArray = array();\r
+ foreach ($_attr as $_key => $_value) {\r
+ if (is_int($_key)) {\r
+ $_paramsArray[] = "$_key=>$_value";\r
+ } elseif ($this->compiler->template->caching && in_array($_key,$compiler->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION][$tag][2])) {\r
+ $_value = str_replace("'","^#^",$_value);\r
+ $_paramsArray[] = "'$_key'=>^#^.var_export($_value,true).^#^";\r
+ } else {\r
+ $_paramsArray[] = "'$_key'=>$_value";\r
+ } \r
+ } \r
+ $_params = 'array(' . implode(",", $_paramsArray) . ')'; \r
+ $function = $compiler->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION][$tag][0]; \r
+ // compile code\r
+ if (!is_array($function)) {\r
+ $output = "<?php echo {$function}({$_params},\$_smarty_tpl);?>\n";\r
+ } else if (is_object($function[0])) {\r
+ $output = "<?php echo \$_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['{$tag}'][0][0]->{$function[1]}({$_params},\$_smarty_tpl);?>\n";\r
+ } else {\r
+ $output = "<?php echo {$function[0]}::{$function[1]}({$_params},\$_smarty_tpl);?>\n";\r
+ } \r
+ return $output;\r
+ } \r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_special_variable.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_private_special_variable.php
index 1f473bc5e5e368193f924c9823e73ab462fa6f34..5d6ae8015ec371580a087699b182a6c027037925 100644 (file)
<?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
+ *
+ * Compiles the special $smarty variables
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile special Smarty Variable Class
-*/
+ * Smarty Internal Plugin Compile special Smarty Variable Class
+ */
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)
+ * 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 = explode(',', str_replace(array(']['), array(','), substr($args, 1, strlen($args)-2)));
+ $_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$args";
+ return "\$_smarty_tpl->getVariable('smarty')->value$parameter";
case 'section':
- return "\$_smarty_tpl->getVariable('smarty')->value$args";
+ return "\$_smarty_tpl->getVariable('smarty')->value$parameter";
case 'capture':
- return "\$_smarty_tpl->smarty->_smarty_vars$args";
+ return "Smarty::\$_smarty_vars$parameter";
case 'now':
return 'time()';
case 'cookies':
- if ($compiler->smarty->security && !$compiler->smarty->security_policy->allow_super_globals) {
+ if (isset($compiler->smarty->security_policy) && !$compiler->smarty->security_policy->allow_super_globals) {
$compiler->trigger_template_error("(secure mode) super globals not permitted");
break;
}
case 'server':
case 'session':
case 'request':
- if ($compiler->smarty->security && !$compiler->smarty->security_policy->allow_super_globals) {
+ if (isset($compiler->smarty->security_policy) && !$compiler->smarty->security_policy->allow_super_globals) {
$compiler->trigger_template_error("(secure mode) super globals not permitted");
break;
}
@@ -55,19 +56,17 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C
break;
case 'template':
- $_template_name = basename($compiler->template->getTemplateFilepath());
- return "'$_template_name'";
+ return 'basename($_smarty_tpl->getTemplateFilepath())';
case 'current_dir':
- $_template_dir_name = dirname($compiler->template->getTemplateFilepath());
- return "'$_template_dir_name'";
+ return 'dirname($_smarty_tpl->getTemplateFilepath())';
case 'version':
$_version = Smarty::SMARTY_VERSION;
return "'$_version'";
case 'const':
- if ($compiler->smarty->security && !$compiler->smarty->security_policy->allow_constants) {
+ if (isset($compiler->smarty->security_policy) && !$compiler->smarty->security_policy->allow_constants) {
$compiler->trigger_template_error("(secure mode) constants not permitted");
break;
}
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_rdelim.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_rdelim.php
index 88c4e1e5ede4bd796dd1c75bdf0073610b2647ad..6436bfd1659009ada85ba7e189aeb9fc067a2350 100644 (file)
<?php
/**
-* Smarty Internal Plugin Compile Rdelim
-*
-* Compiles the {rdelim} tag
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Compile Rdelim
+ *
+ * Compiles the {rdelim} tag
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Rdelim Class
-*/
+ * 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
- */
+ * 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);
+ if ($_attr['nocache'] === true) {
+ $this->compiler->trigger_template_error('nocache option not allowed', $this->compiler->lex->taglineno);
+ }
// this tag does not return compiled code
$this->compiler->has_code = true;
return $this->compiler->smarty->right_delimiter;
}
-}
-?>
+}
+
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_section.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_section.php
index 0de506a7498097e179c3ffbfa5a82650d3dc7250..0768b026e107a1227aa1d68cd34e1c10b1e089ca 100644 (file)
<?php
/**
-* Smarty Internal Plugin Compile Section
-*
-* Compiles the {section} {sectionelse} {/section} tags
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Compile Section
+ *
+ * Compiles the {section} {sectionelse} {/section} tags
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Compile Section Class
-*/
+ * Smarty Internal Plugin Compile Section Class
+ */
class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase {
+ // attribute definitions
+ public $required_attributes = array('name', 'loop');
+ public $shorttag_order = array('name', 'loop');
+ public $optional_attributes = array('start', 'step', 'max', 'show');
+
/**
- * Compiles code for the {section} tag
- *
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @return string compiled code
- */
+ * 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;
+ // maybe nocache because of nocache variables
+ $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
$output = "<?php ";
*/
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
- */
+ * 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;
@@ -136,24 +140,24 @@ class Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase {
}
/**
-* Smarty Internal Plugin Compile Sectionclose Class
-*/
+ * 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
- */
+ * 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) {
+ // must endblock be nocache?
+ if ($this->compiler->nocache) {
$this->compiler->tag_nocache = true;
}
@@ -166,5 +170,4 @@ class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase {
}
}
-
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compile_while.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compile_while.php
index 6dc18046f4305f5893ce4825bb43d020e85a7750..7e87a2291e91e4be766ea8a8170d7d04d939f223 100644 (file)
* @subpackage Compiler
* @author Uwe Tews
*/
+
/**
* Smarty Internal Plugin Compile While Class
*/
*
* @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)
+ public function compile($args, $compiler, $parameter)
{
$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 ?>";
+ $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
+ if (is_array($parameter['if condition'])) {
+ if ($this->compiler->nocache) {
+ $_nocache = ',true';
+ // create nocache var to make it know for further compiling
+ if (is_array($parameter['if condition']['var'])) {
+ $this->compiler->template->tpl_vars[trim($parameter['if condition']['var']['var'], "'")] = new Smarty_variable(null, true);
+ } else {
+ $this->compiler->template->tpl_vars[trim($parameter['if condition']['var'], "'")] = new Smarty_variable(null, true);
+ }
+ } else {
+ $_nocache = '';
+ }
+ if (is_array($parameter['if condition']['var'])) {
+ $_output = "<?php if (!isset(\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]) || !is_array(\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]->value)) \$_smarty_tpl->createLocalArrayVariable(".$parameter['if condition']['var']['var']."$_nocache);\n";
+ $_output .= "while (\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']['var']."]->value".$parameter['if condition']['var']['smarty_internal_index']." = ".$parameter['if condition']['value']."){?>";
+ } else {
+ $_output = "<?php \$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']."] = new Smarty_Variable(\$_smarty_tpl->getVariable(".$parameter['if condition']['var'].",null,true,false)->value{$_nocache});";
+ $_output .= "while (\$_smarty_tpl->tpl_vars[".$parameter['if condition']['var']."]->value = ".$parameter['if condition']['value']."){?>";
+ }
return $_output;
} else {
- return '<?php while (' . $args['if condition'] . ') { ?>';
+ return "<?php while ({$parameter['if condition']}){?>";
}
}
}
public function compile($args, $compiler)
{
$this->compiler = $compiler;
- // must endblock be nocache?
- if ($this->compiler->nocache) {
+ // must endblock be nocache?
+ if ($this->compiler->nocache) {
$this->compiler->tag_nocache = true;
}
$this->compiler->nocache = $this->_close_tag(array('while'));
return "<?php }?>";
}
}
-?>
+
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_compilebase.php b/gosa-core/include/smarty/sysplugins/smarty_internal_compilebase.php
index 7a398f53ecf2a233327e475433d7dcf01f97ba32..6418acceb13412f0f2b897f94e3155fe51cb7cb9 100644 (file)
<?php
/**
-* Smarty Internal Plugin CompileBase
-*
-* @package Smarty
-* @subpackage Compiler
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin CompileBase
+ *
+ * @package Smarty
+ * @subpackage Compiler
+ * @author Uwe Tews
+ */
/**
-* 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 class does extend all internal compile plugins
+ */
+// abstract class Smarty_Internal_CompileBase implements TagCompilerInterface
+class Smarty_Internal_CompileBase {
+ public $required_attributes = array();
+ public $optional_attributes = array();
+ public $shorttag_order = array();
+ public $option_flags = array('nocache');
+
/**
- * 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)
- {
+ * 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
+ *
+ * @param array $attributes attributes applied to the tag
+ * @return array of mapped attributes for further processing
+ */
+ function _get_attributes ($attributes)
+ {
+ $_indexed_attr = array();
+ // loop over attributes
+ foreach ($attributes as $key => $mixed) {
+ // shorthand ?
+ if (!is_array($mixed)) {
+ // option flag ?
+ if (in_array(trim($mixed, '\'"'), $this->option_flags)) {
+ $_indexed_attr[trim($mixed, '\'"')] = true;
+ // shorthand attribute ?
+ } else if (isset($this->shorttag_order[$key])) {
+ $_indexed_attr[$this->shorttag_order[$key]] = $mixed;
+ } else {
+ // too many shorthands
+ $this->compiler->trigger_template_error('too many shorthand attributes', $this->compiler->lex->taglineno);
+ }
+ // named attribute
+ } else {
+ $kv = each($mixed);
+ // option flag?
+ if (in_array($kv['key'], $this->option_flags)) {
+ if (is_bool($kv['value'])) {
+ $_indexed_attr[$kv['key']] = $kv['value'];
+ } else if (is_string($kv['value']) && in_array(trim($kv['value'], '\'"'), array('true', 'false'))) {
+ if (trim($kv['value']) == 'true') {
+ $_indexed_attr[$kv['key']] = true;
+ } else {
+ $_indexed_attr[$kv['key']] = false;
+ }
+ } else if (is_numeric($kv['value']) && in_array($kv['value'], array(0, 1))) {
+ if ($kv['value'] == 1) {
+ $_indexed_attr[$kv['key']] = true;
+ } else {
+ $_indexed_attr[$kv['key']] = false;
+ }
+ } else {
+ $this->compiler->trigger_template_error("illegal value of option flag \"{$kv['key']}\"", $this->compiler->lex->taglineno);
+ }
+ // must be named attribute
+ } else {
+ reset($mixed);
+ $_indexed_attr[key($mixed)] = $mixed[key($mixed)];
+ }
+ }
+ }
// 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");
+ if (!array_key_exists($attr, $_indexed_attr)) {
+ $this->compiler->trigger_template_error("missing \"" . $attr . "\" attribute", $this->compiler->lex->taglineno);
}
}
// 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");
+ $tmp_array = array_merge($this->required_attributes, $this->optional_attributes, $this->option_flags);
+ foreach ($_indexed_attr as $key => $dummy) {
+ if (!in_array($key, $tmp_array) && $key !== 0) {
+ $this->compiler->trigger_template_error("unexpected \"" . $key . "\" attribute", $this->compiler->lex->taglineno);
}
}
}
+ // default 'false' for all option flags not set
+ foreach ($this->option_flags as $flag) {
+ if (!isset($_indexed_attr[$flag])) {
+ $_indexed_attr[$flag] = false;
+ }
+ }
- return $args;
+ return $_indexed_attr;
}
/**
- * 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
- */
+ * 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
- */
+ * 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) {
return;
}
// wrong nesting of tags
- $this->compiler->trigger_template_error("unexpected closing tag");
+ $this->compiler->trigger_template_error("unexpected closing tag", $this->compiler->lex->taglineno);
return;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_config.php b/gosa-core/include/smarty/sysplugins/smarty_internal_config.php
index 31b410857cd09b79ff59a06da8945755a24e0ec9..5355512338c3f4a259927125f22bbf0a4585291b 100644 (file)
<?php
/**
-* Smarty Internal Plugin Config
-*
-* Main class for config variables
-*
-* @ignore
-* @package Smarty
-* @subpackage Config
-* @author Uwe Tews
-*/
+ * 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)
+ public function __construct($config_resource, $smarty, $data = null)
{
- $this->template = $template;
+ $this->data = $data;
$this->smarty = $smarty;
$this->config_resource = $config_resource;
$this->config_resource_type = null;
$this->compiler_object = null;
// parse config resource name
if (!$this->parseConfigResourceName ($config_resource)) {
- throw new Exception ("Unable to parse config resource '{$config_resource}'");
+ throw new SmartyException ("Unable to parse config resource '{$config_resource}'");
}
}
}
// check for absolute path
if (file_exists($this->config_resource_name))
- return $this->config_resource_name;
+ return $this->config_resource_name;
// no tpl file found
- throw new Exception("Unable to load config file \"{$this->config_resource_name}\"");
+ throw new SmartyException("Unable to load config file \"{$this->config_resource_name}\"");
return false;
}
/**
- * Read config file source
- *
- * @return string content of source file
- */
+ * 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
- */
+ * 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}\"");
+ throw new SmartyException("Unable to load config file \"{$this->config_resource_name}\"");
}
}
return $this->config_source;
}
/**
- * Returns the compiled filepath
- *
- * @return string the compiled filepath
- */
+ * Returns the compiled filepath
+ *
+ * @return string the compiled filepath
+ */
public function getCompiledFilepath ()
{
return $this->compiled_filepath === null ?
}
public function buildCompiledFilepath()
{
+ $_compile_id = isset($this->smarty->compile_id) ? preg_replace('![^\w\|]+!', '_', $this->smarty->compile_id) : null;
$_flag = (int)$this->smarty->config_read_hidden + (int)$this->smarty->config_booleanize * 2 +
(int)$this->smarty->config_overwrite * 4;
$_filepath = sha1($this->config_resource_name . $_flag);
. substr($_filepath, 4, 2) . DS
. $_filepath;
}
+ $_compile_dir_sep = $this->smarty->use_sub_dirs ? DS : '^';
+ if (isset($_compile_id)) {
+ $_filepath = $_compile_id . $_compile_dir_sep . $_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
- */
+ * Returns the timpestamp of the compiled file
+ *
+ * @return integer the file timestamp
+ */
public function getCompiledTimestamp ()
{
return $this->compiled_timestamp === null ?
$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
- */
+ * 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 = ($this->smarty->force_compile || $this->getCompiledTimestamp () === false || $this->smarty->compile_check && $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
- */
+ * 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) {
}
/**
- * Compiles the config files
- */
+ * Compiles the config files
+ */
public function compileConfigSource ()
{
// compile template
// load compiler
$this->compiler_object = new Smarty_Internal_Config_File_Compiler($this->smarty);
}
+ // compile locking
+ if ($this->smarty->compile_locking) {
+ if ($saved_timestamp = $this->getCompiledTimestamp()) {
+ touch($this->getCompiledFilepath());
+ }
+ }
// 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;
+ try {
+ $this->compiler_object->compileSource($this);
}
+ catch (Exception $e) {
+ // restore old timestamp in case of error
+ if ($this->smarty->compile_locking && $saved_timestamp) {
+ touch($this->getCompiledFilepath(), $saved_timestamp);
+ }
+ throw $e;
+ }
+ // compiling succeded
+ // write compiled template
+ Smarty_Internal_Write_File::writeFile($this->getCompiledFilepath(), $this->getCompiledConfig(), $this->smarty);
}
/*
* @param mixed $sections array of section names, single section or null
* @param object $scope global,parent or local
*/
- public function loadConfigVars ($sections = null, $scope)
+ public function loadConfigVars ($sections = null, $scope = 'local')
{
- if (isset($this->template)) {
- $this->template->properties['file_dependency'][sha1($this->getConfigFilepath())] = array($this->getConfigFilepath(), $this->getTimestamp());
- } else {
- $this->smarty->properties['file_dependency'][sha1($this->getConfigFilepath())] = array($this->getConfigFilepath(), $this->getTimestamp());
+ if ($this->data instanceof Smarty_Internal_Template) {
+ $this->data->properties['file_dependency'][sha1($this->getConfigFilepath())] = array($this->getConfigFilepath(), $this->getTimestamp(),'file');
}
- $config_data = unserialize($this->getCompiledConfig());
- // var_dump($config_data);
+ if ($this->mustCompile()) {
+ $this->compileConfigSource();
+ }
+ // pointer to scope
+ if ($scope == 'local') {
+ $scope_ptr = $this->data;
+ } elseif ($scope == 'parent') {
+ if (isset($this->data->parent)) {
+ $scope_ptr = $this->data->parent;
+ } else {
+ $scope_ptr = $this->data;
+ }
+ } elseif ($scope == 'root' || $scope == 'global') {
+ $scope_ptr = $this->data;
+ while (isset($scope_ptr->parent)) {
+ $scope_ptr = $scope_ptr->parent;
+ }
+ }
+ $_config_vars = array();
+ include($this->getCompiledFilepath ());
// copy global config vars
- foreach ($config_data['vars'] as $variable => $value) {
- if ($this->smarty->config_overwrite || !isset($scope->config_vars[$variable])) {
- $scope->config_vars[$variable] = $value;
+ foreach ($_config_vars['vars'] as $variable => $value) {
+ if ($this->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) {
+ $scope_ptr->config_vars[$variable] = $value;
} else {
- $scope->config_vars[$variable] = array_merge((array)$scope->config_vars[$variable], (array)$value);
+ $scope_ptr->config_vars[$variable] = array_merge((array)$scope_ptr->config_vars[$variable], (array)$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) {
- if ($this->smarty->config_overwrite || !isset($scope->config_vars[$variable])) {
- $scope->config_vars[$variable] = $value;
- } else {
- $scope->config_vars[$variable] = array_merge((array)$scope->config_vars[$variable], (array)$value);
- }
- }
- }
- }
+ if(!empty($sections)) {
+ foreach ($_config_vars['sections'] as $this_section => $dummy) {
+ if (in_array($this_section, (array)$sections)) {
+ foreach ($_config_vars['sections'][$this_section]['vars'] as $variable => $value) {
+ if ($this->smarty->config_overwrite || !isset($scope_ptr->config_vars[$variable])) {
+ $scope_ptr->config_vars[$variable] = $value;
+ } else {
+ $scope_ptr->config_vars[$variable] = array_merge((array)$scope_ptr->config_vars[$variable], (array)$value);
+ }
+ }
+ }
+ }
+ }
}
}
-
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_config_file_compiler.php b/gosa-core/include/smarty/sysplugins/smarty_internal_config_file_compiler.php
index 1547911152d4caa0767ae46b0061b2800fd551da..e9dfbdb02155b307acd5c9ff80d8fe9590396477 100644 (file)
<?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
-*/
+ * 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
-*/
+ * Main config file compiler class
+ */
class Smarty_Internal_Config_File_Compiler {
- public $compile_error= false;
- /**
- * Initialize compiler
- */
+ /**
+ * 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->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
- */
+ * 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";
+ 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();
+ $parser = new Smarty_Internal_Configfileparser($lex, $this);
+ if (isset($this->smarty->_parserdebug)) $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";
+ if (isset($this->smarty->_parserdebug)) 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;
- }
+ $config->compiled_config = '<?php $_config_vars = ' . var_export($this->config_data, true) . '; ?>';
}
/**
- * 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
- */
+ * 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();
// get template source line which has error
$line = $this->lex->line;
if (isset($args)) {
-// $line--;
+ // $line--;
}
$match = preg_split("/\n/", $this->lex->data);
$error_text = "Syntax error in config file '{$this->config->getConfigFilepath()}' on line {$line} '{$match[$line-1]}' ";
// 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;
+ throw new SmartyCompilerException($error_text);
}
-
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_configfilelexer.php b/gosa-core/include/smarty/sysplugins/smarty_internal_configfilelexer.php
index 50d9fd693193da01fd66091f21bad895be4d532a..86143bcfea5371c5b62ede9408acdc67491ce734 100644 (file)
/**
* Smarty Internal Plugin Configfilelexer
*
-* This is the lexer to break the config file source into tokens
+* This is the lexer to break the config file source into tokens
* @package Smarty
* @subpackage Config
-* @author Uwe Tews
+* @author Uwe Tews
*/
/**
* Smarty Internal Plugin Configfilelexer
private $state = 1;
public $smarty_token_names = array ( // Text for parser error messages
);
-
-
+
+
function __construct($data, $smarty)
{
// set instance object
- self::instance($this);
+ self::instance($this);
$this->data = $data . "\n"; //now all lines are \n-terminated
$this->counter = 0;
$this->line = 1;
- $this->smarty = $smarty;
+ $this->smarty = $smarty;
}
public static function &instance($new_instance = null)
{
if (isset($new_instance) && is_object($new_instance))
$instance = $new_instance;
return $instance;
- }
+ }
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
- $yy_global_pattern = "/^(#)|^(\\[)|^(\\])|^(=)|^([ \t\r]+)|^(\n)|^([0-9]*[a-zA-Z_]\\w*)/";
+ $yy_global_pattern = "/^(#)|^(\\[)|^(\\])|^(=)|^([ \t\r]+)|^(\n)|^([0-9]*[a-zA-Z_]\\w*)/iS";
do {
if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {
3 => 0,
4 => 0,
5 => 0,
- 6 => 0,
- 7 => 0,
+ 6 => 1,
8 => 0,
9 => 0,
+ 10 => 0,
);
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
- $yy_global_pattern = "/^([ \t\r]+)|^(\\d+\\.\\d+(?=[ \t\r]*[\n#]))|^(\\d+(?=[ \t\r]*[\n#]))|^('[^'\\\\]*(?:\\\\.[^'\\\\]*)*'(?=[ \t\r]*[\n#]))|^(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"(?=[ \t\r]*[\n#]))|^(\"\"\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"\"\"(?=[ \t\r]*[\n#]))|^([a-zA-Z]+(?=[ \t\r]*[\n#]))|^([^\n]+?(?=[ \t\r]*\n))|^(\n)/";
+ $yy_global_pattern = "/^([ \t\r]+)|^(\\d+\\.\\d+(?=[ \t\r]*[\n#]))|^(\\d+(?=[ \t\r]*[\n#]))|^('[^'\\\\]*(?:\\\\.[^'\\\\]*)*'(?=[ \t\r]*[\n#]))|^(\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\"(?=[ \t\r]*[\n#]))|^(\"\"\"([^\"]|\\\\\"|\"{1,2}[^\"])*\"\"\"(?=[ \t\r]*[\n#]))|^([a-zA-Z]+(?=[ \t\r]*[\n#]))|^([^\n]+?(?=[ \t\r]*\n))|^(\n)/iS";
do {
if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {
$this->token = Smarty_Internal_Configfileparser::TPC_TRIPPLE_DOUBLE_QUOTED_STRING;
$this->yypopstate();
}
- function yy_r2_7($yy_subpatterns)
+ function yy_r2_8($yy_subpatterns)
{
if (!$this->smarty->config_booleanize || !in_array(strtolower($this->value), Array("true", "false", "on", "off", "yes", "no")) ) {
$this->yypopstate();
}
}
- function yy_r2_8($yy_subpatterns)
+ function yy_r2_9($yy_subpatterns)
{
$this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
$this->yypopstate();
}
- function yy_r2_9($yy_subpatterns)
+ function yy_r2_10($yy_subpatterns)
{
$this->token = Smarty_Internal_Configfileparser::TPC_NAKED_STRING;
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
- $yy_global_pattern = "/^([^\n]+?(?=[ \t\r]*\n))/";
+ $yy_global_pattern = "/^([^\n]+?(?=[ \t\r]*\n))/iS";
do {
if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
- $yy_global_pattern = "/^([ \t\r]+)|^([^\n]+?(?=[ \t\r]*\n))|^(\n)/";
+ $yy_global_pattern = "/^([ \t\r]+)|^([^\n]+?(?=[ \t\r]*\n))|^(\n)/iS";
do {
if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
- $yy_global_pattern = "/^(\\.)|^(.*?(?=[\.=[\]\r\n]))/";
+ $yy_global_pattern = "/^(\\.)|^(.*?(?=[\.=[\]\r\n]))/iS";
do {
if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_configfileparser.php b/gosa-core/include/smarty/sysplugins/smarty_internal_configfileparser.php
index 3621a487f808b7aa45447a22cfae9939ef30dade..0b5a573436f366c6ffea5529f309a453f10b4043 100644 (file)
@@ -113,7 +113,6 @@ class Smarty_Internal_Configfileparser#line 79 "smarty_internal_configfileparser
if (in_array(strtolower($str) ,array('on','yes','true'))) {
$res = true;
} else {
- assert(in_array(strtolower($str), array('off','no','false')));
$res = false;
}
return $res;
@@ -179,7 +178,7 @@ class Smarty_Internal_Configfileparser#line 79 "smarty_internal_configfileparser
$this->set_var($var, $this->compiler->config_data['sections'][$section_name]);
}
}
-#line 175 "smarty_internal_configfileparser.php"
+#line 174 "smarty_internal_configfileparser.php"
const TPC_OPENB = 1;
const TPC_SECTION = 2;
function __destruct()
{
- while ($this->yyidx >= 0) {
+ while ($this->yystack !== Array()) {
$this->yy_pop_parser_stack();
}
if (is_resource(self::$yyTraceFILE)) {
$this->yystack[$this->yyidx]->stateno,
self::$yyRuleInfo[$yyruleno]['lhs']);
if (isset(self::$yyExpectedTokens[$nextstate])) {
- $expected += self::$yyExpectedTokens[$nextstate];
+ $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]);
if (in_array($token,
self::$yyExpectedTokens[$nextstate], true)) {
$this->yyidx = $yyidx;
}
break;
} while (true);
+ $this->yyidx = $yyidx;
+ $this->yystack = $stack;
return array_unique($expected);
}
while ($this->yyidx >= 0) {
$this->yy_pop_parser_stack();
}
+#line 126 "smarty_internal_configfileparser.y"
+
+ $this->internalError = true;
+ $this->compiler->trigger_config_file_error("Stack overflow in configfile parser");
+#line 585 "smarty_internal_configfileparser.php"
return;
}
$yytos = new TPC_yyStackEntry;
15 => 15,
16 => 16,
);
-#line 127 "smarty_internal_configfileparser.y"
+#line 132 "smarty_internal_configfileparser.y"
function yy_r0(){ $this->_retvalue = null; }
-#line 645 "smarty_internal_configfileparser.php"
-#line 130 "smarty_internal_configfileparser.y"
+#line 652 "smarty_internal_configfileparser.php"
+#line 135 "smarty_internal_configfileparser.y"
function yy_r1(){ $this->add_global_vars($this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = null; }
-#line 648 "smarty_internal_configfileparser.php"
-#line 136 "smarty_internal_configfileparser.y"
+#line 655 "smarty_internal_configfileparser.php"
+#line 141 "smarty_internal_configfileparser.y"
function yy_r4(){ $this->add_section_vars($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = null; }
-#line 651 "smarty_internal_configfileparser.php"
-#line 137 "smarty_internal_configfileparser.y"
+#line 658 "smarty_internal_configfileparser.php"
+#line 142 "smarty_internal_configfileparser.y"
function yy_r5(){ if ($this->smarty->config_read_hidden) { $this->add_section_vars($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor); } $this->_retvalue = null; }
-#line 654 "smarty_internal_configfileparser.php"
-#line 140 "smarty_internal_configfileparser.y"
+#line 661 "smarty_internal_configfileparser.php"
+#line 145 "smarty_internal_configfileparser.y"
function yy_r6(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; }
-#line 657 "smarty_internal_configfileparser.php"
-#line 141 "smarty_internal_configfileparser.y"
+#line 664 "smarty_internal_configfileparser.php"
+#line 146 "smarty_internal_configfileparser.y"
function yy_r7(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor, Array($this->yystack[$this->yyidx + 0]->minor)); }
-#line 660 "smarty_internal_configfileparser.php"
-#line 142 "smarty_internal_configfileparser.y"
+#line 667 "smarty_internal_configfileparser.php"
+#line 147 "smarty_internal_configfileparser.y"
function yy_r8(){ $this->_retvalue = Array(); }
-#line 663 "smarty_internal_configfileparser.php"
-#line 146 "smarty_internal_configfileparser.y"
+#line 670 "smarty_internal_configfileparser.php"
+#line 151 "smarty_internal_configfileparser.y"
function yy_r9(){ $this->_retvalue = Array("key" => $this->yystack[$this->yyidx + -2]->minor, "value" => $this->yystack[$this->yyidx + 0]->minor); }
-#line 666 "smarty_internal_configfileparser.php"
-#line 148 "smarty_internal_configfileparser.y"
+#line 673 "smarty_internal_configfileparser.php"
+#line 153 "smarty_internal_configfileparser.y"
function yy_r10(){ $this->_retvalue = (float) $this->yystack[$this->yyidx + 0]->minor; }
-#line 669 "smarty_internal_configfileparser.php"
-#line 149 "smarty_internal_configfileparser.y"
+#line 676 "smarty_internal_configfileparser.php"
+#line 154 "smarty_internal_configfileparser.y"
function yy_r11(){ $this->_retvalue = (int) $this->yystack[$this->yyidx + 0]->minor; }
-#line 672 "smarty_internal_configfileparser.php"
-#line 150 "smarty_internal_configfileparser.y"
+#line 679 "smarty_internal_configfileparser.php"
+#line 155 "smarty_internal_configfileparser.y"
function yy_r12(){ $this->_retvalue = $this->parse_bool($this->yystack[$this->yyidx + 0]->minor); }
-#line 675 "smarty_internal_configfileparser.php"
-#line 151 "smarty_internal_configfileparser.y"
+#line 682 "smarty_internal_configfileparser.php"
+#line 156 "smarty_internal_configfileparser.y"
function yy_r13(){ $this->_retvalue = self::parse_single_quoted_string($this->yystack[$this->yyidx + 0]->minor); }
-#line 678 "smarty_internal_configfileparser.php"
-#line 152 "smarty_internal_configfileparser.y"
+#line 685 "smarty_internal_configfileparser.php"
+#line 157 "smarty_internal_configfileparser.y"
function yy_r14(){ $this->_retvalue = self::parse_double_quoted_string($this->yystack[$this->yyidx + 0]->minor); }
-#line 681 "smarty_internal_configfileparser.php"
-#line 153 "smarty_internal_configfileparser.y"
+#line 688 "smarty_internal_configfileparser.php"
+#line 158 "smarty_internal_configfileparser.y"
function yy_r15(){ $this->_retvalue = self::parse_tripple_double_quoted_string($this->yystack[$this->yyidx + 0]->minor); }
-#line 684 "smarty_internal_configfileparser.php"
-#line 154 "smarty_internal_configfileparser.y"
+#line 691 "smarty_internal_configfileparser.php"
+#line 159 "smarty_internal_configfileparser.y"
function yy_r16(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }
-#line 687 "smarty_internal_configfileparser.php"
+#line 694 "smarty_internal_configfileparser.php"
private $_retvalue;
function yy_syntax_error($yymajor, $TOKEN)
{
-#line 120 "smarty_internal_configfileparser.y"
+#line 119 "smarty_internal_configfileparser.y"
$this->internalError = true;
$this->yymajor = $yymajor;
$this->compiler->trigger_config_file_error();
-#line 750 "smarty_internal_configfileparser.php"
+#line 757 "smarty_internal_configfileparser.php"
}
function yy_accept()
while ($this->yyidx >= 0) {
$stack = $this->yy_pop_parser_stack();
}
-#line 112 "smarty_internal_configfileparser.y"
+#line 111 "smarty_internal_configfileparser.y"
$this->successful = !$this->internalError;
$this->internalError = false;
$this->retvalue = $this->_retvalue;
//echo $this->retvalue."\n\n";
-#line 768 "smarty_internal_configfileparser.php"
+#line 775 "smarty_internal_configfileparser.php"
}
function doParse($yymajor, $yytokenvalue)
} while ($yymajor != self::YYNOCODE && $this->yyidx >= 0);
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_data.php b/gosa-core/include/smarty/sysplugins/smarty_internal_data.php
index 61b9b52bd3363765e16aeb3952413365f869b9a1..167262694bf70bc216244217cbafb6f45c0e2ba3 100644 (file)
<?php
/**
-* Smarty Internal Plugin Data
-*
-* This file contains the basic classes and methodes for template and variable creation
-*
-* @package Smarty
-* @subpackage Templates
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Data
+ *
+ * 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
-*/
+ * Base class with template and variable methodes
+ */
class Smarty_Internal_Data {
// 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)
+ * 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)
{
if (is_array($tpl_var)) {
foreach ($tpl_var as $_key => $_val) {
if ($_key != '') {
- $this->tpl_vars[$_key] = new Smarty_variable($_val, $nocache, $scope);
- }
- }
+ $this->tpl_vars[$_key] = new Smarty_variable($_val, $nocache);
+ }
+ }
} else {
if ($tpl_var != '') {
- $this->tpl_vars[$tpl_var] = new Smarty_variable($value, $nocache, $scope);
- }
- }
- }
+ $this->tpl_vars[$tpl_var] = new Smarty_variable($value, $nocache);
+ }
+ }
+ }
/**
- * 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)
+ * 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 assignGlobal($varname, $value = null, $nocache = false)
{
if ($varname != '') {
- $this->smarty->global_tpl_vars[$varname] = new Smarty_variable($value, $nocache);
- }
- }
+ 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)
+ * 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
+ */
+ public function assignByRef($tpl_var, &$value, $nocache = false)
{
if ($tpl_var != '') {
- $this->tpl_vars[$tpl_var] = new Smarty_variable(null, $nocache, $scope);
+ $this->tpl_vars[$tpl_var] = new Smarty_variable(null, $nocache);
$this->tpl_vars[$tpl_var]->value = &$value;
- }
- }
+ }
+ }
+
+ /**
+ * wrapper function for Smarty 2 BC
+ *
+ * @param string $tpl_var the template variable name
+ * @param mixed $ &$value the referenced value to assign
+ */
+ public function assign_by_ref($tpl_var, &$value)
+ {
+ if($this->smarty->deprecation_notices)
+ trigger_error("function call 'assign_by_ref' is unknown or deprecated, use 'assignByRef'", E_USER_NOTICE);
+ $this->assignByRef($tpl_var, $value);
+ }
/**
- * appends values to template variables
- *
- * @param array $ |string $tpl_var the template variable name(s)
- * @param mixed $value the value to append
- * @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)
+ * 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
+ */
+ public function append($tpl_var, $value = null, $merge = false, $nocache = false)
{
if (is_array($tpl_var)) {
// $tpl_var is an array, ignore $value
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);
+ $this->tpl_vars[$_key] = new Smarty_variable(null, $nocache);
} 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);
+ $this->tpl_vars[$tpl_var] = new Smarty_variable(null, $nocache);
} 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)
+ * 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 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;
- }
- }
- }
+ }
+ }
+ }
+ /**
+ *
+ * @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($this->smarty->deprecation_notices)
+ trigger_error("function call 'append_by_ref' is unknown or deprecated, use 'appendByRef'", E_USER_NOTICE);
+ $this->appendByRef($tpl_var, $value, $merge);
+ }
+ /**
+ * Returns a single or all template variables
+ *
+ * @param string $varname variable name or null
+ * @return string variable value or or array of variables
+ */
+ 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
- */
- public function clear_assign($tpl_var)
+ * clear the given assigned template variable.
+ *
+ * @param string $ |array $tpl_var the template variable(s) to clear
+ */
+ 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]);
- }
- }
+ }
+ }
/**
- * clear all the assigned template variables.
- */
- public function clear_all_assign()
+ * clear all the assigned template variables.
+ */
+ public function clearAllAssign()
{
$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 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 configLoad($config_file, $sections = null)
+ {
// load Config class
- $config = new Smarty_Internal_Config($config_file, $this->smarty);
- $config->loadConfigVars($sections, $this);
- }
+ $config = new Smarty_Internal_Config($config_file, $this->smarty, $this);
+ $config->loadConfigVars($sections);
+ }
/**
- * 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)
+ * 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])) {
+ if (isset($_ptr->tpl_vars[$_variable])) {
// found it, return it
- return $_ptr->tpl_vars[$variable];
- }
+ 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])) {
+ }
+ }
+ if (isset(Smarty::$global_tpl_vars[$_variable])) {
// found it, return it
- return $this->smarty->global_tpl_vars[$variable];
- }
+ return Smarty::$global_tpl_vars[$_variable];
+ }
if ($this->smarty->error_unassigned && $error_enable) {
- throw new Exception('Undefined Smarty variable "' . $variable . '"');
+ throw new SmartyException('Undefined Smarty variable "' . $_variable . '"');
} else {
+ if ($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)
+ * 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])) {
+ if (isset($_ptr->config_vars[$_variable])) {
// found it, return it
- return $_ptr->config_vars[$variable];
- }
+ 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 . '"');
+ throw new SmartyException('Undefined config variable "' . $_variable . '"');
} else {
- return '';
- }
- }
+ // 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
- */
+ * 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);
- }
+ while (!feof($fp) && ($current_line = fgets($fp)) !== false ) {
+ $_result .= $current_line;
+ }
fclose($fp);
return $_result;
- }
+ }
- if ($this->smarty->$error_unassigned) {
- throw new Exception('Undefined stream variable "' . $variable . '"');
+ if ($this->smarty->error_unassigned) {
+ throw new SmartyException('Undefined stream variable "' . $variable . '"');
} else {
- return '';
- }
- }
+ return null;
+ }
+ }
/**
- * 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)
+ * Returns a single or all config variables
+ *
+ * @param string $varname variable name or null
+ * @return string variable value or or array of variables
+ */
+ function getConfigVars($varname = null, $search_parents = true)
{
- 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
- // already in template cache?
- $_templateId = crc32($template . $cache_id . $compile_id);
- if (isset($this->smarty->template_objects[$_templateId]) && $this->smarty->caching) {
- // return cached template object
- $tpl = $this->smarty->template_objects[$_templateId];
+ // var_dump($this);
+ $_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 {
- // create new template object
- $tpl = new $this->template_class($template, $this->smarty, $parent, $cache_id, $compile_id);
- }
+ $_ptr = null;
+ }
+ }
+ if (isset($varname)) {
+ return '';
} 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;
- }
+ return $var_array;
+ }
+ }
/**
- * return current time
- *
- * @returns double current time
- */
- function _get_time()
+ * Deassigns a single or all config variables
+ *
+ * @param string $varname variable name or null
+ */
+ function clearConfig($varname = null)
{
- $_mtime = microtime();
- $_mtime = explode(" ", $_mtime);
- return (double)($_mtime[1]) + (double)($_mtime[0]);
- }
-}
+ if (isset($varname)) {
+ unset($this->config_vars[$varname]);
+ return;
+ } else {
+ $this->config_vars = array();
+ return;
+ }
+ }
+
+}
/**
-* 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 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_Data {
// array of variable objects
- public $tpl_vars = array();
+ public $tpl_vars = array();
// back pointer to parent object
- public $parent = null;
+ public $parent = null;
// config vars
public $config_vars = array();
+ // Smarty object
+ public $smarty = null;
/**
- * create Smarty data object
- */
- public function __construct ($_parent = null)
+ * create Smarty data object
+ */
+ public function __construct ($_parent = null, $smarty = null)
{
+ $this->smarty = $smarty;
if (is_object($_parent)) {
// when object set up back pointer
$this->parent = $_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");
- }
- }
-}
+ }
+ } elseif ($_parent != null) {
+ throw new SmartyException("Wrong type for template variables");
+ }
+ }
+}
/**
-* class for the Smarty variable object
-*
-* This class defines the Smarty variable object
-*/
+ * 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)
+ * 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::SCOPE_LOCAL)
{
$this->value = $value;
$this->nocache = $nocache;
$this->scope = $scope;
- }
-}
+ }
+
+ public function __toString ()
+ {
+ return $this->value;
+ }
+}
/**
-* class for undefined variable object
-*
-* This class defines an object for undefined variable handling
-*/
+ * 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)
return false;
} else {
return null;
- }
- }
-}
+ }
+ }
+}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_debug.php b/gosa-core/include/smarty/sysplugins/smarty_internal_debug.php
index 9df0942dd86e5b2ece24b29e2f0b53d91667d439..e605ca8b613551f2e0d789b47c02e40681320bc9 100644 (file)
/**
* Smarty Internal Plugin Debug
-*
+*
* Class to collect data for the Smarty Debugging Consol
-*
+*
* @package Smarty
* @subpackage Debug
-* @author Uwe Tews
+* @author Uwe Tews
*/
+
/**
* Smarty Internal Plugin Debug Class
*/
class Smarty_Internal_Debug extends Smarty_Internal_Data {
- // template data
- static $template_data = array();
+ // 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();
- }
+ /**
+ * Start logging of compile time
+ */
+ public static function start_compile($template)
+ {
+ $key = self::get_key($template);
+ self::$template_data[$key]['start_time'] = microtime(true);
+ }
- /**
- * 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'];
- }
+ /**
+ * End logging of compile time
+ */
+ public static function end_compile($template)
+ {
+ $key = self::get_key($template);
+ self::$template_data[$key]['compile_time'] += microtime(true) - 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();
- }
+ /**
+ * Start logging of render time
+ */
+ public static function start_render($template)
+ {
+ $key = self::get_key($template);
+ self::$template_data[$key]['start_time'] = microtime(true);
+ }
- /**
- * 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'];
- }
+ /**
+ * End logging of compile time
+ */
+ public static function end_render($template)
+ {
+ $key = self::get_key($template);
+ self::$template_data[$key]['render_time'] += microtime(true) - 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();
- }
+ /**
+ * Start logging of cache time
+ */
+ public static function start_cache($template)
+ {
+ $key = self::get_key($template);
+ self::$template_data[$key]['start_time'] = microtime(true);
+ }
- /**
- * 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->cache_id = null;
- $_template->compile_id = null;
- $_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);
- }
+ /**
+ * End logging of cache time
+ */
+ public static function end_cache($template)
+ {
+ $key = self::get_key($template);
+ self::$template_data[$key]['cache_time'] += microtime(true) - self::$template_data[$key]['start_time'];
+ }
+ /**
+ * Opens a window for the Smarty Debugging Consol and display the data
+ */
+ public static function display_debug($obj)
+ {
+ // prepare information of assigned variables
+ $ptr = self::get_debug_vars($obj);
+ if ($obj instanceof Smarty) {
+ $smarty = clone $obj;
+ } else {
+ $smarty = clone $obj->smarty;
+ }
+ $_assigned_vars = $ptr->tpl_vars;
+ ksort($_assigned_vars);
+ $_config_vars = $ptr->config_vars;
+ ksort($_config_vars);
+ $smarty->left_delimiter = '{';
+ $smarty->right_delimiter = '}';
+ $smarty->registered_filters = array();
+ $smarty->autoload_filters = array();
+ $smarty->default_modifiers = array();
+ $_template = new Smarty_Internal_Template ($smarty->debug_tpl, $smarty);
+ $_template->caching = false;
+ $_template->force_compile = false;
+ $_template->disableSecurity();
+ $_template->cache_id = null;
+ $_template->compile_id = null;
+ if ($obj instanceof Smarty_Internal_Template) {
+ $_template->assign('template_name',$obj->resource_type.':'.$obj->resource_name);
+ }
+ if ($obj instanceof Smarty) {
+ $_template->assign('template_data', self::$template_data);
+ } else {
+ $_template->assign('template_data', null);
+ }
+ $_template->assign('assigned_vars', $_assigned_vars);
+ $_template->assign('config_vars', $_config_vars);
+ $_template->assign('execution_time', microtime(true) - $smarty->start_time);
+ echo $_template->getRenderedTemplate();
+ }
+ /*
+ * Recursively gets variables from all template/data scopes
+ */
+ public static function get_debug_vars($obj)
+ {
+ $config_vars = $obj->config_vars;
+ $tpl_vars = array();
+ foreach ($obj->tpl_vars as $key => $var) {
+ $tpl_vars[$key] = clone $var;
+ if ($obj instanceof Smarty_Internal_Template) {
+ $tpl_vars[$key]->scope = $obj->resource_type.':'.$obj->resource_name;
+ } elseif ($obj instanceof Smarty_Data) {
+ $tpl_vars[$key]->scope = 'Data object';
+ } else {
+ $tpl_vars[$key]->scope = 'Smarty root';
+ }
+ }
- /**
- * get_key
- */
- static function get_key($template)
- {
- // calculate Uid if not already done
- if ($template->templateUid == '') {
- $template->getTemplateFilepath();
- }
- $key = $template->templateUid;
- 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;
- }
- }
+ if (isset($obj->parent)) {
+ $parent = self::get_debug_vars($obj->parent);
+ $tpl_vars = array_merge($parent->tpl_vars, $tpl_vars);
+ $config_vars = array_merge($parent->config_vars, $config_vars);
+ } else {
+ foreach (Smarty::$global_tpl_vars as $name => $var) {
+ if (!array_key_exists($name, $tpl_vars)) {
+ $clone = clone $var;
+ $clone->scope = 'Global';
+ $tpl_vars[$name] = $clone;
+ }
+ }
+ }
+ return (object) array('tpl_vars' => $tpl_vars, 'config_vars' => $config_vars);
+ }
- /**
- * return current time
- *
- * @returns double current time
- */
- static function get_time()
- {
- $_mtime = microtime();
- $_mtime = explode(" ", $_mtime);
- return (double)($_mtime[1]) + (double)($_mtime[0]);
- }
-}
+ /**
+ * get_key
+ */
+ static function get_key($template)
+ {
+ // calculate Uid if not already done
+ if ($template->templateUid == '') {
+ $template->getTemplateFilepath();
+ }
+ $key = $template->templateUid;
+ 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;
+ }
+ }
+}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_filter.php b/gosa-core/include/smarty/sysplugins/smarty_internal_filter.php
--- /dev/null
@@ -0,0 +1,89 @@
+<?php
+
+/**
+ * Smarty Internal Plugin Filter
+ *
+ * External Smarty filter methods
+ *
+ * @package Smarty
+ * @author Uwe Tews
+ */
+
+/**
+ * Class for filter methods
+ */
+class Smarty_Internal_Filter {
+
+ function __construct($smarty)
+ {
+ $this->smarty = $smarty;
+ }
+ /**
+ * Registers a filter function
+ *
+ * @param string $type filter type
+ * @param callback $callback
+ */
+ public function registerFilter($type, $callback)
+ {
+ $this->smarty->registered_filters[$type][$this->_get_filter_name($callback)] = $callback;
+ }
+
+ /**
+ * Unregisters a filter function
+ *
+ * @param string $type filter type
+ * @param callback $callback
+ */
+ public function unregisterFilter($type, $callback)
+ {
+ $name = $this->_get_filter_name($callback);
+ if(isset($this->smarty->registered_filters[$type][$name])) {
+ unset($this->smarty->registered_filters[$type][$name]);
+ }
+ }
+
+
+ /**
+ * Return internal filter name
+ *
+ * @param callback $function_name
+ */
+ public function _get_filter_name($function_name)
+ {
+ if (is_array($function_name)) {
+ $_class_name = (is_object($function_name[0]) ?
+ get_class($function_name[0]) : $function_name[0]);
+ return $_class_name . '_' . $function_name[1];
+ } else {
+ return $function_name;
+ }
+ }
+
+
+ /**
+ * load a filter of specified type and name
+ *
+ * @param string $type filter type
+ * @param string $name filter name
+ * @return bool
+ */
+ function loadFilter($type, $name)
+ {
+ $_plugin = "smarty_{$type}filter_{$name}";
+ $_filter_name = $_plugin;
+ if ($this->smarty->loadPlugin($_plugin)) {
+ if (class_exists($_plugin, false)) {
+ $_plugin = array($_plugin, 'execute');
+ }
+ if (is_callable($_plugin)) {
+ return $this->smarty->registered_filters[$type][$_filter_name] = $_plugin;
+ }
+ }
+ throw new SmartyException("{$type}filter \"{$name}\" not callable");
+ return false;
+ }
+
+
+}
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_filter_handler.php b/gosa-core/include/smarty/sysplugins/smarty_internal_filter_handler.php
index 1d81636e6067b4250648e61b334c167e7711d649..fbd88460226c5ab7bef4afa6a628ba00728c19b6 100644 (file)
<?php
/**
-* Smarty Internal Plugin Filter Handler
-*
-* Smarty filter handler class
-*
-* @package Smarty
-* @subpackage PluginsInternal
-* @author Uwe Tews
-*/
+ * Smarty Internal Plugin Filter Handler
+ *
+ * Smarty filter handler class
+ *
+ * @package Smarty
+ * @subpackage PluginsInternal
+ * @author Uwe Tews
+ */
/**
-* Class for filter processing
-*/
+ * Class for filter processing
+ */
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' or 'variable') which shall run
- * @param string $content the content which shall be processed by the filters
- * @return string the filtered content
- */
- static function runFilter($type, $content, $smarty, $flag = null)
+ * 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
+ */
+ static function runFilter($type, $content, $template, $flag = null)
{
$output = $content;
- if ($type != 'variable' || ($smarty->variable_filter && $flag !== false) || $flag === true) {
+ if ($type != 'variable' || ($template->smarty->variable_filter && $flag !== false) || $flag === true) {
// loop over autoload filters of specified type
- if (!empty($smarty->autoload_filters[$type])) {
- foreach ((array)$smarty->autoload_filters[$type] as $name) {
+ if (!empty($template->smarty->autoload_filters[$type])) {
+ foreach ((array)$template->smarty->autoload_filters[$type] as $name) {
$plugin_name = "Smarty_{$type}filter_{$name}";
- if ($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, $smarty));
- } elseif (function_exists($plugin_name)) {
+ if ($template->smarty->loadPlugin($plugin_name)) {
+ if (function_exists($plugin_name)) {
// use loaded Smarty2 style plugin
- $output = call_user_func_array($plugin_name, array($output, $smarty));
+ $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 Exception("Unable to load filter {$plugin_name}");
+ throw new SmartyException("Unable to load filter {$plugin_name}");
}
}
}
// loop over registerd filters of specified type
- if (!empty($smarty->registered_filters[$type])) {
- foreach ($smarty->registered_filters[$type] as $key => $name) {
- $output = call_user_func_array($smarty->registered_filters[$type][$key], array($output, $smarty));
+ 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);
+ }
}
}
}
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_function_call_handler.php b/gosa-core/include/smarty/sysplugins/smarty_internal_function_call_handler.php
index 0f5cfeba1900b11848c68af1257f215551a3fb83..928f04471107a9376fee69a74f34733fa418b8cf 100644 (file)
-<?php
-/**
-* Smarty Internal Plugin Function Call Handler
-*
-* @package Smarty
-* @subpackage Security
-* @author Uwe Tews
-*/
-/**
-* This class does call function defined with the {function} tag
-*/
-class Smarty_Internal_Function_Call_Handler extends Smarty_Internal_Template {
- function __construct($name, $smarty, $parent, $nocache)
- {
- parent::__construct('string:', $smarty, $parent);
- if (!isset($this->smarty->template_functions[$name])) {
- throw new Exception("Call to undefined template function \"{$name}\" in template \"{$parent->template_resource}\"");
- }
- $this->called_nocache = $nocache;
- $this->mustCompile = false;
- if ($nocache) {
- $smarty->template_functions[$name]['called_nocache'] = true;
- $this->properties['function'][$name]['called_nocache'] = true;
- }
- $this->properties['nocache_hash'] = $smarty->template_functions[$name]['nocache_hash'];
- // load compiled function
- if ($nocache) {
- // if called in nocache mode convert nocache code to real code
- $this->compiled_template = preg_replace(array("!(<\?php echo ')?/\*/?%%SmartyNocache:{$this->smarty->template_functions[$name]['nocache_hash']}%%\*/(';\?>)?!", "!\\\'!"), array('', "'"), $smarty->template_functions[$name]['compiled']);
- } else {
- $this->compiled_template = $smarty->template_functions[$name]['compiled'];
- }
- // assign default paramter
- if (isset($smarty->template_functions[$name]['parameter'])) {
- $_smarty_tpl = $this;
- foreach ($smarty->template_functions[$name]['parameter'] as $_key => $_value) {
- $this->assign($_key, eval("return {$_value};"));
- }
- }
- // set flag if {function} contains nocache code
- if ($smarty->template_functions[$name]['has_nocache_code']) {
- $this->has_nocache_code = true;
- }
- }
-}
-
-?>
+<?php\r
+/**\r
+ * Smarty Internal Plugin Function Call Handler\r
+ *\r
+ * @package Smarty\r
+ * @subpackage PluginsInternal\r
+ * @author Uwe Tews\r
+ */\r
+\r
+/**\r
+ * This class does call function defined with the {function} tag\r
+ */\r
+class Smarty_Internal_Function_Call_Handler extends Smarty_Internal_Template {\r
+ static function call ($_name, $_template, $_params, $_hash, $_nocache)\r
+ {\r
+ if ($_nocache) {\r
+ $_function = "smarty_template_function_{$_name}_nocache";\r
+ $_template->smarty->template_functions[$_name]['called_nocache'] = true;\r
+ } else {\r
+ $_function = "smarty_template_function_{$_hash}_{$_name}";\r
+ }\r
+ if (!is_callable($_function)) {\r
+ $_code = "function {$_function}(\$_smarty_tpl,\$params) {\r
+ \$saved_tpl_vars = \$_smarty_tpl->tpl_vars;\r
+ foreach (\$_smarty_tpl->template_functions['{$_name}']['parameter'] as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);};\r
+ foreach (\$params as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);}?>";\r
+ if ($_nocache) {\r
+ $_code .= preg_replace(array("!<\?php echo \\'/\*%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/|/\*/%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/\\';\?>!",\r
+ "!\\\'!"), array('', "'"), $_template->smarty->template_functions[$_name]['compiled']);\r
+ } else {\r
+ $_code .= preg_replace("/{$_template->smarty->template_functions[$_name]['nocache_hash']}/", $_template->properties['nocache_hash'], $_template->smarty->template_functions[$_name]['compiled']);\r
+ }\r
+ $_code .= "<?php \$_smarty_tpl->tpl_vars = \$saved_tpl_vars;}";\r
+ eval($_code);\r
+ }\r
+ $_function($_template, $_params);\r
+ }\r
+}\r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_get_include_path.php b/gosa-core/include/smarty/sysplugins/smarty_internal_get_include_path.php
--- /dev/null
@@ -0,0 +1,44 @@
+<?php\r
+\r
+/**\r
+ * Smarty read include path plugin\r
+ * \r
+ * @package Smarty\r
+ * @subpackage PluginsInternal\r
+ * @author Monte Ohrt \r
+ */\r
+\r
+/**\r
+ * Smarty Internal Read Include Path Class\r
+ */\r
+class Smarty_Internal_Get_Include_Path {\r
+ /**\r
+ * Return full file path from PHP include_path\r
+ * \r
+ * @param string $filepath filepath\r
+ * @return mixed full filepath or false\r
+ */\r
+ public static function getIncludePath($filepath)\r
+ {\r
+ static $_path_array = null;\r
+\r
+ if(!isset($_path_array)) {\r
+ $_ini_include_path = ini_get('include_path');\r
+\r
+ if(strstr($_ini_include_path,';')) {\r
+ // windows pathnames\r
+ $_path_array = explode(';',$_ini_include_path);\r
+ } else {\r
+ $_path_array = explode(':',$_ini_include_path);\r
+ }\r
+ }\r
+ foreach ($_path_array as $_include_path) {\r
+ if (file_exists($_include_path . DS . $filepath)) {\r
+ return $_include_path . DS . $filepath;\r
+ }\r
+ }\r
+ return false;\r
+ } \r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_nocache_insert.php b/gosa-core/include/smarty/sysplugins/smarty_internal_nocache_insert.php
--- /dev/null
@@ -0,0 +1,49 @@
+<?php\r
+\r
+/**\r
+ * Smarty Internal Plugin Nocache Insert\r
+ * \r
+ * Compiles the {insert} tag into the cache file\r
+ * \r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Uwe Tews \r
+ */\r
+\r
+/**\r
+ * Smarty Internal Plugin Compile Insert Class\r
+ */\r
+class Smarty_Internal_Nocache_Insert {\r
+ /**\r
+ * Compiles code for the {insert} tag into cache file\r
+ * \r
+ * @param string $_function insert function name\r
+ * @param array $_attr array with paramter\r
+ * @param object $template template object\r
+ * @param string $_script script name to load or 'null'\r
+ * @param string $_assign soptinal variable name\r
+ * @return string compiled code\r
+ */\r
+ static function compile($_function, $_attr, $_template, $_script, $_assign = null)\r
+ {\r
+ $_output = '<?php ';\r
+ if ($_script != 'null') {\r
+ // script which must be included\r
+ // code for script file loading\r
+ $_output .= "require_once '{$_script}';";\r
+ } \r
+ // call insert\r
+ if (isset($_assign)) {\r
+ $_output .= "\$_smarty_tpl->assign('{$_assign}' , {$_function} (" . var_export($_attr, true) . ",\$_smarty_tpl), true);?>";\r
+ } else {\r
+ $_output .= "echo {$_function}(" . var_export($_attr, true) . ",\$_smarty_tpl);?>";\r
+ } \r
+ $_tpl = $_template;\r
+ while ($_tpl->parent instanceof Smarty_Internal_Template) {\r
+ $_tpl = $_tpl->parent;\r
+ } \r
+ return "/*%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/" . $_output . "/*/%%SmartyNocache:{$_tpl->properties['nocache_hash']}%%*/";\r
+ } \r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_parsetree.php b/gosa-core/include/smarty/sysplugins/smarty_internal_parsetree.php
--- /dev/null
@@ -0,0 +1,236 @@
+<?php\r
+/**\r
+ * Smarty Internal Plugin Templateparser Parsetrees\r
+ * \r
+ * These are classes to build parsetrees in the template parser\r
+ * \r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Thue Kristensen \r
+ * @author Uwe Tews \r
+ */\r
+ \r
+abstract class _smarty_parsetree {\r
+ abstract public function to_smarty_php();\r
+}\r
+\r
+/**\r
+ * A complete smarty tag.\r
+ */\r
+class _smarty_tag extends _smarty_parsetree\r
+{\r
+ public $parser;\r
+ public $data;\r
+ public $saved_block_nesting;\r
+ function __construct($parser, $data)\r
+ {\r
+ $this->parser = $parser;\r
+ $this->data = $data;\r
+ $this->saved_block_nesting = $parser->block_nesting_level;\r
+ } \r
+\r
+ public function to_smarty_php()\r
+ {\r
+ return $this->data;\r
+ } \r
+\r
+ public function assign_to_var()\r
+ {\r
+ $var = sprintf('$_tmp%d', ++$this->parser->prefix_number);\r
+ $this->parser->compiler->prefix_code[] = sprintf('<?php ob_start();?>%s<?php %s=ob_get_clean();?>',\r
+ $this->data, $var);\r
+ return $var;\r
+ } \r
+} \r
+\r
+/**\r
+ * Code fragment inside a tag.\r
+ */\r
+class _smarty_code extends _smarty_parsetree {\r
+ public $parser;\r
+ public $data;\r
+ function __construct($parser, $data)\r
+ {\r
+ $this->parser = $parser;\r
+ $this->data = $data;\r
+ } \r
+\r
+ public function to_smarty_php()\r
+ {\r
+ return sprintf("(%s)", $this->data);\r
+ } \r
+} \r
+\r
+/**\r
+ * Double quoted string inside a tag.\r
+ */\r
+class _smarty_doublequoted extends _smarty_parsetree {\r
+ public $parser;\r
+ public $subtrees = Array();\r
+ function __construct($parser, _smarty_parsetree $subtree)\r
+ {\r
+ $this->parser = $parser;\r
+ $this->subtrees[] = $subtree;\r
+ if ($subtree instanceof _smarty_tag) {\r
+ $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);\r
+ } \r
+ } \r
+\r
+ function append_subtree(_smarty_parsetree $subtree)\r
+ {\r
+ $last_subtree = count($this->subtrees)-1;\r
+ if ($last_subtree >= 0 && $this->subtrees[$last_subtree] instanceof _smarty_tag && $this->subtrees[$last_subtree]->saved_block_nesting < $this->parser->block_nesting_level) {\r
+ if ($subtree instanceof _smarty_code) {\r
+ $this->subtrees[$last_subtree]->data .= '<?php echo ' . $subtree->data . ';?>';\r
+ } elseif ($subtree instanceof _smarty_dq_content) {\r
+ $this->subtrees[$last_subtree]->data .= '<?php echo "' . $subtree->data . '";?>';\r
+ } else {\r
+ $this->subtrees[$last_subtree]->data .= $subtree->data;\r
+ } \r
+ } else {\r
+ $this->subtrees[] = $subtree;\r
+ } \r
+ if ($subtree instanceof _smarty_tag) {\r
+ $this->parser->block_nesting_level = count($this->parser->compiler->_tag_stack);\r
+ } \r
+ } \r
+\r
+ public function to_smarty_php()\r
+ {\r
+ $code = '';\r
+ foreach ($this->subtrees as $subtree) {\r
+ if ($code !== "") {\r
+ $code .= ".";\r
+ } \r
+ if ($subtree instanceof _smarty_tag) {\r
+ $more_php = $subtree->assign_to_var();\r
+ } else {\r
+ $more_php = $subtree->to_smarty_php();\r
+ } \r
+\r
+ $code .= $more_php;\r
+\r
+ if (!$subtree instanceof _smarty_dq_content) {\r
+ $this->parser->compiler->has_variable_string = true;\r
+ } \r
+ } \r
+ return $code;\r
+ } \r
+} \r
+\r
+/**\r
+ * Raw chars as part of a double quoted string.\r
+ */\r
+class _smarty_dq_content extends _smarty_parsetree {\r
+ public $data;\r
+ function __construct($parser, $data)\r
+ {\r
+ $this->parser = $parser;\r
+ $this->data = $data;\r
+ } \r
+\r
+ public function to_smarty_php()\r
+ {\r
+ return '"' . $this->data . '"';\r
+ } \r
+} \r
+\r
+/**\r
+ * Template element\r
+ */\r
+class _smarty_template_buffer extends _smarty_parsetree {\r
+ public $subtrees = Array();\r
+ function __construct($parser)\r
+ {\r
+ $this->parser = $parser;\r
+ } \r
+\r
+ function append_subtree(_smarty_parsetree $subtree)\r
+ {\r
+ $this->subtrees[] = $subtree;\r
+ } \r
+\r
+ public function to_smarty_php()\r
+ {\r
+ $code = '';\r
+ for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) {\r
+ if ($key + 2 < $cnt) {\r
+ 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) {\r
+ $key = $key + 1;\r
+ continue;\r
+ } \r
+ if (substr($this->subtrees[$key]->data, -1) == '<' && $this->subtrees[$key + 1]->data == '' && substr($this->subtrees[$key + 2]->data, -1) == '?') {\r
+ $key = $key + 2;\r
+ continue;\r
+ } \r
+ } \r
+ if (substr($code, -1) == '<') {\r
+ $subtree = $this->subtrees[$key]->to_smarty_php();\r
+ if (substr($subtree, 0, 1) == '?') {\r
+ $code = substr($code, 0, strlen($code)-1) . '<<?php ?>?' . substr($subtree, 1);\r
+ } elseif ($this->parser->asp_tags && substr($subtree, 0, 1) == '%') {\r
+ $code = substr($code, 0, strlen($code)-1) . '<<?php ?>%' . substr($subtree, 1);\r
+ } else {\r
+ $code .= $subtree;\r
+ } \r
+ continue;\r
+ } \r
+ if ($this->parser->asp_tags && substr($code, -1) == '%') {\r
+ $subtree = $this->subtrees[$key]->to_smarty_php();\r
+ if (substr($subtree, 0, 1) == '>') {\r
+ $code = substr($code, 0, strlen($code)-1) . '%<?php ?>>' . substr($subtree, 1);\r
+ } else {\r
+ $code .= $subtree;\r
+ } \r
+ continue;\r
+ } \r
+ if (substr($code, -1) == '?') {\r
+ $subtree = $this->subtrees[$key]->to_smarty_php();\r
+ if (substr($subtree, 0, 1) == '>') {\r
+ $code = substr($code, 0, strlen($code)-1) . '?<?php ?>>' . substr($subtree, 1);\r
+ } else {\r
+ $code .= $subtree;\r
+ } \r
+ continue;\r
+ } \r
+ $code .= $this->subtrees[$key]->to_smarty_php();\r
+ } \r
+ return $code;\r
+ } \r
+}\r
+\r
+/**\r
+ * template text\r
+ */\r
+class _smarty_text extends _smarty_parsetree {\r
+ public $data;\r
+ function __construct($parser, $data)\r
+ {\r
+ $this->parser = $parser;\r
+ $this->data = $data;\r
+ } \r
+\r
+ public function to_smarty_php()\r
+ {\r
+ return $this->data;\r
+ } \r
+} \r
+\r
+/**\r
+ * template linebreaks\r
+ */\r
+class _smarty_linebreak extends _smarty_parsetree {\r
+ public $data;\r
+ function __construct($parser, $data)\r
+ {\r
+ $this->parser = $parser;\r
+ $this->data = $data;\r
+ } \r
+\r
+ public function to_smarty_php()\r
+ {\r
+ return $this->data;\r
+ } \r
+} \r
+\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_register.php b/gosa-core/include/smarty/sysplugins/smarty_internal_register.php
--- /dev/null
@@ -0,0 +1,156 @@
+<?php
+
+/**
+ * Smarty Internal Plugin Register
+ *
+ * External Smarty methods register/unregister
+ *
+ * @package Smarty
+ * @author Uwe Tews
+ */
+
+/**
+ * Class for register/unregister methods
+ */
+class Smarty_Internal_Register {
+
+ function __construct($smarty)
+ {
+ $this->smarty = $smarty;
+ }
+ /**
+ * Registers plugin to be used in templates
+ *
+ * @param string $type plugin type
+ * @param string $tag name of template tag
+ * @param callback $callback PHP callback to register
+ * @param boolean $cacheable if true (default) this fuction is cachable
+ * @param array $cache_attr caching attributes if any
+ */
+
+ public function registerPlugin($type, $tag, $callback, $cacheable = true, $cache_attr = null)
+ {
+ if (isset($this->smarty->registered_plugins[$type][$tag])) {
+ throw new Exception("Plugin tag \"{$tag}\" already registered");
+ } elseif (!is_callable($callback)) {
+ throw new Exception("Plugin \"{$tag}\" not callable");
+ } else {
+ $this->smarty->registered_plugins[$type][$tag] = array($callback, (bool) $cacheable, (array) $cache_attr);
+ }
+ }
+
+ /**
+ * Unregister Plugin
+ *
+ * @param string $type of plugin
+ * @param string $tag name of plugin
+ */
+ function unregisterPlugin($type, $tag)
+ {
+ if (isset($this->smarty->registered_plugins[$type][$tag])) {
+ unset($this->smarty->registered_plugins[$type][$tag]);
+ }
+ }
+
+ /**
+ * Registers a resource to fetch a template
+ *
+ * @param string $type name of resource type
+ * @param array $callback array of callbacks to handle resource
+ */
+ public function registerResource($type, $callback)
+ {
+ $this->smarty->registered_resources[$type] = array($callback, false);
+ }
+
+ /**
+ * Unregisters a resource
+ *
+ * @param string $type name of resource type
+ */
+ function unregisterResource($type)
+ {
+ if (isset($this->smarty->registered_resources[$type])) {
+ unset($this->smarty->registered_resources[$type]);
+ }
+ }
+
+
+ /**
+ * 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 mixed $ null | array $allowed list of allowed methods (empty = all)
+ * @param boolean $smarty_args smarty argument format, else traditional
+ * @param mixed $ null | array $block_functs list of methods that are block format
+ */
+ function registerObject($object_name, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array())
+ {
+ // test if allowed methodes callable
+ if (!empty($allowed)) {
+ foreach ((array)$allowed as $method) {
+ if (!is_callable(array($object_impl, $method))) {
+ throw new SmartyException("Undefined method '$method' in registered object");
+ }
+ }
+ }
+ // test if block methodes callable
+ if (!empty($block_methods)) {
+ foreach ((array)$block_methods as $method) {
+ if (!is_callable(array($object_impl, $method))) {
+ throw new SmartyException("Undefined method '$method' in registered object");
+ }
+ }
+ }
+ // register the object
+ $this->smarty->registered_objects[$object_name] =
+ array($object_impl, (array)$allowed, (boolean)$smarty_args, (array)$block_methods);
+ }
+
+ /**
+ * Registers static classes to be used in templates
+ *
+ * @param string $class name of template class
+ * @param string $class_impl the referenced PHP class to register
+ */
+ function registerClass($class_name, $class_impl)
+ {
+ // test if exists
+ if (!class_exists($class_impl)) {
+ throw new SmartyException("Undefined class '$class_impl' in register template class");
+ }
+ // register the class
+ $this->smarty->registered_classes[$class_name] = $class_impl;
+ }
+
+ /**
+ * Registers a default plugin handler
+ *
+ * @param $callback mixed string | array $plugin class/methode name
+ */
+ function registerDefaultPluginHandler($callback)
+ {
+ if (is_callable($callback)) {
+ $this->smarty->default_plugin_handler_func = $callback;
+ } else {
+ throw new SmartyException("Default plugin handler '$callback' not callable");
+ }
+ }
+
+ /**
+ * Registers a default template handler
+ *
+ * @param $callback mixed string | array class/method name
+ */
+ function registerDefaultTemplateHandler($callback)
+ {
+ if (is_callable($callback)) {
+ $this->smarty->default_template_handler_func = $callback;
+ } else {
+ throw new SmartyException("Default template handler '$callback' not callable");
+ }
+ }
+
+}
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_resource_eval.php b/gosa-core/include/smarty/sysplugins/smarty_internal_resource_eval.php
--- /dev/null
@@ -0,0 +1,89 @@
+<?php\r
+\r
+/**\r
+ * Smarty Internal Plugin Resource Eval\r
+ * \r
+ * Implements the strings as resource for Smarty template\r
+ * \r
+ * @package Smarty\r
+ * @subpackage TemplateResources\r
+ * @author Uwe Tews \r
+ */\r
+ \r
+/**\r
+ * Smarty Internal Plugin Resource Eval\r
+ */\r
+class Smarty_Internal_Resource_Eval {\r
+ public function __construct($smarty)\r
+ {\r
+ $this->smarty = $smarty;\r
+ } \r
+ // classes used for compiling Smarty templates from file resource\r
+ public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler';\r
+ public $template_lexer_class = 'Smarty_Internal_Templatelexer';\r
+ public $template_parser_class = 'Smarty_Internal_Templateparser';\r
+ // properties\r
+ public $usesCompiler = true;\r
+ public $isEvaluated = true;\r
+\r
+ /**\r
+ * Return flag if template source is existing\r
+ * \r
+ * @return boolean true\r
+ */\r
+ public function isExisting($template)\r
+ {\r
+ return true;\r
+ } \r
+\r
+ /**\r
+ * Get filepath to template source\r
+ * \r
+ * @param object $_template template object\r
+ * @return string return 'string' as template source is not a file\r
+ */\r
+ public function getTemplateFilepath($_template)\r
+ { \r
+ // no filepath for evaluated strings\r
+ // return "string" for compiler error messages\r
+ return 'eval:';\r
+ } \r
+\r
+ /**\r
+ * Get timestamp to template source\r
+ * \r
+ * @param object $_template template object\r
+ * @return boolean false as string resources have no timestamp\r
+ */\r
+ public function getTemplateTimestamp($_template)\r
+ { \r
+ // evaluated strings must always be compiled and have no timestamp\r
+ return false;\r
+ } \r
+\r
+ /**\r
+ * Retuen template source from resource name\r
+ * \r
+ * @param object $_template template object\r
+ * @return string content of template source\r
+ */\r
+ public function getTemplateSource($_template)\r
+ { \r
+ // return template string\r
+ $_template->template_source = $_template->resource_name;\r
+ return true;\r
+ } \r
+\r
+ /**\r
+ * Get filepath to compiled template\r
+ * \r
+ * @param object $_template template object\r
+ * @return boolean return false as compiled template is not stored\r
+ */\r
+ public function getCompiledFilepath($_template)\r
+ { \r
+ // no filepath for strings\r
+ return false;\r
+ } \r
+} \r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_resource_extends.php b/gosa-core/include/smarty/sysplugins/smarty_internal_resource_extends.php
index b796de775cb64f2e7fb1f92aca664260bbd79139..7f972c691ae34a06d4d90dc25e28c64b351c5d3b 100644 (file)
<?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
+ *
+ * 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
-*/
+ * Smarty Internal Plugin Resource Extends
+ */
class Smarty_Internal_Resource_Extends {
public function __construct($smarty)
{
public $allFilepaths = array();
/**
- * Return flag if template source is existing
- *
- * @param object $_template template object
- * @return boolean result
- */
+ * Return flag if template source is existing
+ *
+ * @param object $_template template object
+ * @return boolean result
+ */
public function isExisting($_template)
{
- if ($_template->getTemplateFilepath() === false) {
+ $_template->getTemplateFilepath();
+ foreach ($this->allFilepaths as $_filepath) {
+ if ($_filepath === false) {
return false;
- } else {
- return true;
- }
+ }
+ }
+ return true;
}
/**
- * Get filepath to template source
- *
- * @param object $_template template object
- * @return string filepath to template source file
- */
+ * Get filepath to template source
+ *
+ * @param object $_template template object
+ * @return string filepath to template source file
+ */
public function getTemplateFilepath($_template)
{
$sha1String = '';
foreach ($_files as $_file) {
$_filepath = $_template->buildTemplateFilepath ($_file);
if ($_filepath !== false) {
- if ($_template->security) {
- $_template->smarty->security_handler->isTrustedResourceDir($_filepath);
- }
+ if (is_object($_template->smarty->security_policy)) {
+ $_template->smarty->security_policy->isTrustedResourceDir($_filepath);
+ }
}
$sha1String .= $_filepath;
- $this->allFilepaths[] = $_filepath;
+ $this->allFilepaths[$_file] = $_filepath;
}
$_template->templateUid = sha1($sha1String);
return $_filepath;
}
/**
- * Get timestamp to template source
- *
- * @param object $_template template object
- * @return integer timestamp of template source file
- */
+ * 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
- */
+ * 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 = array_reverse($this->allFilepaths);
- foreach ($_files as $_filepath) {
+ $_first = reset($_files);
+ $_last = end($_files);
+ foreach ($_files as $_file => $_filepath) {
+ if ($_filepath === false) {
+ throw new SmartyException("Unable to load template 'file : {$_file}'");
+ }
// read template file
- if ($_filepath === false) {
- throw new Exception("Unable to load template 'file : {$_file}'");
- }
- if ($_filepath != $_files[0]) {
- $_template->properties['file_dependency'][sha1($_filepath)] = array($_filepath, filemtime($_filepath));
+ if ($_filepath != $_first) {
+ $_template->properties['file_dependency'][sha1($_filepath)] = array($_filepath, filemtime($_filepath),'file');
}
$_template->template_filepath = $_filepath;
$_content = file_get_contents($_filepath);
- if ($_filepath != $_files[count($_files)-1]) {
- if (preg_match_all("!({$this->_ldl}block(.+?){$this->_rdl})!", $_content, $_open, PREG_OFFSET_CAPTURE) !=
- preg_match_all("!({$this->_ldl}/block(.*?){$this->_rdl})!", $_content, $_close, PREG_OFFSET_CAPTURE)) {
- $this->smarty->trigger_error('unmatched {block} {/block} pairs');
+ if ($_filepath != $_last) {
+ if (preg_match_all("!({$this->_ldl}block\s(.+?){$this->_rdl})!", $_content, $_open) !=
+ preg_match_all("!({$this->_ldl}/block{$this->_rdl})!", $_content, $_close)) {
+ throw new SmartyException("unmatched {block} {/block} pairs in file '$_filepath'");
}
- $_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], $_filepath);
+ preg_match_all("!{$this->_ldl}block\s(.+?){$this->_rdl}|{$this->_ldl}/block{$this->_rdl}!", $_content, $_result, PREG_OFFSET_CAPTURE);
+ $_result_count = count($_result[0]);
+ $_start = 0;
+ while ($_start < $_result_count) {
+ $_end = 0;
+ $_level = 1;
+ while ($_level != 0) {
+ $_end++;
+ if (!strpos($_result[0][$_start + $_end][0], '/')) {
+ $_level++;
+ } else {
+ $_level--;
+ }
+ }
+ $_block_content = str_replace($this->smarty->left_delimiter . '$smarty.block.parent' . $this->smarty->right_delimiter, '%%%%SMARTY_PARENT%%%%',
+ substr($_content, $_result[0][$_start][1] + strlen($_result[0][$_start][0]), $_result[0][$_start + $_end][1] - $_result[0][$_start][1] - + strlen($_result[0][$_start][0])));
+ Smarty_Internal_Compile_Block::saveBlockData($_block_content, $_result[0][$_start][0], $_template, $_filepath);
+ $_start = $_start + $_end + 1;
}
} else {
$_template->template_source = $_content;
return true;
}
}
- // $_template->template_filepath = $saved_filepath;
- }
- protected function saveBlockData($block_content, $block_tag, $_filepath)
- {
- if (0 == preg_match("!(.?)(name=)(.*?)(?=(\s|{$this->_rdl}))!", $block_tag, $_match)) {
- $this->smarty->trigger_error("'{$block_tag}' missing name attribute");
- } else {
- $_name = trim($_match[3], '\'"');
- if (isset($this->smarty->block_data[$_name])) {
- if (strpos($this->smarty->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) {
- $this->smarty->block_data[$_name]['source'] =
- str_replace('%%%%SMARTY_PARENT%%%%', $block_content, $this->smarty->block_data[$_name]['source']);
- } elseif ($this->smarty->block_data[$_name]['mode'] == 'prepend') {
- $this->smarty->block_data[$_name]['source'] .= $block_content;
- } elseif ($this->smarty->block_data[$_name]['mode'] == 'append') {
- $this->smarty->block_data[$_name]['source'] = $block_content . $this->smarty->block_data[$_name]['source'];
- }
- } else {
- $this->smarty->block_data[$_name]['source'] = $block_content;
- }
- if (preg_match('/(.?)(append)(.*)/', $block_tag, $_match) != 0) {
- $this->smarty->block_data[$_name]['mode'] = 'append';
- } elseif (preg_match('/(.?)(prepend)(.*)/', $block_tag, $_match) != 0) {
- $this->smarty->block_data[$_name]['mode'] = 'prepend';
- } else {
- $this->smarty->block_data[$_name]['mode'] = 'replace';
- }
- $this->smarty->block_data[$_name]['file'] = $_filepath;
- }
- }
+ }
+
/**
- * Get filepath to compiled template
- *
- * @param object $_template template object
- * @return string return path to compiled template
- */
+ * 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;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_resource_file.php b/gosa-core/include/smarty/sysplugins/smarty_internal_resource_file.php
index b84f5807308ecadacc387183596211ffa2fb206e..79decc599686b23da614804bf4a736133bcd7d12 100644 (file)
<?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
-*/
+ * 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)
{
public $isEvaluated = false;
/**
- * Return flag if template source is existing
- *
- * @return boolean true
- */
+ * Return flag if template source is existing
+ *
+ * @return boolean true
+ */
public function isExisting($template)
{
if ($template->getTemplateFilepath() === false) {
}
/**
- * Get filepath to template source
- *
- * @param object $_template template object
- * @return string filepath to template source file
- */
+ * 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);
+ if (is_object($_template->smarty->security_policy)) {
+ $_template->smarty->security_policy->isTrustedResourceDir($_filepath);
}
}
$_template->templateUid = sha1($_filepath);
}
/**
- * Get timestamp to template source
- *
- * @param object $_template template object
- * @return integer timestamp of template source file
- */
+ * 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
- */
+ * 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());
+ if (file_exists($_tfp = $_template->getTemplateFilepath())) {
+ $_template->template_source = file_get_contents($_tfp);
return true;
} else {
return false;
}
/**
- * Get filepath to compiled template
- *
- * @param object $_template template object
- * @return string return path to compiled template
- */
+ * 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;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_resource_php.php b/gosa-core/include/smarty/sysplugins/smarty_internal_resource_php.php
index 93176c34d36a2aff21e2079ae1a5482dd22fa376..16c77446e5a3ab821a90311462663ea7efcb94c1 100644 (file)
<?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
+ *
+ * Implements the file system as resource for PHP templates
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Resource PHP
-*/
+ * Smarty Internal Plugin Resource PHP
+ */
class Smarty_Internal_Resource_PHP {
/**
- * Class constructor, enable short open tags
- */
+ * Class constructor, enable short open tags
+ */
public function __construct($smarty)
{
$this->smarty = $smarty;
public $isEvaluated = false;
/**
- * Return flag if template source is existing
- *
- * @return boolean true
- */
+ * Return flag if template source is existing
+ *
+ * @return boolean true
+ */
public function isExisting($template)
{
if ($template->getTemplateFilepath() === false) {
}
/**
- * Get filepath to template source
- *
- * @param object $_template template object
- * @return string filepath to template source file
- */
+ * 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);
+ if (is_object($_template->smarty->security_policy)) {
+ $_template->smarty->security_policy->isTrustedResourceDir($_filepath);
}
$_template->templateUid = sha1($_filepath);
return $_filepath;
}
/**
- * Get timestamp to template source
- *
- * @param object $_template template object
- * @return integer timestamp of template source file
- */
+ * 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
- */
+ * 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());
+ if (file_exists($_tfp = $_template->getTemplateFilepath())) {
+ $_template->template_source = file_get_contents($_tfp);
return true;
} else {
return false;
}
}
-
/**
- * Get filepath to compiled template
- *
- * @param object $_template template object
- * @return boolean return false as compiled template is not stored
- */
+ * 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
}
/**
- * renders the PHP template
- */
+ * renders the PHP template
+ */
public function renderUncompiled($_smarty_template)
{
if (!$this->smarty->allow_php_templates) {
- throw new Exception("PHP templates are disabled");
+ throw new SmartyException("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}\"");
+ throw new SmartyException("Unable to load template \"{$_smarty_template->resource_type} : {$_smarty_template->resource_name}\"");
}
// prepare variables
$_smarty_ptr = $_smarty_template;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_resource_registered.php b/gosa-core/include/smarty/sysplugins/smarty_internal_resource_registered.php
index 36a09cdc0a94cb65abc1c46a6cb7e46c1474b4bc..467da11a839b72ca5924b57d6f848d76869a179d 100644 (file)
<?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
+ *
+ * Implements the registered resource for Smarty template
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Resource Registered
-*/
-
+ * Smarty Internal Plugin Resource Registered
+ */
class Smarty_Internal_Resource_Registered {
- public function __construct($smarty)
+ public function __construct($template, $resource_type = null)
{
- $this->smarty = $smarty;
+ $this->smarty = $template->smarty;
+ if (isset($resource_type)) {
+ $template->smarty->registerResource($resource_type,
+ array("smarty_resource_{$resource_type}_source",
+ "smarty_resource_{$resource_type}_timestamp",
+ "smarty_resource_{$resource_type}_secure",
+ "smarty_resource_{$resource_type}_trusted"));
+ }
}
// classes used for compiling Smarty templates from file resource
public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler';
public $isEvaluated = false;
/**
- * Return flag if template source is existing
- *
- * @return boolean true
- */
+ * Return flag if template source is existing
+ *
+ * @return boolean true
+ */
public function isExisting($_template)
{
- if (is_integer($this->getTemplateTimestamp($_template))) {
+ if (is_integer($_template->getTemplateTimestamp())) {
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
- */
+ * 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;
+ $_filepath = $_template->resource_type .':'.$_template->resource_name;
$_template->templateUid = sha1($_filepath);
return $_filepath;
- }
+ }
/**
- * Get timestamp to template source
- *
- * @param object $_template template object
- * @return boolean false as string resources have no timestamp
- */
+ * Get timestamp of template source
+ *
+ * @param object $_template template object
+ * @return int timestamp
+ */
public function getTemplateTimestamp($_template)
{
// return timestamp
$time_stamp = false;
- call_user_func_array($this->smarty->_plugins['resource'][$_template->resource_type][0][1],
+ call_user_func_array($this->smarty->registered_resources[$_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
- */
+ * Get timestamp of template source by type and name
+ *
+ * @param object $_template template object
+ * @return int 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],
+ call_user_func_array($this->smarty->registered_resources[$_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
- */
+ * 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],
+ return call_user_func_array($this->smarty->registered_resources[$_template->resource_type][0][0],
array($_template->resource_name, &$_template->template_source, $this->smarty));
}
/**
- * Get filepath to compiled template
- *
- * @param object $_template template object
- * @return boolean return false as compiled template is not stored
- */
+ * 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;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_resource_stream.php b/gosa-core/include/smarty/sysplugins/smarty_internal_resource_stream.php
index 2024a3a78ba930e08fa3fba869fb4171a35b8a9f..1878002bf50a03fa7c81b2b2d6a1fb6b60ab2674 100644 (file)
/**
* Smarty Internal Plugin Resource Stream
-*
+*
* Implements the streams as resource for Smarty template
-*
+*
* @package Smarty
* @subpackage TemplateResources
-* @author Uwe Tews
+* @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';
/**
* Return flag if template source is existing
- *
+ *
* @return boolean true
*/
public function isExisting($template)
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;
- }
+ if ($fp = fopen(str_replace(':', '://', $_template->template_resource),'r+')) {
+ while (!feof($fp) && ($current_line = fgets($fp)) !== false ) {
+ $_template->template_source .= $current_line;
+ }
+ fclose($fp);
+ return true;
+ } else {
+ 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 strings
return false;
- }
-}
+ }
+}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_resource_string.php b/gosa-core/include/smarty/sysplugins/smarty_internal_resource_string.php
index ad519b3886728ebc9b907203c0c76727361df28e..9368f0406289469bad9f1e77c9b78e34ecef366f 100644 (file)
<?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
+ *
+ * Implements the strings as resource for Smarty template
+ *
+ * @package Smarty
+ * @subpackage TemplateResources
+ * @author Uwe Tews
+ */
+
/**
-* Smarty Internal Plugin Resource String
-*/
-
+ * Smarty Internal Plugin Resource String
+ */
class Smarty_Internal_Resource_String {
public function __construct($smarty)
{
public $template_parser_class = 'Smarty_Internal_Templateparser';
// properties
public $usesCompiler = true;
- public $isEvaluated = true;
+ public $isEvaluated = false;
/**
- * Return flag if template source is existing
- *
- * @return boolean true
- */
+ * 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
- */
+ * 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)
{
+ $_template->templateUid = sha1($_template->resource_name);
// no filepath for strings
// return "string" for compiler error messages
- return 'string';
+ return 'string:';
}
/**
- * Get timestamp to template source
- *
- * @param object $_template template object
- * @return boolean false as string resources have no timestamp
- */
+ * 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;
+ if ($this->isEvaluated) {
+ //must always be compiled and have no timestamp
+ return false;
+ } else {
+ return 0;
+ }
}
/**
- * Retuen template source from resource name
- *
- * @param object $_template template object
- * @return string content of template source
- */
+ * Get timestamp of template source by type and name
+ *
+ * @param object $_template template object
+ * @return int timestamp (always 0)
+ */
+ public function getTemplateTimestampTypeName($_resource_type, $_resource_name)
+ {
+ // return timestamp 0
+ return 0;
+ }
+
+
+ /**
+ * Retuen template source from resource name
+ *
+ * @param object $_template template object
+ * @return string content of template source
+ */
public function getTemplateSource($_template)
{
// return template string
}
/**
- * Get filepath to compiled template
- *
- * @param object $_template template object
- * @return boolean return false as compiled template is not stored
- */
+ * 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;
+ {
+ $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w\|]+!', '_', $_template->compile_id) : null;
+ // calculate Uid if not already done
+ if ($_template->templateUid == '') {
+ $_template->getTemplateFilepath();
+ }
+ $_filepath = $_template->templateUid;
+ // 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 . $_cache . '.php';
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php b/gosa-core/include/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php
index 2246f035c86cca494180729b0fdcd0b21c2a18d5..dcc89c6736a473c78cc23e199d9a7e27f1164b8c 100644 (file)
<?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
-*/
+ * 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
+ */
+
+require_once("smarty_internal_parsetree.php");
+
/**
-* Class SmartyTemplateCompiler
-*/
+ * Class SmartyTemplateCompiler
+ */
class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCompilerBase {
+ // array of vars which can be compiled in local scope
+ public $local_var = array();
/**
- * Initialize compiler
- */
+ * Initialize compiler
+ */
public function __construct($lexer_class, $parser_class, $smarty)
{
$this->smarty = $smarty;
@@ -26,11 +31,11 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom
}
/**
- * Methode to compile a Smarty template
- *
- * @param $_content template source
- * @return bool true if compiling succeeded, false if it failed
- */
+ * 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
@@ -38,11 +43,11 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom
then written to compiled files. */
// init the lexer/parser to compile the template
$this->lex = new $this->lexer_class($_content, $this);
- $this->parser = new $this->parser_class($this->lex, $this);
- if (isset($this->smarty->_parserdebug)) $this->parser->PrintTrace();
+ $this->parser = new $this->parser_class($this->lex, $this);
+ if (isset($this->smarty->_parserdebug)) $this->parser->PrintTrace();
// get tokens from lexer and parse them
while ($this->lex->yylex() && !$this->abort_and_recompile) {
- if (isset($this->smarty->_parserdebug)) echo "<pre>Line {$this->lex->line} Parsing {$this->parser->yyTokenName[$this->lex->token]} Token ".htmlentities($this->lex->value)."</pre>";
+ if (isset($this->smarty->_parserdebug)) echo "<pre>Line {$this->lex->line} Parsing {$this->parser->yyTokenName[$this->lex->token]} Token " . htmlentities($this->lex->value) . "</pre>";
$this->parser->doParse($this->lex->token, $this->lex->value);
}
@@ -58,16 +63,10 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom
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('',''), $this->parser->retvalue);
- return $this->parser->retvalue;
- } else {
- // compilation error
- return false;
- }
+ // return compiled code
+ // return str_replace(array("? >\n<?php","? ><?php"), array('',''), $this->parser->retvalue);
+ return $this->parser->retvalue;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_template.php b/gosa-core/include/smarty/sysplugins/smarty_internal_template.php
index fab9d0847c8e0de20e90f076b857f585b89e5c13..480fbee650f5f0dddb1141194498e85a7def3be0 100644 (file)
<?php
/**
-* Smarty Internal Plugin Template
-*
-* This file contains the Smarty template engine
-*
-* @package Smarty
-* @subpackage Templates
-* @author Uwe Tews
-*/
+ * 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
-*/
+ * Main class with template data structures and methods
+ */
class Smarty_Internal_Template extends Smarty_Internal_Data {
// object cache
public $compiler_object = null;
- public $cacher_object = null;
+ public $cacher_object = null;
// Smarty parameter
public $cache_id = null;
public $compile_id = null;
public $cache_lifetime = null;
public $cacher_class = null;
public $caching_type = null;
- public $force_compile = null;
- public $forceNocache = false;
+ public $forceNocache = false;
// Template resource
public $template_resource = null;
public $resource_type = null;
public $resource_name = null;
- public $resource_object = null;
+// public $resource_object = null;
private $isExisting = null;
public $templateUid = '';
// Template source
public $template_filepath = null;
public $template_source = null;
- private $template_timestamp = null;
+ private $template_timestamp = null;
// Compiled template
private $compiled_filepath = null;
public $compiled_template = null;
public $mustCompile = null;
public $suppressHeader = false;
public $suppressFileDependency = false;
- public $extract_code = false;
- public $extracted_compiled_code = '';
- public $has_nocache_code = false;
+ public $has_nocache_code = false;
+ public $write_compiled_code = true;
// Rendered content
- public $rendered_content = null;
+ public $rendered_content = null;
// Cache file
private $cached_filepath = null;
public $cached_timestamp = null;
private $isCached = null;
- private $cache_resource_object = null;
- private $cacheFileChecked = false;
+// private $cache_resource_object = null;
+ private $cacheFileChecked = false;
// template variables
public $tpl_vars = array();
public $parent = null;
- public $config_vars = array();
+ public $config_vars = array();
// storage for plugin
- public $plugin_data = array();
+ public $plugin_data = array();
// special properties
public $properties = array ('file_dependency' => array(),
'nocache_hash' => '',
- 'function' => array());
- // storage for block data
- public $block_data = array();
+ 'function' => array());
// required plugins
- public $required_plugins = array('compiled' => array(), 'cache' => array());
-
+ public $required_plugins = array('compiled' => array(), 'nocache' => array());
+ public $saved_modifier = null;
+ public $smarty = null;
+ // blocks for template inheritance
+ public $block_data = array();
+ public $wrapper = null;
/**
- * 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
- */
+ * 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, $_caching = null, $_cache_lifetime = null)
{
- $this->smarty = &$smarty;
+ $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 = $_caching === null ? $this->smarty->caching : $_caching;
- if ($this->caching === true) $this->caching = SMARTY_CACHING_LIFETIME_CURRENT;
+ if ($this->caching === true) $this->caching = Smarty::CACHING_LIFETIME_CURRENT;
$this->cache_lifetime = $_cache_lifetime === null ?$this->smarty->cache_lifetime : $_cache_lifetime;
- $this->force_cache = $this->smarty->force_cache;
- $this->security = $this->smarty->security;
- $this->parent = $_parent;
+ $this->parent = $_parent;
// dummy local smarty variable
- $this->tpl_vars['smarty'] = new 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->resource_object->isEvaluated && ($this->caching == SMARTY_CACHING_LIFETIME_CURRENT || $this->caching == SMARTY_CACHING_LIFETIME_SAVED)) {
- $this->cache_resource_object = $this->smarty->loadCacheResource();
- }
- }
+ $this->template_resource = $template_resource;
+ // copy block data of template inheritance
+ if ($this->parent instanceof Smarty_Internal_Template) {
+ $this->block_data = $this->parent->block_data;
+ }
+
+ }
/**
- * Returns the template filepath
- *
- * The template filepath is determined by the actual resource handler
- *
- * @return string the template filepath
- */
+ * 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
- */
+ * 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
- */
+ * 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}'");
- }
- }
+ throw new SmartyException("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
- */
+ * 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}'");
- }
+ throw new SmartyException("Unable to load template {$this->resource_type} '{$this->resource_name}'");
+ }
return $this->isExisting;
- }
+ }
/**
- * 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
- */
+ * 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->resource_object->usesCompiler && ($this->force_compile || $this->resource_object->isEvaluated || $this->getCompiledTimestamp () === false ||
+ $this->mustCompile = ($this->resource_object->usesCompiler && ($this->smarty->force_compile || $this->resource_object->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
- */
+ * Returns the compiled template filepath
+ *
+ * @return string the template filepath
+ */
public function getCompiledFilepath ()
{
return $this->compiled_filepath === null ?
($this->compiled_filepath = !$this->resource_object->isEvaluated ? $this->resource_object->getCompiledFilepath($this) : false) :
$this->compiled_filepath;
- }
+ }
/**
- * Returns the timpestamp of the compiled template
- *
- * @return integer the template timestamp
- */
+ * Returns the timpestamp of the compiled template
+ *
+ * @return integer the template timestamp
+ */
public function getCompiledTimestamp ()
{
return $this->compiled_timestamp === null ?
($this->compiled_timestamp = (!$this->resource_object->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
- */
+ * 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) {
} else {
if ($this->compiled_template === null) {
$this->compiled_template = !$this->resource_object->isEvaluated && $this->resource_object->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
- */
+ * Compiles the template
+ *
+ * If the template is not evaluated the compiled template is saved on disk
+ */
public function compileTemplateSource ()
{
if (!$this->resource_object->isEvaluated) {
$this->properties['file_dependency'] = array();
- $this->properties['file_dependency'][$this->templateUid] = array($this->getTemplateFilepath(), $this->getTemplateTimestamp());
- }
+ $this->properties['file_dependency'][$this->templateUid] = array($this->getTemplateFilepath(), $this->getTemplateTimestamp(),$this->resource_type);
+ }
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);
- }
+ }
+ // compile locking
+ if ($this->smarty->compile_locking && !$this->resource_object->isEvaluated) {
+ if ($saved_timestamp = $this->getCompiledTimestamp()) {
+ touch($this->getCompiledFilepath());
+ }
+ }
// call compiler
- if ($this->compiler_object->compileTemplate($this)) {
- // compiling succeded
- if (!$this->resource_object->isEvaluated) {
- // write compiled template
- Smarty_Internal_Write_File::writeFile($this->getCompiledFilepath(), $this->compiled_template, $this->smarty);
- }
- } else {
- // error compiling template
- throw new Exception("Error compiling template {$this->getTemplateFilepath ()}");
- return false;
- }
+ try {
+ $this->compiler_object->compileTemplate($this);
+ }
+ catch (Exception $e) {
+ // restore old timestamp in case of error
+ if ($this->smarty->compile_locking && !$this->resource_object->isEvaluated && $saved_timestamp) {
+ touch($this->getCompiledFilepath(), $saved_timestamp);
+ }
+ throw $e;
+ }
+ // compiling succeded
+ if (!$this->resource_object->isEvaluated && $this->write_compiled_code) {
+ // write compiled template
+ Smarty_Internal_Write_File::writeFile($this->getCompiledFilepath(), $this->compiled_template, $this->smarty);
+ }
if ($this->smarty->debugging) {
Smarty_Internal_Debug::end_compile($this);
- }
- }
+ }
+ // release objects to free memory
+ Smarty_Internal_TemplateCompilerBase::$_tag_objects = array();
+ unset($this->compiler_object->parser->root_buffer,
+ $this->compiler_object->parser->current_buffer,
+ $this->compiler_object->parser,
+ $this->compiler_object->lex,
+ $this->compiler_object->template
+ );
+ $this->compiler_object = null;
+ }
/**
- * Returns the filepath of the cached template output
- *
- * The filepath is determined by the actual cache resource
- *
- * @return string the cache filepath
- */
+ * Returns the filepath of the cached template output
+ *
+ * The filepath is determined by the actual cache resource
+ *
+ * @return string the cache filepath
+ */
public function getCachedFilepath ()
{
return $this->cached_filepath === null ?
- $this->cached_filepath = ($this->resource_object->isEvaluated || !($this->caching == SMARTY_CACHING_LIFETIME_CURRENT || $this->caching == SMARTY_CACHING_LIFETIME_SAVED)) ? false : $this->cache_resource_object->getCachedFilepath($this) :
+ $this->cached_filepath = ($this->resource_object->isEvaluated || !($this->caching == Smarty::CACHING_LIFETIME_CURRENT || $this->caching == Smarty::CACHING_LIFETIME_SAVED)) ? 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 cache resource
- *
- * @return integer the template timestamp
- */
+ * Returns the timpestamp of the cached template output
+ *
+ * The timestamp is determined by the actual cache resource
+ *
+ * @return integer the template timestamp
+ */
public function getCachedTimestamp ()
{
return $this->cached_timestamp === null ?
- $this->cached_timestamp = ($this->resource_object->isEvaluated || !($this->caching == SMARTY_CACHING_LIFETIME_CURRENT || $this->caching == SMARTY_CACHING_LIFETIME_SAVED)) ? false : $this->cache_resource_object->getCachedTimestamp($this) :
+ $this->cached_timestamp = ($this->resource_object->isEvaluated || !($this->caching == Smarty::CACHING_LIFETIME_CURRENT || $this->caching == Smarty::CACHING_LIFETIME_SAVED)) ? 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
- */
+ * 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->resource_object->isEvaluated || !($this->caching == SMARTY_CACHING_LIFETIME_CURRENT || $this->caching == SMARTY_CACHING_LIFETIME_SAVED)) ? false : $this->cache_resource_object->getCachedContents($this) :
+ $this->rendered_content = ($this->resource_object->isEvaluated || !($this->caching == Smarty::CACHING_LIFETIME_CURRENT || $this->caching == Smarty::CACHING_LIFETIME_SAVED)) ? false : $this->cache_resource_object->getCachedContents($this) :
$this->rendered_content;
- }
+ }
/**
- * Writes the cached template output
- */
+ * Writes the cached template output
+ */
public function writeCachedContent ($content)
{
- if ($this->resource_object->isEvaluated || !($this->caching == SMARTY_CACHING_LIFETIME_CURRENT || $this->caching == SMARTY_CACHING_LIFETIME_SAVED)) {
+ if ($this->resource_object->isEvaluated || !($this->caching == Smarty::CACHING_LIFETIME_CURRENT || $this->caching == Smarty::CACHING_LIFETIME_SAVED)) {
// don't write cache file
return false;
- }
+ }
$this->properties['cache_lifetime'] = $this->cache_lifetime;
- return $this->cache_resource_object->writeCachedContent($this, $this->createPropertyHeader(true) . $content);
- }
+ return $this->cache_resource_object->writeCachedContent($this, $this->createPropertyHeader(true) .$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 ()
+ * 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 ($template = null, $cache_id = null, $compile_id = null, $parent = null)
{
+ if ($template === null) {
+ $no_render = true;
+ } elseif ($template === false) {
+ $no_render = false;
+ } else {
+ if ($parent === null) {
+ $parent = $this;
+ }
+ $this->smarty->isCached ($template, $cache_id, $compile_id, $parent);
+ }
if ($this->isCached === null) {
$this->isCached = false;
- if (($this->caching == SMARTY_CACHING_LIFETIME_CURRENT || $this->caching == SMARTY_CACHING_LIFETIME_SAVED) && !$this->resource_object->isEvaluated && !$this->force_compile && !$this->force_cache) {
+ if (($this->caching == Smarty::CACHING_LIFETIME_CURRENT || $this->caching == Smarty::CACHING_LIFETIME_SAVED) && !$this->resource_object->isEvaluated) {
$cachedTimestamp = $this->getCachedTimestamp();
- if ($cachedTimestamp === false) {
+ if ($cachedTimestamp === false || $this->smarty->force_compile || $this->smarty->force_cache) {
return $this->isCached;
- }
- if ($this->caching === SMARTY_CACHING_LIFETIME_SAVED || ($this->caching == SMARTY_CACHING_LIFETIME_CURRENT && (time() <= ($cachedTimestamp + $this->cache_lifetime) || $this->cache_lifetime < 0))) {
+ }
+ if ($this->caching === Smarty::CACHING_LIFETIME_SAVED || ($this->caching == Smarty::CACHING_LIFETIME_CURRENT && (time() <= ($cachedTimestamp + $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);
+ }
+ $this->rendered_content = $this->cache_resource_object->getCachedContents($this, $no_render);
if ($this->smarty->debugging) {
Smarty_Internal_Debug::end_cache($this);
- }
+ }
if ($this->cacheFileChecked) {
$this->isCached = true;
return $this->isCached;
- }
+ }
$this->cacheFileChecked = true;
- if ($this->caching === SMARTY_CACHING_LIFETIME_SAVED && $this->properties['cache_lifetime'] > 0 && (time() > ($this->getCachedTimestamp() + $this->properties['cache_lifetime']))) {
+ if ($this->caching === Smarty::CACHING_LIFETIME_SAVED && $this->properties['cache_lifetime'] >= 0 && (time() > ($this->getCachedTimestamp() + $this->properties['cache_lifetime']))) {
+ $this->tpl_vars = array();
+ $this->tpl_vars['smarty'] = new Smarty_Variable;
$this->rendered_content = null;
return $this->isCached;
- }
+ }
if (!empty($this->properties['file_dependency']) && $this->smarty->compile_check) {
+ $resource_type = null;
+ $resource_name = null;
foreach ($this->properties['file_dependency'] as $_file_to_check) {
- $this->getResourceTypeName($_file_to_check[0], $resource_type, $resource_name);
- If ($resource_type == 'file') {
+ If ($_file_to_check[2] == 'file' || $_file_to_check[2] == 'extends' || $_file_to_check[2] == 'php') {
$mtime = filemtime($_file_to_check[0]);
} else {
+ $this->getResourceTypeName($_file_to_check[0], $resource_type, $resource_name);
$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->tpl_vars = array();
+ $this->tpl_vars['smarty'] = new Smarty_Variable;
$this->rendered_content = null;
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
- */
+ * 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->resource_object->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->resource_object->isEvaluated) {
eval("?>" . $this->compiled_template);
} else {
- include($this->getCompiledFilepath ());
+ include($this->getCompiledFilepath ());
// check file dependencies at compiled code
if ($this->smarty->compile_check) {
if (!empty($this->properties['file_dependency'])) {
$this->mustCompile = false;
+ $resource_type = null;
+ $resource_name = null;
foreach ($this->properties['file_dependency'] as $_file_to_check) {
- $this->getResourceTypeName($_file_to_check[0], $resource_type, $resource_name);
- If ($resource_type == 'file') {
+ If ($_file_to_check[2] == 'file' || $_file_to_check[2] == 'extends' || $_file_to_check[2] == 'php') {
$mtime = filemtime($_file_to_check[0]);
} else {
+ $this->getResourceTypeName($_file_to_check[0], $resource_type, $resource_name);
$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->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");
- }
- }
+ throw new SmartyException("Resource '$this->resource_type' must have 'renderUncompiled' methode");
+ }
+ }
$this->rendered_content = ob_get_clean();
if (!$this->resource_object->isEvaluated && empty($this->properties['file_dependency'][$this->templateUid])) {
- $this->properties['file_dependency'][$this->templateUid] = array($this->getTemplateFilepath(), $this->getTemplateTimestamp());
- }
- if ($this->parent instanceof Smarty_Template or $this->parent instanceof Smarty_Internal_Template) {
+ $this->properties['file_dependency'][$this->templateUid] = array($this->getTemplateFilepath(), $this->getTemplateTimestamp(),$this->resource_type);
+ }
+ if ($this->parent instanceof Smarty_Internal_Template) {
$this->parent->properties['file_dependency'] = array_merge($this->parent->properties['file_dependency'], $this->properties['file_dependency']);
- $this->parent->required_plugins['compiled'] = array_merge($this->parent->required_plugins['compiled'], $this->required_plugins['compiled']);
- $this->parent->required_plugins['cache'] = array_merge($this->parent->required_plugins['cache'], $this->required_plugins['cache']);
- }
+ foreach($this->required_plugins as $code => $tmp1) {
+ foreach($tmp1 as $name => $tmp) {
+ foreach($tmp as $type => $data) {
+ $this->parent->required_plugins[$code][$name][$type] = $data;
+ }
+ }
+ }
+ }
if ($this->smarty->debugging) {
Smarty_Internal_Debug::end_render($this);
- }
+ }
// write to cache when nessecary
- if (!$this->resource_object->isEvaluated && ($this->caching == SMARTY_CACHING_LIFETIME_SAVED || $this->caching == SMARTY_CACHING_LIFETIME_CURRENT)) {
+ if (!$this->resource_object->isEvaluated && ($this->caching == Smarty::CACHING_LIFETIME_SAVED || $this->caching == Smarty::CACHING_LIFETIME_CURRENT)) {
if ($this->smarty->debugging) {
Smarty_Internal_Debug::start_cache($this);
- }
- $this->properties['has_nocache_code'] = false;
+ }
+ $this->properties['has_nocache_code'] = false;
// get text between non-cached items
- $cache_split = preg_split("!/\*%%SmartyNocache:{$this->properties['nocache_hash']}%%\*\/(.+?)/\*/%%SmartyNocache:{$this->properties['nocache_hash']}%%\*/!s", $this->rendered_content);
+ $cache_split = preg_split("!/\*%%SmartyNocache:{$this->properties['nocache_hash']}%%\*\/(.+?)/\*/%%SmartyNocache:{$this->properties['nocache_hash']}%%\*/!s", $this->rendered_content);
// get non-cached items
preg_match_all("!/\*%%SmartyNocache:{$this->properties['nocache_hash']}%%\*\/(.+?)/\*/%%SmartyNocache:{$this->properties['nocache_hash']}%%\*/!s", $this->rendered_content, $cache_parts);
- $output = '';
+ $output = '';
// loop over items, stitch back together
foreach($cache_split as $curr_idx => $curr_split) {
// escape PHP tags in template content
$output .= preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '<?php echo \'$1\'; ?>', $curr_split);
if (isset($cache_parts[0][$curr_idx])) {
- $this->properties['has_nocache_code'] = true;
+ $this->properties['has_nocache_code'] = true;
// remove nocache tags from cache output
$output .= preg_replace("!/\*/?%%SmartyNocache:{$this->properties['nocache_hash']}%%\*/!", '', $cache_parts[0][$curr_idx]);
- }
- }
+ }
+ }
+ if (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output'])) {
+ $output = Smarty_Internal_Filter_Handler::runFilter('output', $output, $this);
+ }
// rendering (must be done before writing cache file because of {function} nocache handling)
$_smarty_tpl = $this;
ob_start();
eval("?>" . $output);
- $this->rendered_content = ob_get_clean();
+ $this->rendered_content = ob_get_clean();
// write cache file content
- $this->writeCachedContent($output);
+ $this->writeCachedContent('<?php if (!$no_render) {?>'. $output. '<?php } ?>');
if ($this->smarty->debugging) {
Smarty_Internal_Debug::end_cache($this);
- }
+ }
} else {
// var_dump('renderTemplate', $this->has_nocache_code, $this->template_resource, $this->properties['nocache_hash'], $this->parent->properties['nocache_hash'], $this->rendered_content);
if ($this->has_nocache_code && !empty($this->properties['nocache_hash']) && !empty($this->parent->properties['nocache_hash'])) {
// replace nocache_hash
$this->rendered_content = preg_replace("/{$this->properties['nocache_hash']}/", $this->parent->properties['nocache_hash'], $this->rendered_content);
$this->parent->has_nocache_code = $this->has_nocache_code;
- }
- }
- }
+ }
+ }
+ }
/**
- * 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
- */
+ * 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->resource_object->isEvaluated) {
$this->caching = false;
- }
+ }
// checks if template exists
- $this->isExisting(true);
+ $this->isExisting(true);
// read from cache or render
- if ($this->rendered_content === null && !$this->isCached()) {
+ if ($this->rendered_content === null) {
+ if ($this->isCached) {
+ if ($this->smarty->debugging) {
+ Smarty_Internal_Debug::start_cache($this);
+ }
+ $this->rendered_content = $this->cache_resource_object->getCachedContents($this, false);
+ if ($this->smarty->debugging) {
+ Smarty_Internal_Debug::end_cache($this);
+ }
+ }
+ if ($this->isCached === null) {
+ $this->isCached(false);
+ }
+ if (!$this->isCached) {
// render template (not loaded and not in cache)
$this->renderTemplate();
- }
+ }
+ }
$this->updateParentVariables();
$this->isCached = null;
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
- */
+ * 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);
+ $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[crc32($this->template_resource . $this->cache_id . $this->compile_id)] = $this;
- }
+ // do not cache eval resources
+ if ($resource_type != 'eval') {
+ $this->smarty->template_objects[sha1($this->template_resource . $this->cache_id . $this->compile_id)] = $this;
+ }
return true;
- }
+ }
/**
- * get system filepath to template
- */
+ * 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;
+ }
+ // relative file name?
+ if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $file)) {
+ 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 (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_template_dir)) {
+ // try PHP include_path
+ if (($_filepath = Smarty_Internal_Get_Include_Path::getIncludePath($_filepath)) !== false) {
+ return $_filepath;
+ }
+ }
+ }
+ }
+ // try absolute 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");
+ throw new SmartyException("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));
return $_return;
} elseif ($_return === true) {
return $file;
- }
- }
- }
- // throw new Exception("Unable to load template \"{$file}\"");
+ }
+ }
+ }
return false;
- }
+ }
/**
- * Update Smarty variables in other scopes
- */
- public function updateParentVariables ($scope = SMARTY_LOCAL_SCOPE)
+ * Update Smarty variables in other scopes
+ */
+ public function updateParentVariables ($scope = Smarty::SCOPE_LOCAL)
{
$has_root = false;
foreach ($this->tpl_vars as $_key => $_variable) {
$_variable_scope = $this->tpl_vars[$_key]->scope;
- if ($scope == SMARTY_LOCAL_SCOPE && $_variable_scope == SMARTY_LOCAL_SCOPE) {
+ if ($scope == Smarty::SCOPE_LOCAL && $_variable_scope == Smarty::SCOPE_LOCAL) {
continue;
- }
- if (isset($this->parent) && ($scope == SMARTY_PARENT_SCOPE || $_variable_scope == SMARTY_PARENT_SCOPE)) {
+ }
+ if (isset($this->parent) && ($scope == Smarty::SCOPE_PARENT || $_variable_scope == Smarty::SCOPE_PARENT)) {
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 || $_variable_scope == SMARTY_ROOT_SCOPE) {
+ $this->parent->tpl_vars[$_key]->scope = Smarty::SCOPE_LOCAL;
+ }
+ }
+ if ($scope == Smarty::SCOPE_ROOT || $_variable_scope == Smarty::SCOPE_ROOT) {
if ($this->parent == null) {
continue;
- }
+ }
if (!$has_root) {
// find root
$root_ptr = $this;
while ($root_ptr->parent != null) {
$root_ptr = $root_ptr->parent;
$has_root = true;
- }
- }
+ }
+ }
if (isset($root_ptr->tpl_vars[$_key])) {
// variable is already defined in root, copy value
$root_ptr->tpl_vars[$_key]->value = $this->tpl_vars[$_key]->value;
} else {
// create variable in root
$root_ptr->tpl_vars[$_key] = clone $_variable;
- $root_ptr->tpl_vars[$_key]->scope = SMARTY_LOCAL_SCOPE;
- }
- }
- if ($scope == SMARTY_GLOBAL_SCOPE || $_variable_scope == SMARTY_GLOBAL_SCOPE) {
- if (isset($this->smarty->global_tpl_vars[$_key])) {
+ $root_ptr->tpl_vars[$_key]->scope = Smarty::SCOPE_LOCAL;
+ }
+ }
+ if ($scope == Smarty::SCOPE_GLOBAL || $_variable_scope == Smarty::SCOPE_GLOBAL) {
+ if (isset(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;
+ 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;
- }
- }
- }
+ // create global variable
+ Smarty::$global_tpl_vars[$_key] = clone $_variable;
+ }
+ Smarty::$global_tpl_vars[$_key]->scope = Smarty::SCOPE_LOCAL;
+ }
+ }
+ }
/**
- * 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)
+ * 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
+ */
+ protected function getResourceTypeName ($template_resource, &$resource_type, &$resource_name)
{
if (strpos($template_resource, ':') === false) {
// no resource given, use default
// 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 template resource handler by type
+ *
+ * @param string $resource_type template resource type
+ * @return object resource handler object
+ */
+ protected function loadTemplateResourceHandler ($resource_type)
+ {
// try registered resource
- if (isset($this->smarty->_plugins['resource'][$resource_type])) {
- return new Smarty_Internal_Resource_Registered($this->smarty);
+ if (isset($this->smarty->registered_resources[$resource_type])) {
+ return new Smarty_Internal_Resource_Registered($this);
} else {
// try sysplugins dir
- if (in_array($resource_type, array('file', 'string', 'extends', 'php', 'registered', 'stream'))) {
- $_resource_class = 'Smarty_Internal_Resource_' . $resource_type;
+ if (in_array($resource_type, array('file', 'string', 'extends', 'php', 'stream', 'eval'))) {
+ $_resource_class = 'Smarty_Internal_Resource_' . ucfirst($resource_type);
return new $_resource_class($this->smarty);
} else {
// try plugins dir
- $_resource_class = 'Smarty_Resource_' . $resource_type;
+ $_resource_class = 'Smarty_Resource_' . ucfirst($resource_type);
if ($this->smarty->loadPlugin($_resource_class)) {
if (class_exists($_resource_class, false)) {
return 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 new Smarty_Internal_Resource_Registered($this->smarty);
- }
+ return new Smarty_Internal_Resource_Registered($this, $resource_type);
+ }
} 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);
- }
+ if (is_object($this->smarty->security_policy)) {
+ $this->smarty->security_policy->isTrustedStream($resource_type);
+ }
return new Smarty_Internal_Resource_Stream($this->smarty);
} else {
- throw new Exception('Unkown resource type \'' . $resource_type . '\'');
- }
- }
- }
- }
- }
+ throw new SmartyException('Unkown resource type \'' . $resource_type . '\'');
+ }
+ }
+ }
+ }
+ }
/**
- * Create property header
- */
+ * Create property header
+ */
public function createPropertyHeader ($cache = false)
{
- $plugins_string = '';
+ $plugins_string = '';
// include code for plugins
if (!$cache) {
if (!empty($this->required_plugins['compiled'])) {
$plugins_string = '<?php ';
- foreach($this->required_plugins['compiled'] as $plugin_name => $data) {
- $plugin = 'smarty_' . $data['type'] . '_' . $plugin_name;
- $plugins_string .= "if (!is_callable('{$plugin}')) include '{$data['file']}';\n";
- }
+ foreach($this->required_plugins['compiled'] as $tmp) {
+ foreach($tmp as $data) {
+ $plugins_string .= "if (!is_callable('{$data['function']}')) include '{$data['file']}';\n";
+ }
+ }
$plugins_string .= '?>';
- }
- if (!empty($this->required_plugins['cache'])) {
+ }
+ if (!empty($this->required_plugins['nocache'])) {
$this->has_nocache_code = true;
$plugins_string .= "<?php echo '/*%%SmartyNocache:{$this->properties['nocache_hash']}%%*/<?php ";
- foreach($this->required_plugins['cache'] as $plugin_name => $data) {
- $plugin = 'smarty_' . $data['type'] . '_' . $plugin_name;
- $plugins_string .= "if (!is_callable(\'{$plugin}\')) include \'{$data['file']}\';\n";
- }
+ foreach($this->required_plugins['nocache'] as $tmp) {
+ foreach($tmp as $data) {
+ $plugins_string .= "if (!is_callable(\'{$data['function']}\')) include \'{$data['file']}\';\n";
+ }
+ }
$plugins_string .= "?>/*/%%SmartyNocache:{$this->properties['nocache_hash']}%%*/';?>\n";
- }
- }
+ }
+ }
// build property code
$this->properties['has_nocache_code'] = $this->has_nocache_code;
$properties_string = "<?php /*%%SmartyHeaderCode:{$this->properties['nocache_hash']}%%*/" ;
if ($this->smarty->direct_access_security) {
$properties_string .= "if(!defined('SMARTY_DIR')) exit('no direct access allowed');\n";
- }
+ }
if ($cache) {
// remove compiled code of{function} definition
unset($this->properties['function']);
if (isset($function_data['called_nocache'])) {
unset($function_data['called_nocache'], $this->smarty->template_functions[$name]['called_nocache']);
$this->properties['function'][$name] = $function_data;
- }
- }
- }
- }
+ }
+ }
+ }
+ }
$properties_string .= "\$_smarty_tpl->decodeProperties(" . var_export($this->properties, true) . "); /*/%%SmartyHeaderCode%%*/?>\n";
return $properties_string . $plugins_string;
- }
+ }
/**
- * Decode saved properties from compiled template and cache files
- */
+ * Decode saved properties from compiled template and cache files
+ */
public function decodeProperties ($properties)
{
$this->has_nocache_code = $properties['has_nocache_code'];
$this->properties['nocache_hash'] = $properties['nocache_hash'];
if (isset($properties['cache_lifetime'])) {
$this->properties['cache_lifetime'] = $properties['cache_lifetime'];
- }
+ }
if (isset($properties['file_dependency'])) {
$this->properties['file_dependency'] = array_merge($this->properties['file_dependency'], $properties['file_dependency']);
- }
+ }
if (!empty($properties['function'])) {
$this->properties['function'] = array_merge($this->properties['function'], $properties['function']);
$this->smarty->template_functions = array_merge($this->smarty->template_functions, $properties['function']);
- }
- }
+ }
+ }
/**
- * wrapper for display
- */
- public function display ()
+ * creates a local Smarty variable for array assignments
+ */
+ public function createLocalArrayVariable($tpl_var, $nocache = false, $scope = Smarty::SCOPE_LOCAL)
{
- return $this->smarty->display($this);
- }
+ 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(array(), $nocache, $scope);
+ } else {
+ $this->tpl_vars[$tpl_var] = clone $tpl_var_inst;
+ if ($scope != Smarty::SCOPE_LOCAL) {
+ $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');
+ }
+ }
/**
- * wrapper for fetch
- */
- public function fetch ()
+ * [util function] counts an array, arrayaccess/traversable or PDOStatement object
+ * @param mixed $value
+ * @return int the count for arrays and objects that implement countable, 1 for other objects that don't, and 0 for empty elements
+ */
+ public function _count($value)
{
- return $this->smarty->fetch($this);
- }
+ if (is_array($value) === true || $value instanceof Countable) {
+ return count($value);
+ } elseif ($value instanceof Iterator) {
+ $value->rewind();
+ if ($value->valid()) {
+ return iterator_count($value);
+ }
+ } elseif ($value instanceof PDOStatement) {
+ return $value->rowCount();
+ } elseif ($value instanceof Traversable) {
+ return iterator_count($value);
+ } elseif ($value instanceof ArrayAccess) {
+ if ($value->offsetExists(0)) {
+ return 1;
+ }
+ } elseif (is_object($value)) {
+ return count($value);
+ }
+ return 0;
+ }
+
/**
- * wrapper for is_cached
- */
- public function is_cached ()
+ * wrapper for fetch
+ */
+ public function fetch ($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false)
{
- return $this->iscached($this);
- }
-}
+ if ($template == null) {
+ return $this->smarty->fetch($this);
+ } else {
+ if (!isset($parent)) {
+ $parent = $this;
+ }
+ return $this->smarty->fetch($template, $cache_id, $compile_id, $parent, $display);
+ }
-/**
-* wrapper for template class
-*/
-class Smarty_Template extends Smarty_Internal_Template {
-}
+ }
+
+ /**
+ * wrapper for display
+ */
+ public function display ($template = null, $cache_id = null, $compile_id = null, $parent = null)
+ {
+ if ($template == null) {
+ return $this->smarty->display($this);
+ } else {
+ if (!isset($parent)) {
+ $parent = $this;
+ }
+ return $this->smarty->display($template, $cache_id, $compile_id, $parent);
+ }
+
+ }
+
+ /**
+ * set Smarty property in template context
+ * @param string $property_name property name
+ * @param mixed $value value
+ */
+ public function __set($property_name, $value)
+ {
+ if ($property_name == 'resource_object' || $property_name == 'cache_resource_object') {
+ $this->$property_name = $value;
+ } elseif (property_exists($this->smarty, $property_name)) {
+ $this->smarty->$property_name = $value;
+ } else {
+ throw new SmartyException("invalid template property '$property_name'.");
+ }
+ }
+
+ /**
+ * get Smarty property in template context
+ * @param string $property_name property name
+ */
+ public function __get($property_name)
+ {
+ if ($property_name == 'resource_object') {
+ // load template resource
+ $this->resource_object = null;
+ if (!$this->parseResourceName ($this->template_resource, $this->resource_type, $this->resource_name, $this->resource_object)) {
+ throw new SmartyException ("Unable to parse resource name \"{$this->template_resource}\"");
+ }
+ return $this->resource_object;
+ }
+ if ($property_name == 'cache_resource_object') {
+ // load cache resource
+ $this->cache_resource_object = $this->loadCacheResource();
+ return $this->cache_resource_object;
+ }
+ if (property_exists($this->smarty, $property_name)) {
+ return $this->smarty->$property_name;
+ } else {
+ throw new SmartyException("template property '$property_name' does not exist.");
+ }
+ }
+
+
+ /**
+ * 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)
+ {
+ static $camel_func;
+ if (!isset($camel_func))
+ $camel_func = create_function('$c', 'return "_" . strtolower($c[1]);');
+ // see if this is a set/get for a property
+ $first3 = strtolower(substr($name, 0, 3));
+ if (in_array($first3, array('set', 'get')) && substr($name, 3, 1) !== '_') {
+ // try to keep case correct for future PHP 6.0 case-sensitive class methods
+ // lcfirst() not available < PHP 5.3.0, so improvise
+ $property_name = strtolower(substr($name, 3, 1)) . substr($name, 4);
+ // convert camel case to underscored name
+ $property_name = preg_replace_callback('/([A-Z])/', $camel_func, $property_name);
+ if (property_exists($this, $property_name)) {
+ if ($first3 == 'get')
+ return $this->$property_name;
+ else
+ return $this->$property_name = $args[0];
+ }
+ }
+ // Smarty Backward Compatible wrapper
+ if (strpos($name,'_') !== false) {
+ if (!isset($this->wrapper)) {
+ $this->wrapper = new Smarty_Internal_Wrapper($this);
+ }
+ return $this->wrapper->convert($name, $args);
+ }
+ // pass call to Smarty object
+ return call_user_func_array(array($this->smarty,$name),$args);
+ }
-?>
+}
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_templatecompilerbase.php b/gosa-core/include/smarty/sysplugins/smarty_internal_templatecompilerbase.php
index 68e3efd99fcc7c24c1cbb9bc68b0644cc9150678..b8b341e74c1abd363001d61902612dc652dbb45e 100644 (file)
<?php\r
/**\r
-* Smarty Internal Plugin Smarty Template Compiler Base\r
-* \r
-* This file contains the basic classes and methodes for compiling Smarty templates with lexer/parser\r
-* \r
-* @package Smarty\r
-* @subpackage Compiler\r
-* @author Uwe Tews \r
-*/\r
+ * Smarty Internal Plugin Smarty Template Compiler Base\r
+ *\r
+ * This file contains the basic classes and methodes for compiling Smarty templates with lexer/parser\r
+ *\r
+ * @package Smarty\r
+ * @subpackage Compiler\r
+ * @author Uwe Tews\r
+ */\r
+\r
/**\r
-* Main compiler class\r
-*/\r
+ * Main compiler class\r
+ */\r
class Smarty_Internal_TemplateCompilerBase {\r
// hash for nocache sections\r
- private $nocache_hash = null; \r
+ private $nocache_hash = null;\r
// suppress generation of nocache code\r
public $suppressNocacheProcessing = false;\r
// compile tag objects\r
- static $_tag_objects = array(); \r
+ static $_tag_objects = array();\r
// tag stack\r
- public $_tag_stack = array(); \r
+ public $_tag_stack = array();\r
// current template\r
- public $template = null; \r
- // required plugins\r
- public $required_plugins_call = array(); \r
+ public $template = null;\r
+ // optional log of tag/attributes\r
+ public $used_tags = array();\r
\r
/**\r
- * Initialize compiler\r
- */\r
+ * Initialize compiler\r
+ */\r
public function __construct()\r
{\r
$this->nocache_hash = str_replace('.', '-', uniqid(rand(), true));\r
- } \r
- // abstract function doCompile($_content);\r
+ }\r
+\r
/**\r
- * Methode to compile a Smarty template\r
- * \r
- * @param $template template object to compile\r
- * @return bool true if compiling succeeded, false if it failed\r
- */\r
+ * Methode to compile a Smarty template\r
+ *\r
+ * @param $template template object to compile\r
+ * @return bool true if compiling succeeded, false if it failed\r
+ */\r
public function compileTemplate($template)\r
{\r
if (empty($template->properties['nocache_hash'])) {\r
$template->properties['nocache_hash'] = $this->nocache_hash;\r
} else {\r
$this->nocache_hash = $template->properties['nocache_hash'];\r
- } \r
- /* here is where the compiling takes place. Smarty\r
- tags in the templates are replaces with PHP code,\r
- then written to compiled files. */\r
+ }\r
// flag for nochache sections\r
$this->nocache = false;\r
- $this->tag_nocache = false; \r
- // assume successfull compiling\r
- $this->compile_error = false; \r
+ $this->tag_nocache = false;\r
// save template object in compiler class\r
$this->template = $template;\r
- $this->smarty->_current_file = $this->template->getTemplateFilepath(); \r
+ $this->smarty->_current_file = $saved_filepath = $this->template->getTemplateFilepath();\r
// template header code\r
$template_header = '';\r
if (!$template->suppressHeader) {\r
$template_header .= "<?php /* Smarty version " . Smarty::SMARTY_VERSION . ", created on " . strftime("%Y-%m-%d %H:%M:%S") . "\n";\r
$template_header .= " compiled from \"" . $this->template->getTemplateFilepath() . "\" */ ?>\n";\r
- } \r
+ }\r
\r
do {\r
// flag for aborting current and start recompile\r
- $this->abort_and_recompile = false; \r
+ $this->abort_and_recompile = false;\r
// get template source\r
- $_content = $template->getTemplateSource(); \r
+ $_content = $template->getTemplateSource();\r
// run prefilter if required\r
if (isset($this->smarty->autoload_filters['pre']) || isset($this->smarty->registered_filters['pre'])) {\r
- $_content = Smarty_Internal_Filter_Handler::runFilter('pre', $_content, $this->smarty);\r
- } \r
+ $template->template_source = $_content = Smarty_Internal_Filter_Handler::runFilter('pre', $_content, $template);\r
+ }\r
// on empty template just return header\r
if ($_content == '') {\r
if ($template->suppressFileDependency) {\r
$template->compiled_template = '';\r
} else {\r
$template->compiled_template = $template_header . $template->createPropertyHeader();\r
- } \r
+ }\r
return true;\r
- } \r
+ }\r
// call compiler\r
$_compiled_code = $this->doCompile($_content);\r
} while ($this->abort_and_recompile);\r
- if (!$this->compile_error) {\r
- // return compiled code to template object\r
- if ($template->suppressFileDependency) {\r
- $template->compiled_template = $_compiled_code;\r
- } else {\r
- $template->compiled_template = $template_header . $template->createPropertyHeader() . $_compiled_code;\r
- } \r
- // run postfilter if required\r
- if (isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) {\r
- $template->compiled_template = Smarty_Internal_Filter_Handler::runFilter('post', $template->compiled_template, $this->smarty);\r
- } \r
- return true;\r
+ // restore original filepath which could have been modified by template inheritance\r
+ $this->template->template_filepath = $saved_filepath;\r
+ // return compiled code to template object\r
+ if ($template->suppressFileDependency) {\r
+ $template->compiled_template = $_compiled_code;\r
} else {\r
- // compilation error\r
- return false;\r
- } \r
- } \r
+ $template->compiled_template = $template_header . $template->createPropertyHeader() . $_compiled_code;\r
+ }\r
+ // run postfilter if required\r
+ if (isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) {\r
+ $template->compiled_template = Smarty_Internal_Filter_Handler::runFilter('post', $template->compiled_template, $template);\r
+ }\r
+ }\r
\r
/**\r
- * Compile Tag\r
- * \r
- * This is a call back from the lexer/parser\r
- * It executes the required compile plugin for the Smarty tag\r
- * \r
- * @param string $tag tag name\r
- * @param array $args array with tag attributes\r
- * @return string compiled code\r
- */\r
- public function compileTag($tag, $args)\r
- { \r
+ * Compile Tag\r
+ *\r
+ * This is a call back from the lexer/parser\r
+ * It executes the required compile plugin for the Smarty tag\r
+ *\r
+ * @param string $tag tag name\r
+ * @param array $args array with tag attributes\r
+ * @param array $parameter array with compilation parameter\r
+ * @return string compiled code\r
+ */\r
+ public function compileTag($tag, $args, $parameter = array())\r
+ {\r
// $args contains the attributes parsed and compiled by the lexer/parser\r
// assume that tag does compile into code, but creates no HTML output\r
$this->has_code = true;\r
- $this->has_output = false; \r
+ $this->has_output = false;\r
+ // log tag/attributes\r
+ if (isset($this->smarty->get_used_tags) && $this->smarty->get_used_tags) {\r
+ $this->used_tags[] = array($tag,$args);\r
+ }\r
+ // check nocache option flag\r
+ if (in_array("'nocache'",$args) || in_array(array('nocache'=>'true'),$args)\r
+ || in_array(array('nocache'=>'"true"'),$args) || in_array(array('nocache'=>"'true'"),$args)) {\r
+ $this->tag_nocache = true;\r
+ }\r
// compile the smarty tag (required compile classes to compile the tag are autoloaded)\r
- if (($_output = $this->callTagCompiler($tag, $args)) === false) {\r
+ if (($_output = $this->callTagCompiler($tag, $args, $parameter)) === false) {\r
if (isset($this->smarty->template_functions[$tag])) {\r
// template defined by {template} tag\r
- $args['name'] = "'" . $tag . "'";\r
- $_output = $this->callTagCompiler('call', $args);\r
- } \r
- } \r
+ $args['_attr']['name'] = "'" . $tag . "'";\r
+ $_output = $this->callTagCompiler('call', $args, $parameter);\r
+ }\r
+ }\r
if ($_output !== false) {\r
if ($_output !== true) {\r
// did we get compiled code\r
// Does it create output?\r
if ($this->has_output) {\r
$_output .= "\n";\r
- } \r
+ }\r
// return compiled code\r
return $_output;\r
- } \r
- } \r
+ }\r
+ }\r
// tag did not produce compiled code\r
return '';\r
} else {\r
+ // map_named attributes\r
+ if (isset($args['_attr'])) {\r
+ foreach ($args['_attr'] as $key => $attribute) {\r
+ if (is_array($attribute)) {\r
+ $args = array_merge($args, $attribute);\r
+ }\r
+ }\r
+ }\r
// not an internal compiler tag\r
- if (strlen($tag) < 6 || substr_compare($tag, 'close', -5, 5) != 0) {\r
+ if (strlen($tag) < 6 || substr($tag, -5) != 'close') {\r
// check if tag is a registered object\r
- if (isset($this->smarty->registered_objects[$tag]) && isset($args['object_methode'])) {\r
- $methode = $args['object_methode'];\r
- unset ($args['object_methode']);\r
+ if (isset($this->smarty->registered_objects[$tag]) && isset($parameter['object_methode'])) {\r
+ $methode = $parameter['object_methode'];\r
if (!in_array($methode, $this->smarty->registered_objects[$tag][3]) &&\r
(empty($this->smarty->registered_objects[$tag][1]) || in_array($methode, $this->smarty->registered_objects[$tag][1]))) {\r
- return $this->callTagCompiler('private_object_function', $args, $tag, $methode);\r
+ return $this->callTagCompiler('private_object_function', $args, $parameter, $tag, $methode);\r
} elseif (in_array($methode, $this->smarty->registered_objects[$tag][3])) {\r
- return $this->callTagCompiler('private_object_block_function', $args, $tag, $methode);\r
+ return $this->callTagCompiler('private_object_block_function', $args, $parameter, $tag, $methode);\r
} else {\r
return $this->trigger_template_error ('unallowed methode "' . $methode . '" in registered object "' . $tag . '"', $this->lex->taglineno);\r
- } \r
- } \r
+ }\r
+ }\r
// check if tag is registered\r
- foreach (array('compiler', 'function', 'block') as $type) {\r
+ foreach (array(Smarty::PLUGIN_COMPILER, Smarty::PLUGIN_FUNCTION, Smarty::PLUGIN_BLOCK) as $type) {\r
if (isset($this->smarty->registered_plugins[$type][$tag])) {\r
// if compiler function plugin call it now\r
- if ($type == 'compiler') {\r
+ if ($type == Smarty::PLUGIN_COMPILER) {\r
+ $new_args = array();\r
+ foreach ($args as $key => $mixed) {\r
+ if (is_array($mixed)) {\r
+ $new_args = array_merge($new_args, $mixed);\r
+ } else {\r
+ $new_args[$key] = $mixed;\r
+ }\r
+ }\r
if (!$this->smarty->registered_plugins[$type][$tag][1]) {\r
$this->tag_nocache = true;\r
- } \r
- return call_user_func_array($this->smarty->registered_plugins[$type][$tag][0], array($args, $this));\r
- } \r
+ }\r
+ $function = $this->smarty->registered_plugins[$type][$tag][0];\r
+ if (!is_array($function)) {\r
+ return $function($new_args, $this);\r
+ } else if (is_object($function[0])) {\r
+ return $this->smarty->registered_plugins[$type][$tag][0][0]->$function[1]($new_args, $this);\r
+ } else {\r
+ return call_user_func_array($this->smarty->registered_plugins[$type][$tag][0], array($new_args, $this));\r
+ }\r
+ }\r
// compile registered function or block function\r
- if ($type == 'function' || $type == 'block') {\r
- return $this->callTagCompiler('private_registered_' . $type, $args, $tag);\r
- } \r
- } \r
- } \r
+ if ($type == Smarty::PLUGIN_FUNCTION || $type == Smarty::PLUGIN_BLOCK) {\r
+ return $this->callTagCompiler('private_registered_' . $type, $args, $parameter, $tag);\r
+ }\r
+ }\r
+ }\r
// check plugins from plugins folder\r
foreach ($this->smarty->plugin_search_order as $plugin_type) {\r
- if ($plugin_type == 'compiler' && $this->smarty->loadPlugin('smarty_compiler_' . $tag)) {\r
+ if ($plugin_type == Smarty::PLUGIN_BLOCK && $this->smarty->loadPlugin('smarty_compiler_' . $tag)) {\r
$plugin = 'smarty_compiler_' . $tag;\r
- if (class_exists($plugin, false)) {\r
- $plugin = array(new $plugin, 'compile');\r
- } \r
if (is_callable($plugin)) {\r
- return call_user_func_array($plugin, array($args, $this));\r
- } else {\r
- throw new Exception("Plugin \"{$tag}\" not callable");\r
- } \r
+ // convert arguments format for old compiler plugins\r
+ $new_args = array();\r
+ foreach ($args as $key => $mixed) {\r
+ if (is_array($mixed)) {\r
+ $new_args = array_merge($new_args, $mixed);\r
+ } else {\r
+ $new_args[$key] = $mixed;\r
+ }\r
+ }\r
+ return $plugin($new_args, $this->smarty);\r
+ }\r
+ if (class_exists($plugin, false)) {\r
+ $plugin_object = new $plugin;\r
+ if (method_exists($plugin_object, 'compile')) {\r
+ return $plugin_object->compile($args, $this);\r
+ }\r
+ }\r
+ throw new SmartyException("Plugin \"{$tag}\" not callable");\r
} else {\r
if ($function = $this->getPlugin($tag, $plugin_type)) {\r
- return $this->callTagCompiler('private_' . $plugin_type . '_plugin', $args, $tag, $function);\r
- } \r
- } \r
- } \r
+ return $this->callTagCompiler('private_' . $plugin_type . '_plugin', $args, $parameter, $tag, $function);\r
+ }\r
+ }\r
+ }\r
} else {\r
// compile closing tag of block function\r
- $base_tag = substr($tag, 0, -5); \r
+ $base_tag = substr($tag, 0, -5);\r
// check if closing tag is a registered object\r
- if (isset($this->smarty->registered_objects[$base_tag]) && isset($args['object_methode'])) {\r
- $methode = $args['object_methode'];\r
- unset ($args['object_methode']);\r
+ if (isset($this->smarty->registered_objects[$base_tag]) && isset($parameter['object_methode'])) {\r
+ $methode = $parameter['object_methode'];\r
if (in_array($methode, $this->smarty->registered_objects[$base_tag][3])) {\r
- return $this->callTagCompiler('private_object_block_function', $args, $tag, $methode);\r
+ return $this->callTagCompiler('private_object_block_function', $args, $parameter, $tag, $methode);\r
} else {\r
return $this->trigger_template_error ('unallowed closing tag methode "' . $methode . '" in registered object "' . $base_tag . '"', $this->lex->taglineno);\r
- } \r
- } \r
+ }\r
+ }\r
// registered block tag ?\r
- if (isset($this->smarty->registered_plugins['block'][$base_tag])) {\r
- return $this->callTagCompiler('private_registered_block', $args, $tag);\r
- } \r
+ if (isset($this->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$base_tag])) {\r
+ return $this->callTagCompiler('private_registered_block', $args, $parameter, $tag);\r
+ }\r
// block plugin?\r
- if ($function = $this->getPlugin($base_tag, 'block')) {\r
- return $this->callTagCompiler('private_block_plugin', $args, $tag, $function);\r
- } \r
+ if ($function = $this->getPlugin($base_tag, Smarty::PLUGIN_BLOCK)) {\r
+ return $this->callTagCompiler('private_block_plugin', $args, $parameter, $tag, $function);\r
+ }\r
if ($this->smarty->loadPlugin('smarty_compiler_' . $tag)) {\r
$plugin = 'smarty_compiler_' . $tag;\r
- if (class_exists($plugin, false)) {\r
- $plugin = array(new $plugin, 'compile');\r
- } \r
if (is_callable($plugin)) {\r
- return call_user_func_array($plugin, array($args, $this));\r
- } else {\r
- throw new Exception("Plugin \"{$tag}\" not callable");\r
- } \r
- } \r
- } \r
+ return $plugin($args, $this->smarty);\r
+ }\r
+ if (class_exists($plugin, false)) {\r
+ $plugin_object = new $plugin;\r
+ if (method_exists($plugin_object, 'compile')) {\r
+ return $plugin_object->compile($args, $this);\r
+ }\r
+ }\r
+ throw new SmartyException("Plugin \"{$tag}\" not callable");\r
+ }\r
+ }\r
$this->trigger_template_error ("unknown tag \"" . $tag . "\"", $this->lex->taglineno);\r
- } \r
- } \r
+ }\r
+ }\r
\r
/**\r
- * lazy loads internal compile plugin for tag and calls the compile methode\r
- * \r
- * compile objects cached for reuse.\r
- * class name format: Smarty_Internal_Compile_TagName\r
- * plugin filename format: Smarty_Internal_Tagname.php\r
- * \r
- * @param $tag string tag name\r
- * @param $args array with tag attributes\r
- * @param $param1 optional parameter\r
- * @param $param2 optional parameter\r
- * @param $param3 optional parameter\r
- * @return string compiled code\r
- */\r
+ * lazy loads internal compile plugin for tag and calls the compile methode\r
+ *\r
+ * compile objects cached for reuse.\r
+ * class name format: Smarty_Internal_Compile_TagName\r
+ * plugin filename format: Smarty_Internal_Tagname.php\r
+ *\r
+ * @param $tag string tag name\r
+ * @param $args array with tag attributes\r
+ * @param $param1 optional parameter\r
+ * @param $param2 optional parameter\r
+ * @param $param3 optional parameter\r
+ * @return string compiled code\r
+ */\r
public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null)\r
- { \r
+ {\r
// re-use object if already exists\r
if (isset(self::$_tag_objects[$tag])) {\r
// compile this tag\r
- return call_user_func(array(self::$_tag_objects[$tag], 'compile'), $args, $this, $param1, $param2, $param3);\r
- } \r
+ return self::$_tag_objects[$tag]->compile($args, $this, $param1, $param2, $param3);\r
+ }\r
// lazy load internal compiler plugin\r
$class_name = 'Smarty_Internal_Compile_' . $tag;\r
if ($this->smarty->loadPlugin($class_name)) {\r
// use plugin if found\r
- self::$_tag_objects[$tag] = new $class_name; \r
+ self::$_tag_objects[$tag] = new $class_name;\r
// compile this tag\r
- return call_user_func(array(self::$_tag_objects[$tag], 'compile'), $args, $this, $param1, $param2, $param3);\r
- } \r
+ return self::$_tag_objects[$tag]->compile($args, $this, $param1, $param2, $param3);\r
+ }\r
// no internal compile plugin for this tag\r
return false;\r
- } \r
+ }\r
\r
/**\r
- * Check for plugins and return function name\r
- * \r
- * @param $pugin_name string name of plugin or function\r
- * @param $type string type of plugin\r
- * @return string call name of function\r
- */\r
+ * Check for plugins and return function name\r
+ *\r
+ * @param $pugin_name string name of plugin or function\r
+ * @param $type string type of plugin\r
+ * @return string call name of function\r
+ */\r
public function getPlugin($plugin_name, $type)\r
{\r
- if (isset($this->template->required_plugins_call[$plugin_name][$type])) {\r
- if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {\r
- if (isset($this->template->required_plugins['compiled'][$plugin_name])) {\r
- $this->template->required_plugins['cache'][$plugin_name] = $this->template->required_plugins['compiled'][$plugin_name];\r
- } \r
- } else {\r
- if (isset($this->template->required_plugins['cache'][$plugin_name])) {\r
- $this->template->required_plugins['compiled'][$plugin_name] = $this->template->required_plugins['compiled'][$plugin_name];\r
- } \r
- } \r
+ $function = null;\r
+ if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {\r
+ if (isset($this->template->required_plugins['nocache'][$plugin_name][$type])) {\r
+ $function = $this->template->required_plugins['nocache'][$plugin_name][$type]['function'];\r
+ } else if (isset($this->template->required_plugins['compiled'][$plugin_name][$type])) {\r
+ $this->template->required_plugins['nocache'][$plugin_name][$type] = $this->template->required_plugins['compiled'][$plugin_name][$type];\r
+ $function = $this->template->required_plugins['nocache'][$plugin_name][$type]['function'];\r
+ }\r
+ } else {\r
+ if (isset($this->template->required_plugins['compiled'][$plugin_name][$type])) {\r
+ $function = $this->template->required_plugins['compiled'][$plugin_name][$type]['function'];\r
+ } else if (isset($this->template->required_plugins['nocache'][$plugin_name][$type])) {\r
+ $this->template->required_plugins['compiled'][$plugin_name][$type] = $this->template->required_plugins['nocache'][$plugin_name][$type];\r
+ $function = $this->template->required_plugins['compiled'][$plugin_name][$type]['function'];\r
+ }\r
+ }\r
+ if (isset($function)) {\r
if ($type == 'modifier') {\r
- $this->template->saved_modifer[$plugin_name] = true;\r
- } \r
- return $this->template->required_plugins_call[$plugin_name][$type];\r
- } \r
+ $this->template->saved_modifier[$plugin_name] = true;\r
+ }\r
+ return $function;\r
+ }\r
// loop through plugin dirs and find the plugin\r
- $plugin = 'smarty_' . $type . '_' . $plugin_name;\r
+ $function = 'smarty_' . $type . '_' . $plugin_name;\r
$found = false;\r
foreach((array)$this->smarty->plugins_dir as $_plugin_dir) {\r
$file = rtrim($_plugin_dir, '/\\') . DS . $type . '.' . $plugin_name . '.php';\r
// require_once($file);\r
$found = true;\r
break;\r
- } \r
- } \r
+ }\r
+ }\r
if ($found) {\r
- // if (is_callable($plugin)) {\r
- $this->template->required_plugins_call[$plugin_name][$type] = $plugin;\r
if ($this->template->caching && ($this->nocache || $this->tag_nocache)) {\r
- $this->template->required_plugins['cache'][$plugin_name]['file'] = $file;\r
- $this->template->required_plugins['cache'][$plugin_name]['type'] = $type;\r
+ $this->template->required_plugins['nocache'][$plugin_name][$type]['file'] = $file;\r
+ $this->template->required_plugins['nocache'][$plugin_name][$type]['function'] = $function;\r
} else {\r
- $this->template->required_plugins['compiled'][$plugin_name]['file'] = $file;\r
- $this->template->required_plugins['compiled'][$plugin_name]['type'] = $type;\r
- } \r
+ $this->template->required_plugins['compiled'][$plugin_name][$type]['file'] = $file;\r
+ $this->template->required_plugins['compiled'][$plugin_name][$type]['function'] = $function;\r
+ }\r
if ($type == 'modifier') {\r
- $this->template->saved_modifer[$plugin_name] = true;\r
- } \r
-\r
- return $plugin;\r
- } \r
- if (is_callable($plugin)) {\r
+ $this->template->saved_modifier[$plugin_name] = true;\r
+ }\r
+ return $function;\r
+ }\r
+ if (is_callable($function)) {\r
// plugin function is defined in the script\r
- return $plugin;\r
- } \r
+ return $function;\r
+ }\r
return false;\r
- } \r
+ }\r
/**\r
- * Inject inline code for nocache template sections\r
- * \r
- * This method gets the content of each template element from the parser.\r
- * If the content is compiled code and it should be not cached the code is injected\r
- * into the rendered output.\r
- * \r
- * @param string $content content of template element\r
- * @param boolean $tag_nocache true if the parser detected a nocache situation\r
- * @param boolean $is_code true if content is compiled code\r
- * @return string content\r
- */\r
+ * Inject inline code for nocache template sections\r
+ *\r
+ * This method gets the content of each template element from the parser.\r
+ * If the content is compiled code and it should be not cached the code is injected\r
+ * into the rendered output.\r
+ *\r
+ * @param string $content content of template element\r
+ * @param boolean $tag_nocache true if the parser detected a nocache situation\r
+ * @param boolean $is_code true if content is compiled code\r
+ * @return string content\r
+ */\r
public function processNocacheCode ($content, $is_code)\r
- { \r
+ {\r
// If the template is not evaluated and we have a nocache section and or a nocache tag\r
if ($is_code && !empty($content)) {\r
// generate replacement code\r
if ((!$this->template->resource_object->isEvaluated || $this->template->forceNocache) && $this->template->caching && !$this->suppressNocacheProcessing &&\r
($this->nocache || $this->tag_nocache || $this->template->forceNocache == 2)) {\r
- $this->tag_nocache = false;\r
$this->template->has_nocache_code = true;\r
$_output = str_replace("'", "\'", $content);\r
- $_output = "<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>"; \r
+ $_output = str_replace("^#^", "'", $_output);\r
+ $_output = "<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>";\r
// make sure we include modifer plugins for nocache code\r
- if (isset($this->template->saved_modifer)) {\r
- foreach ($this->template->saved_modifer as $plugin_name => $dummy) {\r
- if (isset($this->template->required_plugins['compiled'][$plugin_name])) {\r
- $this->template->required_plugins['cache'][$plugin_name] = $this->template->required_plugins['compiled'][$plugin_name];\r
- } \r
- } \r
- unset($this->template->saved_modifer);\r
- } \r
+ if (isset($this->template->saved_modifier)) {\r
+ foreach ($this->template->saved_modifier as $plugin_name => $dummy) {\r
+ if (isset($this->template->required_plugins['compiled'][$plugin_name]['modifier'])) {\r
+ $this->template->required_plugins['nocache'][$plugin_name]['modifier'] = $this->template->required_plugins['compiled'][$plugin_name]['modifier'];\r
+ }\r
+ }\r
+ $this->template->saved_modifier = null;\r
+ }\r
} else {\r
$_output = $content;\r
- } \r
+ }\r
} else {\r
$_output = $content;\r
- } \r
+ }\r
$this->suppressNocacheProcessing = false;\r
+ $this->tag_nocache = false;\r
return $_output;\r
- } \r
+ }\r
/**\r
- * display compiler error messages without dying\r
- * \r
- * If parameter $args is empty it is a parser detected syntax error.\r
- * In this case the parser is called to obtain information about expected tokens.\r
- * \r
- * If parameter $args contains a string this is used as error message\r
- * \r
- * @param $args string individual error message or null\r
- */\r
+ * display compiler error messages without dying\r
+ *\r
+ * If parameter $args is empty it is a parser detected syntax error.\r
+ * In this case the parser is called to obtain information about expected tokens.\r
+ *\r
+ * If parameter $args contains a string this is used as error message\r
+ *\r
+ * @param $args string individual error message or null\r
+ */\r
public function trigger_template_error($args = null, $line = null)\r
- { \r
+ {\r
// get template source line which has error\r
if (!isset($line)) {\r
$line = $this->lex->line;\r
- } \r
+ }\r
$match = preg_split("/\n/", $this->lex->data);\r
- $error_text = 'Syntax Error in template "' . $this->template->getTemplateFilepath() . '" on line ' . $line . ' "' . $match[$line-1] . '" ';\r
+ $error_text = 'Syntax Error in template "' . $this->template->getTemplateFilepath() . '" on line ' . $line . ' "' . htmlspecialchars(trim(preg_replace('![\t\r\n]+!',' ',$match[$line-1]))) . '" ';\r
if (isset($args)) {\r
// individual error message\r
$error_text .= $args;\r
} else {\r
// expected token from parser\r
- foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {\r
- $exp_token = $this->parser->yyTokenName[$token];\r
- if (isset($this->lex->smarty_token_names[$exp_token])) {\r
- // token type from lexer\r
- $expect[] = '"' . $this->lex->smarty_token_names[$exp_token] . '"';\r
- } else {\r
- // otherwise internal token name\r
- $expect[] = $this->parser->yyTokenName[$token];\r
- } \r
- } \r
- // output parser error message\r
- $error_text .= ' - Unexpected "' . $this->lex->value . '", expected one of: ' . implode(' , ', $expect);\r
- } \r
- throw new Exception($error_text); \r
- // set error flag\r
- $this->compile_error = true;\r
- } \r
-} \r
+ $error_text .= ' - Unexpected "' . $this->lex->value.'"';\r
+ if (count($this->parser->yy_get_expected_tokens($this->parser->yymajor)) <= 4 ) {\r
+ foreach ($this->parser->yy_get_expected_tokens($this->parser->yymajor) as $token) {\r
+ $exp_token = $this->parser->yyTokenName[$token];\r
+ if (isset($this->lex->smarty_token_names[$exp_token])) {\r
+ // token type from lexer\r
+ $expect[] = '"' . $this->lex->smarty_token_names[$exp_token] . '"';\r
+ } else {\r
+ // otherwise internal token name\r
+ $expect[] = $this->parser->yyTokenName[$token];\r
+ }\r
+ }\r
+ $error_text .= ', expected one of: ' . implode(' , ', $expect);\r
+ }\r
+ }\r
+ throw new SmartyCompilerException($error_text);\r
+ }\r
+}\r
\r
-?>\r
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_templatelexer.php b/gosa-core/include/smarty/sysplugins/smarty_internal_templatelexer.php
index fb259847f071831f746ac144310f36e8d40a5645..09bd67a302b6b8abad2f75a8adedc01396b12b80 100644 (file)
/**
* Smarty Internal Plugin Templatelexer
*
-* This is the lexer to break the template source into tokens
+* This is the lexer to break the template source into tokens
* @package Smarty
* @subpackage Compiler
-* @author Uwe Tews
+* @author Uwe Tews
*/
/**
* Smarty Internal Plugin Templatelexer
'QMARK' => '"?"',
'ID' => 'identifier',
'OTHER' => 'text',
+ 'LINEBREAK' => 'newline',
'FAKEPHPSTARTTAG' => 'Fake PHP start tag',
'PHPSTARTTAG' => 'PHP start tag',
'PHPENDTAG' => 'PHP end tag',
'LITERALEND' => 'literal close',
'AS' => 'as',
'TO' => 'to',
- 'NULL' => 'null',
- 'BOOLEAN' => 'boolean'
);
-
-
+
+
function __construct($data,$compiler)
{
- // set instance object
- self::instance($this);
- $this->data = preg_replace("/(\r\n|\r|\n)/", "\n", $data);
+// $this->data = preg_replace("/(\r\n|\r|\n)/", "\n", $data);
+ $this->data = $data;
$this->counter = 0;
$this->line = 1;
$this->smarty = $compiler->smarty;
$this->compiler = $compiler;
- $this->ldel = preg_quote($this->smarty->left_delimiter,'/');
+ $this->ldel = preg_quote($this->smarty->left_delimiter,'/');
+ $this->ldel_length = strlen($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;
{
$tokenMap = array (
1 => 0,
- 2 => 1,
- 4 => 0,
+ 2 => 0,
+ 3 => 1,
5 => 0,
6 => 0,
7 => 0,
9 => 0,
10 => 0,
11 => 0,
- 12 => 0,
- 13 => 2,
+ 12 => 1,
+ 14 => 0,
+ 15 => 0,
16 => 0,
+ 17 => 0,
+ 18 => 0,
+ 19 => 0,
+ 20 => 0,
+ 21 => 0,
+ 22 => 0,
+ 23 => 2,
+ 26 => 0,
+ 27 => 0,
);
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
- $yy_global_pattern = "/^(\\{\\})|^(".$this->ldel."\\*([\S\s]*?)\\*".$this->rdel.")|^(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|^([\t ]*[\r\n]+[\t ]*)|^(".$this->ldel."strip".$this->rdel.")|^(".$this->ldel."\/strip".$this->rdel.")|^(".$this->ldel."literal".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(([\S\s]*?)([\t ]*[\r\n]+[\t ]*|".$this->ldel."|<\\?))|^([\S\s]+)/";
+ $yy_global_pattern = "/^(".$this->ldel."[$]smarty\\.block\\.child".$this->rdel.")|^(\\{\\})|^(".$this->ldel."\\*([\S\s]*?)\\*".$this->rdel.")|^([\t ]*[\r\n]+[\t ]*)|^(".$this->ldel."strip".$this->rdel.")|^(".$this->ldel."\\s{1,}strip\\s{1,}".$this->rdel.")|^(".$this->ldel."\/strip".$this->rdel.")|^(".$this->ldel."\\s{1,}\/strip\\s{1,}".$this->rdel.")|^(".$this->ldel."\\s*literal\\s*".$this->rdel.")|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|^(".$this->ldel."\\s*for\\s+)|^(".$this->ldel."\\s*foreach(?![^\s]))|^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|^(\\?>)|^(<%)|^(%>)|^(([\S\s]*?)(?=([\t ]*[\r\n]+[\t ]*|".$this->ldel."|<\\?|\\?>|<%|%>)))|^([\S\s]+)|^(.)/iS";
do {
if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {
function yy_r1_1($yy_subpatterns)
{
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
+ $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILD;
}
function yy_r1_2($yy_subpatterns)
{
- $this->token = Smarty_Internal_Templateparser::TP_COMMENT;
+ $this->token = Smarty_Internal_Templateparser::TP_OTHER;
}
- function yy_r1_4($yy_subpatterns)
+ function yy_r1_3($yy_subpatterns)
{
- if (in_array($this->value, Array('<?', '<?=', '<?php'))) {
- $this->token = Smarty_Internal_Templateparser::TP_PHPSTARTTAG;
- $this->yypushstate(self::PHP);
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_FAKEPHPSTARTTAG;
- $this->value = substr($this->value, 0, 2);
- }
- }
+ $this->token = Smarty_Internal_Templateparser::TP_COMMENT;
+ }
function yy_r1_5($yy_subpatterns)
{
if ($this->strip) {
return false;
} else {
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
+ $this->token = Smarty_Internal_Templateparser::TP_LINEBREAK;
}
}
function yy_r1_6($yy_subpatterns)
function yy_r1_7($yy_subpatterns)
{
+ if ($this->smarty->auto_literal) {
+ $this->token = Smarty_Internal_Templateparser::TP_OTHER;
+ } else {
+ $this->strip = true;
+ return false;
+ }
+ }
+ function yy_r1_8($yy_subpatterns)
+ {
+
$this->strip = false;
return false;
}
- function yy_r1_8($yy_subpatterns)
+ function yy_r1_9($yy_subpatterns)
+ {
+
+ if ($this->smarty->auto_literal) {
+ $this->token = Smarty_Internal_Templateparser::TP_OTHER;
+ } else {
+ $this->strip = false;
+ return false;
+ }
+ }
+ function yy_r1_10($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;
$this->yypushstate(self::LITERAL);
}
- function yy_r1_9($yy_subpatterns)
+ function yy_r1_11($yy_subpatterns)
{
if ($this->smarty->auto_literal) {
$this->taglineno = $this->line;
}
}
- function yy_r1_10($yy_subpatterns)
+ function yy_r1_12($yy_subpatterns)
+ {
+
+ if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+ $this->token = Smarty_Internal_Templateparser::TP_OTHER;
+ } else {
+ $this->token = Smarty_Internal_Templateparser::TP_LDELIF;
+ $this->yypushstate(self::SMARTY);
+ $this->taglineno = $this->line;
+ }
+ }
+ function yy_r1_14($yy_subpatterns)
+ {
+
+ if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+ $this->token = Smarty_Internal_Templateparser::TP_OTHER;
+ } else {
+ $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
+ $this->yypushstate(self::SMARTY);
+ $this->taglineno = $this->line;
+ }
+ }
+ function yy_r1_15($yy_subpatterns)
+ {
+
+ if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+ $this->token = Smarty_Internal_Templateparser::TP_OTHER;
+ } else {
+ $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
+ $this->yypushstate(self::SMARTY);
+ $this->taglineno = $this->line;
+ }
+ }
+ function yy_r1_16($yy_subpatterns)
{
if ($this->smarty->auto_literal) {
$this->taglineno = $this->line;
}
}
- function yy_r1_11($yy_subpatterns)
+ function yy_r1_17($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
- function yy_r1_12($yy_subpatterns)
+ function yy_r1_18($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
- function yy_r1_13($yy_subpatterns)
+ function yy_r1_19($yy_subpatterns)
{
- $this->token = Smarty_Internal_Templateparser::TP_OTHER;
- if (substr($this->value,-2) == '<?') {
- $this->value = substr($this->value,0,-2);
- } elseif (substr($this->value,-strlen($this->smarty->left_delimiter)) == $this->smarty->left_delimiter){
- $this->value = substr($this->value,0,-strlen($this->smarty->left_delimiter));
+ if (in_array($this->value, Array('<?', '<?=', '<?php'))) {
+ $this->token = Smarty_Internal_Templateparser::TP_PHPSTARTTAG;
+ } elseif ($this->value == '<?xml') {
+ $this->token = Smarty_Internal_Templateparser::TP_XMLTAG;
} else {
- $this->value = rtrim($this->value);
- }
- if (strlen($this->value) == 0) {
- return true; // rescan
+ $this->token = Smarty_Internal_Templateparser::TP_FAKEPHPSTARTTAG;
+ $this->value = substr($this->value, 0, 2);
}
+ }
+ function yy_r1_20($yy_subpatterns)
+ {
+
+ $this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG;
}
- function yy_r1_16($yy_subpatterns)
+ function yy_r1_21($yy_subpatterns)
+ {
+
+ $this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG;
+ }
+ function yy_r1_22($yy_subpatterns)
+ {
+
+ $this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG;
+ }
+ function yy_r1_23($yy_subpatterns)
+ {
+
+ $this->token = Smarty_Internal_Templateparser::TP_OTHER;
+ }
+ function yy_r1_26($yy_subpatterns)
+ {
+
+ $this->token = Smarty_Internal_Templateparser::TP_OTHER;
+ }
+ function yy_r1_27($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
function yylex2()
{
$tokenMap = array (
- 1 => 1,
- 3 => 0,
- 4 => 0,
+ 1 => 0,
+ 2 => 0,
+ 3 => 1,
5 => 0,
6 => 0,
7 => 0,
8 => 0,
9 => 0,
10 => 0,
- 11 => 1,
- 13 => 1,
+ 11 => 0,
+ 12 => 0,
+ 13 => 0,
+ 14 => 0,
15 => 0,
16 => 0,
17 => 0,
20 => 1,
22 => 1,
24 => 1,
- 26 => 1,
- 28 => 1,
- 30 => 1,
- 32 => 1,
- 34 => 1,
- 36 => 1,
- 38 => 1,
- 40 => 1,
+ 26 => 0,
+ 27 => 0,
+ 28 => 0,
+ 29 => 0,
+ 30 => 0,
+ 31 => 0,
+ 32 => 0,
+ 33 => 0,
+ 34 => 0,
+ 35 => 0,
+ 36 => 0,
+ 37 => 0,
+ 38 => 0,
+ 39 => 0,
+ 40 => 0,
+ 41 => 0,
42 => 0,
- 43 => 0,
- 44 => 0,
- 45 => 0,
- 46 => 0,
+ 43 => 3,
47 => 0,
48 => 0,
49 => 0,
50 => 0,
51 => 0,
- 52 => 3,
- 56 => 0,
- 57 => 0,
- 58 => 0,
+ 52 => 0,
+ 53 => 0,
+ 54 => 0,
+ 55 => 1,
+ 57 => 1,
59 => 0,
60 => 0,
61 => 0,
62 => 0,
- 63 => 1,
- 65 => 1,
- 67 => 1,
+ 63 => 0,
+ 64 => 0,
+ 65 => 0,
+ 66 => 0,
+ 67 => 0,
+ 68 => 0,
69 => 0,
70 => 0,
71 => 0,
74 => 0,
75 => 0,
76 => 0,
- 77 => 0,
- 78 => 0,
- 79 => 0,
- 80 => 0,
- 81 => 0,
- 82 => 1,
- 84 => 0,
- 85 => 0,
- 86 => 0,
- 87 => 0,
- 88 => 0,
- 89 => 0,
);
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
- $yy_global_pattern = "/^((\\\\\"|\\\\'))|^('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|^(".$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+(to)\\s+)|^(\\s+instanceof\\s+)|^(true|TRUE|True|false|FALSE|False)|^(null|NULL|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*)|^((\\+\\+|--)\\s*)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^((if|elseif|else if|while)(?![^\s]))|^(foreach(?![^\s]))|^(for(?![^\s]))|^([0-9]*[a-zA-Z_]\\w*)|^(\\d+)|^(\\s+)|^(.)/";
+ $yy_global_pattern = "/^('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|^(".$this->ldel."\\s*for\\s+)|^(".$this->ldel."\\s*foreach(?![^\s]))|^(".$this->ldel."\\s{1,})|^(\\s{1,}".$this->rdel.")|^(".$this->ldel."\/)|^(".$this->ldel.")|^(".$this->rdel.")|^(\\s+is\\s+in\\s+)|^(\\s+as\\s+)|^(\\s+to\\s+)|^(\\s+step\\s+)|^(\\s+instanceof\\s+)|^(\\s*===\\s*)|^(\\s*!==\\s*)|^(\\s*==\\s*|\\s+eq\\s+)|^(\\s*!=\\s*|\\s*<>\\s*|\\s+(ne|neq)\\s+)|^(\\s*>=\\s*|\\s+(ge|gte)\\s+)|^(\\s*<=\\s*|\\s+(le|lte)\\s+)|^(\\s*>\\s*|\\s+gt\\s+)|^(\\s*<\\s*|\\s+lt\\s+)|^(\\s+mod\\s+)|^(!\\s*|not\\s+)|^(\\s*&&\\s*|\\s*and\\s+)|^(\\s*\\|\\|\\s*|\\s*or\\s+)|^(\\s*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*=\\s*)|^(\\+\\+|--)|^(\\s*(\\+|-)\\s*)|^(\\s*(\\*|\/|%)\\s*)|^(\\$)|^(\\s*;)|^(::)|^(\\s*:\\s*)|^(@)|^(#)|^(\")|^(`)|^(\\|)|^(\\.)|^(\\s*,\\s*)|^(\\s*&\\s*)|^(\\s*\\?\\s*)|^(0[xX][0-9a-fA-F]+)|^([0-9]*[a-zA-Z_]\\w*)|^(\\d+)|^(\\s+)|^(.)/iS";
do {
if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {
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_4($yy_subpatterns)
+ function yy_r2_2($yy_subpatterns)
{
if ($this->smarty->auto_literal) {
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
+ }
+ }
+ function yy_r2_3($yy_subpatterns)
+ {
+
+ if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+ $this->token = Smarty_Internal_Templateparser::TP_OTHER;
+ } else {
+ $this->token = Smarty_Internal_Templateparser::TP_LDELIF;
+ $this->yypushstate(self::SMARTY);
+ $this->taglineno = $this->line;
}
}
function yy_r2_5($yy_subpatterns)
{
- if ($this->smarty->auto_literal) {
+ if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
- $this->token = Smarty_Internal_Templateparser::TP_LDEL;
+ $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
function yy_r2_6($yy_subpatterns)
{
+ if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+ $this->token = Smarty_Internal_Templateparser::TP_OTHER;
+ } else {
+ $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
+ $this->yypushstate(self::SMARTY);
+ $this->taglineno = $this->line;
+ }
+ }
+ 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_LDEL;
+ $this->yypushstate(self::SMARTY);
+ $this->taglineno = $this->line;
+ }
+ }
+ function yy_r2_8($yy_subpatterns)
+ {
+
$this->token = Smarty_Internal_Templateparser::TP_RDEL;
$this->yypopstate();
- }
}
- function yy_r2_7($yy_subpatterns)
+ function yy_r2_9($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
- function yy_r2_8($yy_subpatterns)
+ function yy_r2_10($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
- function yy_r2_9($yy_subpatterns)
+ function yy_r2_11($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_RDEL;
$this->yypopstate();
}
- function yy_r2_10($yy_subpatterns)
+ function yy_r2_12($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISIN;
}
- function yy_r2_11($yy_subpatterns)
+ function yy_r2_13($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_AS;
}
- function yy_r2_13($yy_subpatterns)
+ function yy_r2_14($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_TO;
function yy_r2_15($yy_subpatterns)
{
- $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF;
+ $this->token = Smarty_Internal_Templateparser::TP_STEP;
}
function yy_r2_16($yy_subpatterns)
{
- $this->token = Smarty_Internal_Templateparser::TP_BOOLEAN;
+ $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF;
}
function yy_r2_17($yy_subpatterns)
{
- $this->token = Smarty_Internal_Templateparser::TP_NULL;
- }
- function yy_r2_18($yy_subpatterns)
- {
-
$this->token = Smarty_Internal_Templateparser::TP_IDENTITY;
}
- function yy_r2_19($yy_subpatterns)
+ function yy_r2_18($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_NONEIDENTITY;
}
- function yy_r2_20($yy_subpatterns)
+ function yy_r2_19($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_EQUALS;
}
- function yy_r2_22($yy_subpatterns)
+ function yy_r2_20($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_NOTEQUALS;
}
- function yy_r2_24($yy_subpatterns)
+ function yy_r2_22($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_GREATEREQUAL;
}
- function yy_r2_26($yy_subpatterns)
+ function yy_r2_24($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LESSEQUAL;
}
- function yy_r2_28($yy_subpatterns)
+ function yy_r2_26($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_GREATERTHAN;
}
- function yy_r2_30($yy_subpatterns)
+ function yy_r2_27($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LESSTHAN;
}
- function yy_r2_32($yy_subpatterns)
+ function yy_r2_28($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_MOD;
}
- function yy_r2_34($yy_subpatterns)
+ function yy_r2_29($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_NOT;
}
- function yy_r2_36($yy_subpatterns)
+ function yy_r2_30($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LAND;
}
- function yy_r2_38($yy_subpatterns)
+ function yy_r2_31($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LOR;
}
- function yy_r2_40($yy_subpatterns)
+ function yy_r2_32($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LXOR;
}
- function yy_r2_42($yy_subpatterns)
+ function yy_r2_33($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISODDBY;
}
- function yy_r2_43($yy_subpatterns)
+ function yy_r2_34($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISNOTODDBY;
}
- function yy_r2_44($yy_subpatterns)
+ function yy_r2_35($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISODD;
}
- function yy_r2_45($yy_subpatterns)
+ function yy_r2_36($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISNOTODD;
}
- function yy_r2_46($yy_subpatterns)
+ function yy_r2_37($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISEVENBY;
}
- function yy_r2_47($yy_subpatterns)
+ function yy_r2_38($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISNOTEVENBY;
}
- function yy_r2_48($yy_subpatterns)
+ function yy_r2_39($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISEVEN;
}
- function yy_r2_49($yy_subpatterns)
+ function yy_r2_40($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISNOTEVEN;
}
- function yy_r2_50($yy_subpatterns)
+ function yy_r2_41($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISDIVBY;
}
- function yy_r2_51($yy_subpatterns)
+ function yy_r2_42($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ISNOTDIVBY;
}
- function yy_r2_52($yy_subpatterns)
+ function yy_r2_43($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_TYPECAST;
}
- function yy_r2_56($yy_subpatterns)
+ function yy_r2_47($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OPENP;
}
- function yy_r2_57($yy_subpatterns)
+ function yy_r2_48($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_CLOSEP;
}
- function yy_r2_58($yy_subpatterns)
+ function yy_r2_49($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OPENB;
}
- function yy_r2_59($yy_subpatterns)
+ function yy_r2_50($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_CLOSEB;
}
- function yy_r2_60($yy_subpatterns)
+ function yy_r2_51($yy_subpatterns)
{
- $this->token = Smarty_Internal_Templateparser::TP_PTR;
+ $this->token = Smarty_Internal_Templateparser::TP_PTR;
}
- function yy_r2_61($yy_subpatterns)
+ function yy_r2_52($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_APTR;
}
- function yy_r2_62($yy_subpatterns)
+ function yy_r2_53($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_EQUAL;
}
- function yy_r2_63($yy_subpatterns)
+ function yy_r2_54($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_INCDEC;
}
- function yy_r2_65($yy_subpatterns)
+ function yy_r2_55($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_UNIMATH;
}
- function yy_r2_67($yy_subpatterns)
+ function yy_r2_57($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_MATH;
}
- function yy_r2_69($yy_subpatterns)
+ function yy_r2_59($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_DOLLAR;
}
- function yy_r2_70($yy_subpatterns)
+ function yy_r2_60($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_SEMICOLON;
}
- function yy_r2_71($yy_subpatterns)
+ function yy_r2_61($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON;
}
- function yy_r2_72($yy_subpatterns)
+ function yy_r2_62($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_COLON;
}
- function yy_r2_73($yy_subpatterns)
+ function yy_r2_63($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_AT;
}
- function yy_r2_74($yy_subpatterns)
+ function yy_r2_64($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_HATCH;
}
- function yy_r2_75($yy_subpatterns)
+ function yy_r2_65($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_QUOTE;
$this->yypushstate(self::DOUBLEQUOTEDSTRING);
}
- function yy_r2_76($yy_subpatterns)
+ function yy_r2_66($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
$this->yypopstate();
}
- function yy_r2_77($yy_subpatterns)
+ function yy_r2_67($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_VERT;
}
- function yy_r2_78($yy_subpatterns)
+ function yy_r2_68($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_DOT;
}
- function yy_r2_79($yy_subpatterns)
+ function yy_r2_69($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_COMMA;
}
- function yy_r2_80($yy_subpatterns)
+ function yy_r2_70($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ANDSYM;
}
- function yy_r2_81($yy_subpatterns)
+ function yy_r2_71($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_QMARK;
}
- function yy_r2_82($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_IF;
- }
- function yy_r2_84($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_FOREACH;
- }
- function yy_r2_85($yy_subpatterns)
+ function yy_r2_72($yy_subpatterns)
{
- $this->token = Smarty_Internal_Templateparser::TP_FOR;
+ $this->token = Smarty_Internal_Templateparser::TP_HEX;
}
- function yy_r2_86($yy_subpatterns)
+ function yy_r2_73($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_ID;
}
- function yy_r2_87($yy_subpatterns)
+ function yy_r2_74($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_INTEGER;
}
- function yy_r2_88($yy_subpatterns)
+ function yy_r2_75($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_SPACE;
}
- function yy_r2_89($yy_subpatterns)
+ function yy_r2_76($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
}
+
function yylex3()
{
$tokenMap = array (
1 => 0,
- 2 => 1,
+ 2 => 0,
+ 3 => 0,
4 => 0,
+ 5 => 0,
+ 6 => 0,
+ 7 => 0,
+ 8 => 2,
+ 11 => 0,
);
if ($this->counter >= strlen($this->data)) {
return false; // end of input
}
- $yy_global_pattern = "/^(\\?>)|^([\s\S]+?(\\?>|\/\\*|'|\"|<<<\\s*'?\\w+'?\r?\n|\/\/|#))|^([\S\s]+)/";
+ $yy_global_pattern = "/^(".$this->ldel."\\s*literal\\s*".$this->rdel.")|^(".$this->ldel."\\s*\/literal\\s*".$this->rdel.")|^([\t ]*[\r\n]+[\t ]*)|^(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|^(\\?>)|^(<%)|^(%>)|^(([\S\s]*?)(?=([\t ]*[\r\n]+[\t ]*|".$this->ldel."\/?literal".$this->rdel."|<\\?|<%)))|^(.)/iS";
do {
if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {
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');
+ $this->counter, 5) . '... state LITERAL');
}
next($yymatches); // skip global match
$this->token = key($yymatches); // token number
} // end function
- const PHP = 3;
+ const LITERAL = 3;
function yy_r3_1($yy_subpatterns)
{
- $this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG;
- $this->yypopstate();
+ $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;
+ $this->yypushstate(self::LITERAL);
}
function yy_r3_2($yy_subpatterns)
{
- switch ($yy_subpatterns[0]) {
- case '?>':
- $this->token = Smarty_Internal_Templateparser::TP_PHP_CODE;
- $this->value = substr($this->value, 0, -2);
- break;
- case "'":
- $this->token = Smarty_Internal_Templateparser::TP_PHP_CODE;
- $this->yypushstate(self::PHP_SINGLE_QUOTED_STRING);
- break;
- case '"':
- $this->token = Smarty_Internal_Templateparser::TP_PHP_CODE_START_DOUBLEQUOTE;
- $this->yypushstate(self::PHP_DOUBLE_QUOTED_STRING);
- break;
- case '/*':
- $this->token = Smarty_Internal_Templateparser::TP_PHP_CODE;
- $this->yypushstate(self::PHP_ML_COMMENT);
- break;
- case '//':
- case '#':
- $this->token = Smarty_Internal_Templateparser::TP_PHP_CODE;
- $this->yypushstate(self::PHP_SL_COMMENT);
- break;
- default:
- $res = preg_match('/\A<<<\s*\'?(\w+)(\'?)\r?\n\z/', $yy_subpatterns[0], $matches);
- assert($res === 1);
- $is_nowdoc = $matches[2] === "'";
- $this->token = $is_nowdoc
- ? Smarty_Internal_Templateparser::TP_PHP_NOWDOC_START
- : Smarty_Internal_Templateparser::TP_PHP_HEREDOC_START;
- $this->heredoc_id_stack[] = $matches[1];
- $this->yypushstate($is_nowdoc ? self::PHP_NOWDOC : self::PHP_HEREDOC);
- break;
- }
+ $this->token = Smarty_Internal_Templateparser::TP_LITERALEND;
+ $this->yypopstate();
}
- function yy_r3_4($yy_subpatterns)
+ function yy_r3_3($yy_subpatterns)
{
- $this->compiler->trigger_template_error ("missing PHP end tag");
+ $this->token = Smarty_Internal_Templateparser::TP_LITERAL;
}
-
-
- function yylex4()
+ function yy_r3_4($yy_subpatterns)
{
- $tokenMap = array (
- 1 => 0,
- 2 => 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_ML_COMMENT');
- }
- 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 {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const PHP_ML_COMMENT = 4;
- function yy_r4_1($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_PHP_CODE;
- $this->yypopstate();
- }
- function yy_r4_2($yy_subpatterns)
- {
-
- $this->compiler->trigger_template_error("missing PHP comment end */");
- }
-
-
- function yylex5()
- {
- $tokenMap = array (
- 1 => 0,
- 2 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/^(.+?(?=\\?>|\n))|^([\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_SL_COMMENT');
- }
- 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 {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const PHP_SL_COMMENT = 5;
- function yy_r5_1($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_PHP_CODE;
- $this->yypopstate();
- }
- function yy_r5_2($yy_subpatterns)
- {
-
- /* this can happen for "//?>" */
- $this->yypopstate();
- return true;
- }
-
-
- function yylex6()
- {
- $tokenMap = array (
- 1 => 0,
- 2 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/^([^\n]*\n)|^([\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_NOWDOC');
- }
- 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_r6_' . $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 {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const PHP_NOWDOC = 6;
- function yy_r6_1($yy_subpatterns)
- {
-
- $heredoc_id = $this->heredoc_id_stack[sizeof($this->heredoc_id_stack)-1];
- if ( $this->value === $heredoc_id."\n"
- || $this->value === $heredoc_id."\r\n"
- || $this->value === $heredoc_id.";\n"
- || $this->value === $heredoc_id.";\r\n"
- ) {
- $this->token = Smarty_Internal_Templateparser::TP_PHP_NOWDOC_END;
- array_pop($this->heredoc_id_stack);
- $this->yypopstate();
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_PHP_DQ_CONTENT;
- }
- }
- function yy_r6_2($yy_subpatterns)
- {
-
- $this->compiler->trigger_template_error("missing PHP NOWDOC end");
- }
-
-
- function yylex7()
- {
- $tokenMap = array (
- 1 => 0,
- 2 => 0,
- 3 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/^(\\{\\$|\\{\\$)|^([^\n]*\n)|^([\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_HEREDOC');
- }
- 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_r7_' . $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 {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const PHP_HEREDOC = 7;
- function yy_r7_1($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_PHP_DQ_EMBED_START;
- $this->yypushstate(self::PHP_RETURNING_TO_HEREDOC_FROM_EMBEDDED);
- $this->yypushstate(self::PHP_DOUBLE_QUOTED_STRING_EMBEDDED);
- }
- function yy_r7_2($yy_subpatterns)
- {
-
- $heredoc_id = $this->heredoc_id_stack[sizeof($this->heredoc_id_stack)-1];
- if ( $this->value === $heredoc_id."\n"
- || $this->value === $heredoc_id."\r\n"
- || $this->value === $heredoc_id.";\n"
- || $this->value === $heredoc_id.";\r\n"
- ) {
- $this->token = Smarty_Internal_Templateparser::TP_PHP_HEREDOC_END;
- array_pop($this->heredoc_id_stack);
- $this->yypopstate();
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_PHP_DQ_CONTENT;
- if (preg_match('/(.*?)(\{\$\|\$\{)/', $this->value, $matches)) {
- $this->value = $matches[1];
- }
- }
- }
- function yy_r7_3($yy_subpatterns)
- {
-
- $this->compiler->trigger_template_error("missing PHP HEREDOC end");
- }
-
-
- function yylex8()
- {
- $tokenMap = array (
- 1 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/^([^\n]*\n)/";
-
- 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_RETURNING_TO_HEREDOC_FROM_EMBEDDED');
- }
- 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_r8_' . $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 {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const PHP_RETURNING_TO_HEREDOC_FROM_EMBEDDED = 8;
- function yy_r8_1($yy_subpatterns)
- {
-
- $this->yypopstate();
- $heredoc_id = $this->heredoc_id_stack[sizeof($this->heredoc_id_stack)-1];
- if ( $this->value === $heredoc_id."\n"
- || $this->value === $heredoc_id."\r\n"
- || $this->value === $heredoc_id.";\n"
- || $this->value === $heredoc_id.";\r\n"
- ) {
- //Make sure it isn't interpreted as HEREDOC end.
- $this->token = Smarty_Internal_Templateparser::TP_PHP_DQ_CONTENT;
- } else {
- return true; //retry in PHP_HEREDOC state
- }
- }
-
-
- function yylex9()
- {
- $tokenMap = array (
- 1 => 0,
- 2 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/^((?:[^\\\\']|\\\\.)*')|^([\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_SINGLE_QUOTED_STRING');
- }
- 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_r9_' . $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 {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const PHP_SINGLE_QUOTED_STRING = 9;
- function yy_r9_1($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_PHP_CODE;
- $this->yypopstate();
- }
- function yy_r9_2($yy_subpatterns)
- {
-
- $this->compiler->trigger_template_error("missing PHP single quoted string end");
- }
-
-
- function yylex10()
- {
- $tokenMap = array (
- 1 => 0,
- 2 => 0,
- 3 => 0,
- 4 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/^(\\{\\$|\\{\\$)|^(\")|^((?:\\\\.|[^\"\\\\])+?(?=\"|\\{\\$|\\$\\{))|^([\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_DOUBLE_QUOTED_STRING');
- }
- 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_r10_' . $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 {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const PHP_DOUBLE_QUOTED_STRING = 10;
- function yy_r10_1($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_PHP_DQ_EMBED_START;
- $this->yypushstate(self::PHP_DOUBLE_QUOTED_STRING_EMBEDDED);
- }
- function yy_r10_2($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_PHP_CODE_DOUBLEQUOTE;
- $this->yypopstate();
- }
- function yy_r10_3($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_PHP_DQ_CONTENT;
- }
- function yy_r10_4($yy_subpatterns)
- {
-
- $this->compiler->trigger_template_error("missing PHP double quoted string end");
- }
-
-
- function yylex11()
- {
- $tokenMap = array (
- 1 => 0,
- 2 => 0,
- 3 => 0,
- 4 => 0,
- 5 => 0,
- 6 => 0,
- );
- if ($this->counter >= strlen($this->data)) {
- return false; // end of input
- }
- $yy_global_pattern = "/^(\")|^(')|^(<<<\\s*\\w+\r?\n)|^(<<<\\s*'\\w+'\r?\n)|^(\\})|^([^'\"}]+?(?='|\"|\\}|<<<\\s*'?\\w+'?\r?\n))/";
-
- 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_DOUBLE_QUOTED_STRING_EMBEDDED');
- }
- 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_r11_' . $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 {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const PHP_DOUBLE_QUOTED_STRING_EMBEDDED = 11;
- function yy_r11_1($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_PHP_CODE_START_DOUBLEQUOTE;
- $this->yypushstate(self::PHP_DOUBLE_QUOTED_STRING);
+ if (in_array($this->value, Array('<?', '<?=', '<?php'))) {
+ $this->token = Smarty_Internal_Templateparser::TP_PHPSTARTTAG;
+ } else {
+ $this->token = Smarty_Internal_Templateparser::TP_FAKEPHPSTARTTAG;
+ $this->value = substr($this->value, 0, 2);
+ }
}
- function yy_r11_2($yy_subpatterns)
+ function yy_r3_5($yy_subpatterns)
{
- $this->token = Smarty_Internal_Templateparser::TP_PHP_CODE;
- $this->yypushstate(self::PHP_SINGLE_QUOTED_STRING);
+ $this->token = Smarty_Internal_Templateparser::TP_PHPENDTAG;
}
- function yy_r11_3($yy_subpatterns)
+ function yy_r3_6($yy_subpatterns)
{
- $this->token = Smarty_Internal_Templateparser::TP_PHP_HEREDOC_START;
- $res = preg_match('/\A\<\<\<\s*(\w+)\r?\n\z/', $this->value, $matches);
- assert($res === 1);
- $this->heredoc_id_stack[] = $matches[1];
- $this->yypushstate(self::PHP_HEREDOC);
+ $this->token = Smarty_Internal_Templateparser::TP_ASPSTARTTAG;
}
- function yy_r11_4($yy_subpatterns)
+ function yy_r3_7($yy_subpatterns)
{
- $this->token = Smarty_Internal_Templateparser::TP_PHP_NOWDOC_START;
- $res = preg_match('/\A\<\<\<\s*\'(\w+)\'\r?\n\z/', $this->value, $matches);
- assert($res === 1);
- $this->heredoc_id_stack[] = $matches[1];
- $this->yypushstate(self::PHP_NOWDOC);
+ $this->token = Smarty_Internal_Templateparser::TP_ASPENDTAG;
}
- function yy_r11_5($yy_subpatterns)
+ function yy_r3_8($yy_subpatterns)
{
- $this->token = Smarty_Internal_Templateparser::TP_PHP_DQ_EMBED_END;
- $this->yypopstate();
+ $this->token = Smarty_Internal_Templateparser::TP_LITERAL;
}
- function yy_r11_6($yy_subpatterns)
+ function yy_r3_11($yy_subpatterns)
{
- $this->token = Smarty_Internal_Templateparser::TP_PHP_CODE;
+ $this->compiler->trigger_template_error ("missing or misspelled literal closing tag");
}
-
- function yylex12()
+ function yylex4()
{
$tokenMap = array (
1 => 0,
- 2 => 0,
- 3 => 0,
+ 2 => 1,
4 => 0,
- 5 => 1,
+ 5 => 0,
+ 6 => 0,
7 => 0,
+ 8 => 0,
+ 9 => 0,
+ 10 => 0,
+ 11 => 0,
+ 12 => 0,
+ 13 => 3,
+ 17 => 0,
+ 18 => 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.")|^(<\\?(?:php\\w+|=|[a-zA-Z]+)?)|^(\\?>)|^([\S\s]+?(".$this->ldel."\/?literal".$this->rdel."|<\\?))|^([\S\s]+)/";
+ $yy_global_pattern = "/^(".$this->ldel."\\s{1,}\/)|^(".$this->ldel."\\s*(if|elseif|else if|while)\\s+)|^(".$this->ldel."\\s*for\\s+)|^(".$this->ldel."\\s*foreach(?![^\s]))|^(".$this->ldel."\\s{1,})|^(".$this->ldel."\/)|^(".$this->ldel.")|^(\")|^(`\\$)|^(\\$[0-9]*[a-zA-Z_]\\w*)|^(\\$)|^(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=(".$this->ldel."|\\$|`\\$|\")))|^([\S\s]+)|^(.)/iS";
do {
if (preg_match($yy_global_pattern, substr($this->data, $this->counter), $yymatches)) {
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');
+ $this->counter, 5) . '... state DOUBLEQUOTEDSTRING');
}
next($yymatches); // skip global match
$this->token = key($yymatches); // token number
$yysubmatches = array();
}
$this->value = current($yymatches); // token value
- $r = $this->{'yy_r12_' . $this->token}($yysubmatches);
+ $r = $this->{'yy_r4_' . $this->token}($yysubmatches);
if ($r === null) {
$this->counter += strlen($this->value);
$this->line += substr_count($this->value, "\n");
} // end function
- const LITERAL = 12;
- function yy_r12_1($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART;
- $this->yypushstate(self::LITERAL);
- }
- function yy_r12_2($yy_subpatterns)
- {
-
- $this->token = Smarty_Internal_Templateparser::TP_LITERALEND;
- $this->yypopstate();
- }
- function yy_r12_3($yy_subpatterns)
- {
-
- if (in_array($this->value, Array('<?', '<?=', '<?php'))) {
- $this->token = Smarty_Internal_Templateparser::TP_PHPSTARTTAG;
- } else {
- $this->token = Smarty_Internal_Templateparser::TP_FAKEPHPSTARTTAG;
- $this->value = substr($this->value, 0, 2);
- }
- }
- function yy_r12_4($yy_subpatterns)
+ const DOUBLEQUOTEDSTRING = 4;
+ function yy_r4_1($yy_subpatterns)
{
- $this->token = Smarty_Internal_Templateparser::TP_LITERAL;
+ if ($this->smarty->auto_literal) {
+ $this->token = Smarty_Internal_Templateparser::TP_OTHER;
+ } else {
+ $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
+ $this->yypushstate(self::SMARTY);
+ $this->taglineno = $this->line;
+ }
}
- function yy_r12_5($yy_subpatterns)
+ function yy_r4_2($yy_subpatterns)
{
- $lenght_literal = strlen($this->smarty->left_delimiter.$this->smarty->right_delimiter)+7;
- if (substr($this->value,-2,2) === '<?') {
- $this->token = Smarty_Internal_Templateparser::TP_LITERAL;
- $this->value = substr($this->value,0,-2);
- } else if (substr($this->value,-$lenght_literal,$lenght_literal) === $this->smarty->left_delimiter.'literal'.$this->smarty->right_delimiter) {
- $this->token = Smarty_Internal_Templateparser::TP_LITERAL;
- $this->value = substr($this->value,0,-$lenght_literal);
+ if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+ $this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
- assert(substr($this->value,-$lenght_literal-1,$lenght_literal+1) === $this->smarty->left_delimiter.'/literal'.$this->smarty->right_delimiter);
- $this->token = Smarty_Internal_Templateparser::TP_LITERAL;
- $this->value = substr($this->value,0,-$lenght_literal-1);
+ $this->token = Smarty_Internal_Templateparser::TP_LDELIF;
+ $this->yypushstate(self::SMARTY);
+ $this->taglineno = $this->line;
}
}
- function yy_r12_7($yy_subpatterns)
+ function yy_r4_4($yy_subpatterns)
{
- $this->compiler->trigger_template_error ("missing or misspelled literal closing tag");
+ if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
+ $this->token = Smarty_Internal_Templateparser::TP_OTHER;
+ } else {
+ $this->token = Smarty_Internal_Templateparser::TP_LDELFOR;
+ $this->yypushstate(self::SMARTY);
+ $this->taglineno = $this->line;
+ }
}
-
-
- function yylex13()
- {
- $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_r13_' . $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 {
- throw new Exception('Unexpected input at line' . $this->line .
- ': ' . $this->data[$this->counter]);
- }
- break;
- } while (true);
-
- } // end function
-
-
- const DOUBLEQUOTEDSTRING = 13;
- function yy_r13_1($yy_subpatterns)
+ function yy_r4_5($yy_subpatterns)
{
- if ($this->smarty->auto_literal) {
+ if ($this->smarty->auto_literal && trim(substr($this->value,$this->ldel_length,1)) == '') {
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
} else {
- $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
+ $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
}
- function yy_r13_2($yy_subpatterns)
+ function yy_r4_6($yy_subpatterns)
{
if ($this->smarty->auto_literal) {
$this->taglineno = $this->line;
}
}
- function yy_r13_3($yy_subpatterns)
+ function yy_r4_7($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LDELSLASH;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
- function yy_r13_4($yy_subpatterns)
+ function yy_r4_8($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_LDEL;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
- function yy_r13_5($yy_subpatterns)
+ function yy_r4_9($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_QUOTE;
$this->yypopstate();
}
- function yy_r13_6($yy_subpatterns)
+ function yy_r4_10($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_BACKTICK;
$this->yypushstate(self::SMARTY);
$this->taglineno = $this->line;
}
- function yy_r13_7($yy_subpatterns)
+ function yy_r4_11($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_DOLLARID;
}
- function yy_r13_8($yy_subpatterns)
+ function yy_r4_12($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
}
- function yy_r13_9($yy_subpatterns)
+ function yy_r4_13($yy_subpatterns)
+ {
+
+ $this->token = Smarty_Internal_Templateparser::TP_OTHER;
+ }
+ function yy_r4_17($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_r13_12($yy_subpatterns)
+ function yy_r4_18($yy_subpatterns)
{
$this->token = Smarty_Internal_Templateparser::TP_OTHER;
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_templateparser.php b/gosa-core/include/smarty/sysplugins/smarty_internal_templateparser.php
index 3ad06029e270bb07a701fa24b09f24b06f43ffe1..18c35a87c8965683d2e628d8198a5888ba1ec1b3 100644 (file)
-<?php\r
-/**\r
-* Smarty Internal Plugin Templateparser\r
-*\r
-* This is the template parser.\r
-* It is generated from the internal.templateparser.y file\r
-* @package Smarty\r
-* @subpackage Compiler\r
-* @author Uwe Tews\r
-*/\r
-\r
-class TP_yyToken implements ArrayAccess\r
-{\r
- public $string = '';\r
- public $metadata = array();\r
-\r
- function __construct($s, $m = array())\r
- {\r
- if ($s instanceof TP_yyToken) {\r
- $this->string = $s->string;\r
- $this->metadata = $s->metadata;\r
- } else {\r
- $this->string = (string) $s;\r
- if ($m instanceof TP_yyToken) {\r
- $this->metadata = $m->metadata;\r
- } elseif (is_array($m)) {\r
- $this->metadata = $m;\r
- }\r
- }\r
- }\r
-\r
- function __toString()\r
- {\r
- return $this->_string;\r
- }\r
-\r
- function offsetExists($offset)\r
- {\r
- return isset($this->metadata[$offset]);\r
- }\r
-\r
- function offsetGet($offset)\r
- {\r
- return $this->metadata[$offset];\r
- }\r
-\r
- function offsetSet($offset, $value)\r
- {\r
- if ($offset === null) {\r
- if (isset($value[0])) {\r
- $x = ($value instanceof TP_yyToken) ?\r
- $value->metadata : $value;\r
- $this->metadata = array_merge($this->metadata, $x);\r
- return;\r
- }\r
- $offset = count($this->metadata);\r
- }\r
- if ($value === null) {\r
- return;\r
- }\r
- if ($value instanceof TP_yyToken) {\r
- if ($value->metadata) {\r
- $this->metadata[$offset] = $value->metadata;\r
- }\r
- } elseif ($value) {\r
- $this->metadata[$offset] = $value;\r
- }\r
- }\r
-\r
- function offsetUnset($offset)\r
- {\r
- unset($this->metadata[$offset]);\r
- }\r
-}\r
-\r
-class TP_yyStackEntry\r
-{\r
- public $stateno; /* The state-number */\r
- public $major; /* The major token value. This is the code\r
- ** number for the token at this stack level */\r
- public $minor; /* The user-supplied minor token value. This\r
- ** is the value of the token */\r
-};\r
-\r
-\r
-#line 12 "smarty_internal_templateparser.y"\r
-class Smarty_Internal_Templateparser#line 79 "smarty_internal_templateparser.php"\r
-{\r
-#line 14 "smarty_internal_templateparser.y"\r
-\r
- // states whether the parse was successful or not\r
- public $successful = true;\r
- public $retvalue = 0;\r
- private $lex;\r
- private $internalError = false;\r
-\r
- function __construct($lex, $compiler) {\r
- // set instance object\r
- self::instance($this); \r
- $this->lex = $lex;\r
- $this->compiler = $compiler;\r
- $this->smarty = $this->compiler->smarty;\r
- $this->template = $this->compiler->template;\r
- if ($this->template->security && isset($this->smarty->security_handler)) {\r
- $this->sec_obj = $this->smarty->security_policy;\r
- } else {\r
- $this->sec_obj = $this->smarty;\r
- }\r
- $this->compiler->has_variable_string = false;\r
- $this->compiler->prefix_code = array();\r
- $this->prefix_number = 0;\r
- }\r
- public static function &instance($new_instance = null)\r
- {\r
- static $instance = null;\r
- if (isset($new_instance) && is_object($new_instance))\r
- $instance = $new_instance;\r
- return $instance;\r
- }\r
-\r
- public static function escape_start_tag($tag_text) {\r
- $tag = preg_replace('/\A<\?(.*)\z/', '<<?php ?>?\1', $tag_text, -1 , $count); //Escape tag\r
- assert($tag !== false && $count === 1);\r
- return $tag;\r
- }\r
-\r
- public static function escape_end_tag($tag_text) {\r
- assert($tag_text === '?>');\r
- return '?<?php ?>>';\r
- }\r
-\r
- \r
-#line 126 "smarty_internal_templateparser.php"\r
-\r
- const TP_COMMENT = 1;\r
- const TP_PHPSTARTTAG = 2;\r
- const TP_PHPENDTAG = 3;\r
- const TP_OTHER = 4;\r
- const TP_FAKEPHPSTARTTAG = 5;\r
- const TP_PHP_CODE = 6;\r
- const TP_PHP_CODE_START_DOUBLEQUOTE = 7;\r
- const TP_PHP_CODE_DOUBLEQUOTE = 8;\r
- const TP_PHP_HEREDOC_START = 9;\r
- const TP_PHP_HEREDOC_END = 10;\r
- const TP_PHP_NOWDOC_START = 11;\r
- const TP_PHP_NOWDOC_END = 12;\r
- const TP_PHP_DQ_CONTENT = 13;\r
- const TP_PHP_DQ_EMBED_START = 14;\r
- const TP_PHP_DQ_EMBED_END = 15;\r
- const TP_LITERALSTART = 16;\r
- const TP_LITERALEND = 17;\r
- const TP_LITERAL = 18;\r
- const TP_LDEL = 19;\r
- const TP_RDEL = 20;\r
- const TP_DOLLAR = 21;\r
- const TP_ID = 22;\r
- const TP_EQUAL = 23;\r
- const TP_FOREACH = 24;\r
- const TP_PTR = 25;\r
- const TP_IF = 26;\r
- const TP_SPACE = 27;\r
- const TP_UNIMATH = 28;\r
- const TP_FOR = 29;\r
- const TP_SEMICOLON = 30;\r
- const TP_INCDEC = 31;\r
- const TP_TO = 32;\r
- const TP_AS = 33;\r
- const TP_APTR = 34;\r
- const TP_LDELSLASH = 35;\r
- const TP_INTEGER = 36;\r
- const TP_COMMA = 37;\r
- const TP_COLON = 38;\r
- const TP_MATH = 39;\r
- const TP_ANDSYM = 40;\r
- const TP_OPENP = 41;\r
- const TP_CLOSEP = 42;\r
- const TP_QMARK = 43;\r
- const TP_NOT = 44;\r
- const TP_TYPECAST = 45;\r
- const TP_DOT = 46;\r
- const TP_BOOLEAN = 47;\r
- const TP_NULL = 48;\r
- const TP_SINGLEQUOTESTRING = 49;\r
- const TP_QUOTE = 50;\r
- const TP_DOUBLECOLON = 51;\r
- const TP_AT = 52;\r
- const TP_HATCH = 53;\r
- const TP_OPENB = 54;\r
- const TP_CLOSEB = 55;\r
- const TP_VERT = 56;\r
- const TP_ISIN = 57;\r
- const TP_ISDIVBY = 58;\r
- const TP_ISNOTDIVBY = 59;\r
- const TP_ISEVEN = 60;\r
- const TP_ISNOTEVEN = 61;\r
- const TP_ISEVENBY = 62;\r
- const TP_ISNOTEVENBY = 63;\r
- const TP_ISODD = 64;\r
- const TP_ISNOTODD = 65;\r
- const TP_ISODDBY = 66;\r
- const TP_ISNOTODDBY = 67;\r
- const TP_INSTANCEOF = 68;\r
- const TP_EQUALS = 69;\r
- const TP_NOTEQUALS = 70;\r
- const TP_GREATERTHAN = 71;\r
- const TP_LESSTHAN = 72;\r
- const TP_GREATEREQUAL = 73;\r
- const TP_LESSEQUAL = 74;\r
- const TP_IDENTITY = 75;\r
- const TP_NONEIDENTITY = 76;\r
- const TP_MOD = 77;\r
- const TP_LAND = 78;\r
- const TP_LOR = 79;\r
- const TP_LXOR = 80;\r
- const TP_BACKTICK = 81;\r
- const TP_DOLLARID = 82;\r
- const YY_NO_ACTION = 613;\r
- const YY_ACCEPT_ACTION = 612;\r
- const YY_ERROR_ACTION = 611;\r
-\r
- const YY_SZ_ACTTAB = 1771;\r
-static public $yy_action = array(\r
- /* 0 */ 19, 25, 98, 62, 192, 106, 376, 210, 202, 48,\r
- /* 10 */ 224, 228, 42, 214, 22, 188, 129, 225, 330, 95,\r
- /* 20 */ 202, 92, 11, 96, 143, 52, 50, 22, 300, 301,\r
- /* 30 */ 312, 61, 97, 282, 65, 14, 19, 143, 100, 194,\r
- /* 40 */ 344, 339, 202, 340, 141, 48, 612, 59, 273, 332,\r
- /* 50 */ 335, 202, 129, 225, 60, 346, 345, 51, 26, 304,\r
- /* 60 */ 28, 52, 50, 226, 300, 301, 312, 61, 47, 49,\r
- /* 70 */ 65, 14, 264, 19, 9, 89, 209, 253, 344, 339,\r
- /* 80 */ 328, 340, 48, 229, 267, 27, 362, 100, 157, 129,\r
- /* 90 */ 225, 2, 60, 30, 345, 26, 317, 33, 52, 50,\r
- /* 100 */ 202, 300, 301, 312, 61, 285, 240, 65, 14, 19,\r
- /* 110 */ 22, 89, 209, 30, 310, 254, 317, 32, 48, 65,\r
- /* 120 */ 143, 51, 269, 326, 266, 129, 225, 217, 258, 476,\r
- /* 130 */ 51, 5, 47, 49, 8, 50, 476, 300, 301, 312,\r
- /* 140 */ 61, 47, 49, 65, 14, 19, 216, 89, 199, 64,\r
- /* 150 */ 22, 274, 324, 277, 48, 236, 275, 239, 475, 214,\r
- /* 160 */ 143, 129, 225, 30, 368, 214, 317, 26, 187, 303,\r
- /* 170 */ 52, 50, 351, 300, 301, 312, 61, 1, 218, 65,\r
- /* 180 */ 14, 19, 303, 100, 203, 150, 30, 369, 202, 317,\r
- /* 190 */ 48, 186, 100, 241, 127, 22, 30, 129, 225, 317,\r
- /* 200 */ 304, 248, 256, 26, 202, 143, 52, 50, 391, 300,\r
- /* 210 */ 301, 312, 61, 289, 39, 65, 14, 19, 191, 100,\r
- /* 220 */ 213, 40, 109, 4, 65, 56, 48, 30, 22, 216,\r
- /* 230 */ 317, 32, 287, 129, 225, 138, 270, 479, 143, 26,\r
- /* 240 */ 386, 186, 52, 50, 479, 300, 301, 312, 61, 202,\r
- /* 250 */ 304, 65, 14, 19, 29, 100, 200, 56, 30, 367,\r
- /* 260 */ 30, 317, 48, 317, 39, 406, 313, 3, 10, 129,\r
- /* 270 */ 207, 30, 370, 214, 317, 26, 23, 303, 52, 50,\r
- /* 280 */ 156, 300, 301, 312, 61, 53, 186, 65, 14, 19,\r
- /* 290 */ 293, 89, 193, 221, 352, 304, 388, 177, 48, 246,\r
- /* 300 */ 320, 214, 319, 109, 350, 129, 225, 144, 56, 242,\r
- /* 310 */ 63, 16, 303, 186, 8, 50, 147, 300, 301, 312,\r
- /* 320 */ 61, 386, 304, 65, 14, 19, 186, 103, 209, 192,\r
- /* 330 */ 202, 304, 281, 153, 48, 327, 83, 42, 293, 190,\r
- /* 340 */ 41, 129, 225, 306, 53, 238, 90, 5, 304, 39,\r
- /* 350 */ 8, 50, 164, 300, 301, 312, 61, 214, 202, 65,\r
- /* 360 */ 14, 19, 186, 89, 209, 78, 271, 304, 43, 152,\r
- /* 370 */ 48, 333, 332, 335, 220, 185, 350, 129, 225, 306,\r
- /* 380 */ 262, 349, 63, 16, 304, 39, 8, 50, 146, 300,\r
- /* 390 */ 301, 312, 61, 35, 348, 65, 14, 19, 9, 100,\r
- /* 400 */ 213, 140, 404, 304, 261, 374, 48, 189, 360, 214,\r
- /* 410 */ 373, 202, 214, 129, 225, 214, 304, 214, 9, 26,\r
- /* 420 */ 202, 45, 52, 50, 245, 300, 301, 312, 61, 260,\r
- /* 430 */ 90, 65, 31, 400, 396, 395, 397, 398, 399, 380,\r
- /* 440 */ 379, 361, 6, 7, 296, 359, 13, 12, 358, 354,\r
- /* 450 */ 18, 17, 342, 169, 68, 44, 202, 101, 290, 214,\r
- /* 460 */ 168, 135, 353, 355, 356, 19, 30, 100, 208, 317,\r
- /* 470 */ 375, 372, 268, 378, 48, 85, 304, 214, 214, 366,\r
- /* 480 */ 214, 129, 225, 279, 278, 223, 214, 26, 306, 391,\r
- /* 490 */ 52, 50, 66, 300, 301, 312, 61, 21, 173, 65,\r
- /* 500 */ 133, 6, 7, 296, 359, 13, 12, 358, 354, 18,\r
- /* 510 */ 17, 365, 389, 214, 391, 384, 186, 305, 214, 214,\r
- /* 520 */ 181, 353, 355, 356, 214, 319, 6, 7, 296, 359,\r
- /* 530 */ 13, 12, 358, 354, 18, 17, 364, 155, 323, 24,\r
- /* 540 */ 322, 178, 202, 377, 357, 214, 353, 355, 356, 130,\r
- /* 550 */ 214, 214, 6, 7, 296, 359, 13, 12, 358, 354,\r
- /* 560 */ 18, 17, 30, 391, 252, 211, 159, 371, 314, 311,\r
- /* 570 */ 142, 283, 353, 355, 356, 214, 214, 154, 214, 136,\r
- /* 580 */ 6, 7, 296, 359, 13, 12, 358, 354, 18, 17,\r
- /* 590 */ 215, 82, 304, 30, 304, 390, 247, 341, 331, 82,\r
- /* 600 */ 353, 355, 356, 255, 214, 6, 7, 296, 359, 13,\r
- /* 610 */ 12, 358, 354, 18, 17, 214, 70, 202, 45, 235,\r
- /* 620 */ 90, 325, 90, 250, 82, 353, 355, 356, 128, 362,\r
- /* 630 */ 400, 396, 395, 397, 398, 399, 380, 379, 361, 251,\r
- /* 640 */ 205, 107, 391, 202, 45, 145, 6, 7, 296, 359,\r
- /* 650 */ 13, 12, 358, 354, 18, 17, 400, 396, 395, 397,\r
- /* 660 */ 398, 399, 380, 379, 361, 131, 353, 355, 356, 6,\r
- /* 670 */ 7, 296, 359, 13, 12, 358, 354, 18, 17, 391,\r
- /* 680 */ 334, 80, 299, 338, 347, 73, 132, 477, 257, 353,\r
- /* 690 */ 355, 356, 175, 165, 477, 60, 475, 319, 19, 387,\r
- /* 700 */ 391, 322, 387, 214, 151, 163, 180, 234, 304, 233,\r
- /* 710 */ 302, 319, 233, 109, 129, 158, 109, 38, 88, 304,\r
- /* 720 */ 304, 237, 315, 202, 45, 309, 321, 336, 309, 394,\r
- /* 730 */ 304, 386, 202, 45, 386, 276, 400, 396, 395, 397,\r
- /* 740 */ 398, 399, 380, 379, 361, 400, 396, 395, 397, 398,\r
- /* 750 */ 399, 380, 379, 361, 403, 387, 34, 81, 337, 79,\r
- /* 760 */ 318, 214, 387, 197, 183, 233, 74, 272, 124, 109,\r
- /* 770 */ 401, 391, 233, 391, 227, 36, 109, 392, 93, 295,\r
- /* 780 */ 201, 309, 294, 240, 405, 53, 294, 386, 309, 28,\r
- /* 790 */ 202, 45, 363, 102, 386, 329, 71, 20, 111, 381,\r
- /* 800 */ 229, 20, 263, 400, 396, 395, 397, 398, 399, 380,\r
- /* 810 */ 379, 361, 387, 129, 1, 99, 23, 129, 265, 343,\r
- /* 820 */ 204, 320, 233, 55, 105, 57, 109, 43, 280, 214,\r
- /* 830 */ 160, 108, 292, 46, 392, 322, 219, 201, 309, 286,\r
- /* 840 */ 387, 230, 306, 382, 386, 91, 15, 336, 249, 363,\r
- /* 850 */ 233, 77, 284, 117, 109, 336, 336, 243, 336, 37,\r
- /* 860 */ 288, 336, 392, 37, 288, 201, 309, 336, 387, 336,\r
- /* 870 */ 336, 336, 386, 336, 336, 336, 249, 363, 233, 54,\r
- /* 880 */ 110, 58, 109, 336, 336, 336, 336, 336, 336, 336,\r
- /* 890 */ 392, 336, 336, 201, 309, 336, 387, 336, 336, 336,\r
- /* 900 */ 386, 336, 336, 336, 249, 363, 233, 77, 336, 125,\r
- /* 910 */ 109, 336, 336, 336, 336, 336, 336, 336, 392, 336,\r
- /* 920 */ 336, 201, 309, 336, 336, 336, 387, 336, 386, 336,\r
- /* 930 */ 336, 336, 336, 363, 249, 336, 233, 77, 336, 113,\r
- /* 940 */ 109, 336, 336, 336, 336, 387, 336, 336, 392, 336,\r
- /* 950 */ 336, 201, 309, 291, 387, 233, 336, 336, 386, 109,\r
- /* 960 */ 336, 336, 259, 363, 233, 77, 336, 126, 109, 336,\r
- /* 970 */ 336, 309, 336, 336, 336, 336, 392, 386, 336, 201,\r
- /* 980 */ 309, 336, 387, 336, 336, 336, 386, 336, 336, 336,\r
- /* 990 */ 249, 363, 233, 77, 336, 122, 109, 336, 336, 336,\r
- /* 1000 */ 336, 336, 336, 336, 392, 336, 336, 201, 309, 336,\r
- /* 1010 */ 387, 336, 336, 336, 386, 336, 336, 336, 249, 363,\r
- /* 1020 */ 233, 77, 336, 115, 109, 336, 336, 336, 336, 336,\r
- /* 1030 */ 336, 336, 392, 336, 336, 201, 309, 336, 336, 336,\r
- /* 1040 */ 387, 336, 386, 336, 336, 336, 336, 363, 249, 336,\r
- /* 1050 */ 233, 76, 336, 116, 109, 336, 336, 336, 336, 387,\r
- /* 1060 */ 336, 336, 392, 336, 336, 201, 309, 297, 387, 233,\r
- /* 1070 */ 336, 336, 386, 109, 336, 336, 249, 363, 233, 77,\r
- /* 1080 */ 336, 120, 109, 336, 336, 309, 336, 336, 336, 336,\r
- /* 1090 */ 392, 386, 336, 201, 309, 336, 387, 336, 336, 336,\r
- /* 1100 */ 386, 336, 336, 336, 249, 363, 233, 77, 336, 123,\r
- /* 1110 */ 109, 336, 336, 336, 336, 336, 336, 336, 392, 336,\r
- /* 1120 */ 336, 201, 309, 336, 387, 336, 336, 336, 386, 336,\r
- /* 1130 */ 336, 336, 244, 363, 233, 179, 336, 336, 109, 336,\r
- /* 1140 */ 336, 336, 336, 336, 336, 336, 392, 336, 336, 201,\r
- /* 1150 */ 309, 336, 336, 336, 336, 336, 386, 336, 336, 336,\r
- /* 1160 */ 387, 336, 336, 336, 206, 393, 336, 336, 249, 336,\r
- /* 1170 */ 233, 77, 336, 118, 109, 336, 336, 336, 336, 387,\r
- /* 1180 */ 336, 336, 392, 336, 336, 201, 309, 316, 387, 233,\r
- /* 1190 */ 336, 336, 386, 109, 336, 336, 249, 363, 233, 77,\r
- /* 1200 */ 336, 121, 109, 336, 336, 309, 336, 336, 336, 336,\r
- /* 1210 */ 392, 386, 336, 201, 309, 336, 387, 336, 336, 336,\r
- /* 1220 */ 386, 336, 336, 336, 249, 363, 233, 76, 336, 114,\r
- /* 1230 */ 109, 336, 336, 336, 336, 336, 336, 336, 392, 336,\r
- /* 1240 */ 336, 201, 309, 336, 387, 336, 336, 336, 386, 336,\r
- /* 1250 */ 336, 336, 249, 363, 233, 77, 336, 119, 109, 336,\r
- /* 1260 */ 336, 336, 336, 336, 336, 336, 392, 336, 336, 201,\r
- /* 1270 */ 309, 336, 336, 336, 387, 336, 386, 336, 336, 336,\r
- /* 1280 */ 336, 363, 249, 336, 233, 75, 336, 112, 109, 336,\r
- /* 1290 */ 336, 336, 336, 336, 336, 336, 392, 336, 336, 201,\r
- /* 1300 */ 309, 336, 387, 336, 336, 336, 386, 336, 336, 336,\r
- /* 1310 */ 244, 363, 233, 179, 336, 387, 109, 336, 336, 336,\r
- /* 1320 */ 336, 336, 336, 307, 392, 233, 161, 201, 309, 109,\r
- /* 1330 */ 336, 336, 336, 336, 386, 336, 336, 392, 336, 336,\r
- /* 1340 */ 201, 309, 387, 385, 222, 336, 336, 386, 336, 336,\r
- /* 1350 */ 307, 336, 233, 161, 336, 336, 109, 336, 336, 336,\r
- /* 1360 */ 336, 336, 387, 336, 392, 336, 336, 201, 309, 336,\r
- /* 1370 */ 307, 231, 233, 161, 386, 387, 109, 336, 336, 336,\r
- /* 1380 */ 336, 336, 336, 307, 392, 233, 161, 201, 309, 109,\r
- /* 1390 */ 336, 383, 336, 336, 386, 336, 336, 392, 387, 336,\r
- /* 1400 */ 201, 309, 336, 387, 232, 336, 87, 386, 86, 67,\r
- /* 1410 */ 104, 87, 94, 84, 72, 104, 336, 94, 336, 336,\r
- /* 1420 */ 392, 336, 336, 201, 309, 392, 336, 336, 201, 309,\r
- /* 1430 */ 386, 387, 336, 336, 336, 386, 336, 336, 336, 307,\r
- /* 1440 */ 387, 212, 137, 336, 336, 109, 336, 336, 307, 336,\r
- /* 1450 */ 233, 184, 336, 392, 109, 336, 201, 309, 336, 387,\r
- /* 1460 */ 336, 336, 392, 386, 336, 201, 309, 307, 336, 233,\r
- /* 1470 */ 176, 336, 386, 109, 336, 336, 336, 336, 336, 387,\r
- /* 1480 */ 336, 392, 336, 336, 201, 309, 336, 307, 387, 233,\r
- /* 1490 */ 134, 386, 336, 109, 336, 336, 307, 336, 233, 172,\r
- /* 1500 */ 336, 392, 109, 336, 201, 309, 336, 336, 387, 336,\r
- /* 1510 */ 392, 386, 336, 201, 309, 336, 307, 387, 233, 170,\r
- /* 1520 */ 386, 336, 109, 336, 336, 307, 336, 233, 149, 336,\r
- /* 1530 */ 392, 109, 336, 201, 309, 336, 387, 336, 336, 392,\r
- /* 1540 */ 386, 336, 201, 309, 307, 387, 233, 174, 336, 386,\r
- /* 1550 */ 109, 336, 336, 307, 336, 233, 166, 336, 392, 109,\r
- /* 1560 */ 336, 201, 309, 336, 336, 336, 336, 392, 386, 336,\r
- /* 1570 */ 201, 309, 387, 336, 336, 336, 336, 386, 336, 336,\r
- /* 1580 */ 307, 387, 233, 167, 336, 336, 109, 336, 336, 307,\r
- /* 1590 */ 336, 233, 171, 336, 392, 109, 336, 201, 309, 336,\r
- /* 1600 */ 336, 387, 336, 392, 386, 336, 201, 309, 336, 307,\r
- /* 1610 */ 387, 233, 162, 386, 336, 109, 336, 336, 307, 336,\r
- /* 1620 */ 233, 148, 336, 392, 109, 336, 201, 309, 336, 336,\r
- /* 1630 */ 387, 336, 392, 386, 336, 201, 309, 336, 307, 336,\r
- /* 1640 */ 233, 69, 386, 387, 109, 336, 336, 336, 336, 336,\r
- /* 1650 */ 387, 307, 392, 233, 182, 201, 309, 109, 298, 336,\r
- /* 1660 */ 233, 336, 386, 336, 109, 392, 336, 336, 201, 309,\r
- /* 1670 */ 387, 336, 336, 336, 336, 386, 309, 336, 307, 387,\r
- /* 1680 */ 233, 139, 386, 336, 109, 336, 336, 307, 336, 233,\r
- /* 1690 */ 336, 336, 392, 109, 336, 201, 309, 336, 387, 387,\r
- /* 1700 */ 336, 392, 386, 336, 198, 309, 307, 308, 233, 233,\r
- /* 1710 */ 336, 386, 109, 109, 336, 336, 336, 336, 387, 336,\r
- /* 1720 */ 392, 336, 336, 196, 309, 309, 307, 336, 233, 336,\r
- /* 1730 */ 386, 386, 109, 336, 336, 336, 336, 336, 387, 336,\r
- /* 1740 */ 392, 336, 336, 195, 309, 336, 402, 336, 233, 336,\r
- /* 1750 */ 386, 336, 109, 336, 336, 336, 336, 336, 336, 336,\r
- /* 1760 */ 336, 336, 336, 336, 309, 336, 336, 336, 336, 336,\r
- /* 1770 */ 386,\r
- );\r
- static public $yy_lookahead = array(\r
- /* 0 */ 19, 37, 21, 22, 46, 24, 20, 26, 56, 28,\r
- /* 10 */ 29, 25, 54, 27, 41, 20, 35, 36, 6, 7,\r
- /* 20 */ 56, 9, 41, 11, 51, 44, 45, 41, 47, 48,\r
- /* 30 */ 49, 50, 21, 81, 53, 54, 19, 51, 21, 22,\r
- /* 40 */ 2, 3, 56, 5, 96, 28, 84, 85, 86, 87,\r
- /* 50 */ 88, 56, 35, 36, 16, 17, 18, 28, 41, 111,\r
- /* 60 */ 23, 44, 45, 22, 47, 48, 49, 50, 39, 40,\r
- /* 70 */ 53, 54, 55, 19, 126, 21, 22, 36, 2, 3,\r
- /* 80 */ 10, 5, 28, 46, 55, 19, 42, 21, 22, 35,\r
- /* 90 */ 36, 23, 16, 19, 18, 41, 22, 23, 44, 45,\r
- /* 100 */ 56, 47, 48, 49, 50, 31, 38, 53, 54, 19,\r
- /* 110 */ 41, 21, 22, 19, 122, 46, 22, 23, 28, 53,\r
- /* 120 */ 51, 28, 20, 8, 55, 35, 36, 21, 22, 20,\r
- /* 130 */ 28, 41, 39, 40, 44, 45, 27, 47, 48, 49,\r
- /* 140 */ 50, 39, 40, 53, 54, 19, 52, 21, 22, 22,\r
- /* 150 */ 41, 24, 20, 26, 28, 33, 29, 25, 20, 27,\r
- /* 160 */ 51, 35, 36, 19, 20, 27, 22, 41, 20, 31,\r
- /* 170 */ 44, 45, 22, 47, 48, 49, 50, 23, 34, 53,\r
- /* 180 */ 54, 19, 31, 21, 22, 96, 19, 20, 56, 22,\r
- /* 190 */ 28, 102, 21, 22, 107, 41, 19, 35, 36, 22,\r
- /* 200 */ 111, 34, 52, 41, 56, 51, 44, 45, 121, 47,\r
- /* 210 */ 48, 49, 50, 20, 125, 53, 54, 19, 97, 21,\r
- /* 220 */ 22, 34, 101, 23, 53, 25, 28, 19, 41, 52,\r
- /* 230 */ 22, 23, 81, 35, 36, 96, 115, 20, 51, 41,\r
- /* 240 */ 119, 102, 44, 45, 27, 47, 48, 49, 50, 56,\r
- /* 250 */ 111, 53, 54, 19, 19, 21, 22, 25, 19, 20,\r
- /* 260 */ 19, 22, 28, 22, 125, 20, 20, 27, 28, 35,\r
- /* 270 */ 36, 19, 20, 27, 22, 41, 41, 31, 44, 45,\r
- /* 280 */ 96, 47, 48, 49, 50, 68, 102, 53, 54, 19,\r
- /* 290 */ 87, 21, 22, 52, 20, 111, 20, 117, 28, 97,\r
- /* 300 */ 120, 27, 122, 101, 88, 35, 36, 96, 25, 93,\r
- /* 310 */ 94, 41, 31, 102, 44, 45, 96, 47, 48, 49,\r
- /* 320 */ 50, 119, 111, 53, 54, 19, 102, 21, 22, 46,\r
- /* 330 */ 56, 111, 129, 96, 28, 13, 14, 54, 87, 102,\r
- /* 340 */ 38, 35, 36, 123, 68, 91, 92, 41, 111, 125,\r
- /* 350 */ 44, 45, 96, 47, 48, 49, 50, 27, 56, 53,\r
- /* 360 */ 54, 19, 102, 21, 22, 114, 20, 111, 38, 96,\r
- /* 370 */ 28, 86, 87, 88, 33, 102, 88, 35, 36, 123,\r
- /* 380 */ 129, 93, 94, 41, 111, 125, 44, 45, 96, 47,\r
- /* 390 */ 48, 49, 50, 38, 17, 53, 54, 19, 126, 21,\r
- /* 400 */ 22, 96, 20, 111, 20, 20, 28, 102, 20, 27,\r
- /* 410 */ 20, 56, 27, 35, 36, 27, 111, 27, 126, 41,\r
- /* 420 */ 56, 57, 44, 45, 22, 47, 48, 49, 50, 91,\r
- /* 430 */ 92, 53, 34, 69, 70, 71, 72, 73, 74, 75,\r
- /* 440 */ 76, 77, 58, 59, 60, 61, 62, 63, 64, 65,\r
- /* 450 */ 66, 67, 20, 30, 103, 19, 56, 21, 22, 27,\r
- /* 460 */ 37, 96, 78, 79, 80, 19, 19, 21, 22, 22,\r
- /* 470 */ 20, 20, 36, 20, 28, 107, 111, 27, 27, 20,\r
- /* 480 */ 27, 35, 36, 47, 48, 42, 27, 41, 123, 121,\r
- /* 490 */ 44, 45, 118, 47, 48, 49, 50, 37, 30, 53,\r
- /* 500 */ 107, 58, 59, 60, 61, 62, 63, 64, 65, 66,\r
- /* 510 */ 67, 20, 20, 27, 121, 55, 102, 20, 27, 27,\r
- /* 520 */ 117, 78, 79, 80, 27, 122, 58, 59, 60, 61,\r
- /* 530 */ 62, 63, 64, 65, 66, 67, 42, 118, 20, 41,\r
- /* 540 */ 121, 103, 56, 20, 20, 27, 78, 79, 80, 107,\r
- /* 550 */ 27, 27, 58, 59, 60, 61, 62, 63, 64, 65,\r
- /* 560 */ 66, 67, 19, 121, 42, 22, 118, 20, 20, 20,\r
- /* 570 */ 118, 20, 78, 79, 80, 27, 27, 96, 27, 96,\r
- /* 580 */ 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,\r
- /* 590 */ 89, 90, 111, 19, 111, 22, 22, 20, 89, 90,\r
- /* 600 */ 78, 79, 80, 42, 27, 58, 59, 60, 61, 62,\r
- /* 610 */ 63, 64, 65, 66, 67, 27, 103, 56, 57, 91,\r
- /* 620 */ 92, 91, 92, 89, 90, 78, 79, 80, 107, 42,\r
- /* 630 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 104,\r
- /* 640 */ 105, 42, 121, 56, 57, 118, 58, 59, 60, 61,\r
- /* 650 */ 62, 63, 64, 65, 66, 67, 69, 70, 71, 72,\r
- /* 660 */ 73, 74, 75, 76, 77, 107, 78, 79, 80, 58,\r
- /* 670 */ 59, 60, 61, 62, 63, 64, 65, 66, 67, 121,\r
- /* 680 */ 1, 2, 36, 4, 5, 103, 107, 20, 108, 78,\r
- /* 690 */ 79, 80, 117, 96, 27, 16, 20, 122, 19, 87,\r
- /* 700 */ 121, 121, 87, 27, 96, 96, 117, 95, 111, 97,\r
- /* 710 */ 95, 122, 97, 101, 35, 96, 101, 32, 21, 111,\r
- /* 720 */ 111, 109, 22, 56, 57, 113, 22, 3, 113, 42,\r
- /* 730 */ 111, 119, 56, 57, 119, 20, 69, 70, 71, 72,\r
- /* 740 */ 73, 74, 75, 76, 77, 69, 70, 71, 72, 73,\r
- /* 750 */ 74, 75, 76, 77, 20, 87, 43, 107, 15, 107,\r
- /* 760 */ 22, 27, 87, 95, 22, 97, 98, 99, 100, 101,\r
- /* 770 */ 95, 121, 97, 121, 22, 43, 101, 109, 21, 20,\r
- /* 780 */ 112, 113, 4, 38, 109, 68, 4, 119, 113, 23,\r
- /* 790 */ 56, 57, 124, 21, 119, 12, 22, 19, 27, 53,\r
- /* 800 */ 46, 19, 55, 69, 70, 71, 72, 73, 74, 75,\r
- /* 810 */ 76, 77, 87, 35, 23, 21, 41, 35, 42, 111,\r
- /* 820 */ 95, 120, 97, 98, 99, 100, 101, 38, 50, 27,\r
- /* 830 */ 118, 115, 50, 27, 109, 121, 110, 112, 113, 27,\r
- /* 840 */ 87, 106, 123, 53, 119, 21, 106, 130, 95, 124,\r
- /* 850 */ 97, 98, 104, 100, 101, 130, 130, 104, 130, 81,\r
- /* 860 */ 82, 130, 109, 81, 82, 112, 113, 130, 87, 130,\r
- /* 870 */ 130, 130, 119, 130, 130, 130, 95, 124, 97, 98,\r
- /* 880 */ 99, 100, 101, 130, 130, 130, 130, 130, 130, 130,\r
- /* 890 */ 109, 130, 130, 112, 113, 130, 87, 130, 130, 130,\r
- /* 900 */ 119, 130, 130, 130, 95, 124, 97, 98, 130, 100,\r
- /* 910 */ 101, 130, 130, 130, 130, 130, 130, 130, 109, 130,\r
- /* 920 */ 130, 112, 113, 130, 130, 130, 87, 130, 119, 130,\r
- /* 930 */ 130, 130, 130, 124, 95, 130, 97, 98, 130, 100,\r
- /* 940 */ 101, 130, 130, 130, 130, 87, 130, 130, 109, 130,\r
- /* 950 */ 130, 112, 113, 95, 87, 97, 130, 130, 119, 101,\r
- /* 960 */ 130, 130, 95, 124, 97, 98, 130, 100, 101, 130,\r
- /* 970 */ 130, 113, 130, 130, 130, 130, 109, 119, 130, 112,\r
- /* 980 */ 113, 130, 87, 130, 130, 130, 119, 130, 130, 130,\r
- /* 990 */ 95, 124, 97, 98, 130, 100, 101, 130, 130, 130,\r
- /* 1000 */ 130, 130, 130, 130, 109, 130, 130, 112, 113, 130,\r
- /* 1010 */ 87, 130, 130, 130, 119, 130, 130, 130, 95, 124,\r
- /* 1020 */ 97, 98, 130, 100, 101, 130, 130, 130, 130, 130,\r
- /* 1030 */ 130, 130, 109, 130, 130, 112, 113, 130, 130, 130,\r
- /* 1040 */ 87, 130, 119, 130, 130, 130, 130, 124, 95, 130,\r
- /* 1050 */ 97, 98, 130, 100, 101, 130, 130, 130, 130, 87,\r
- /* 1060 */ 130, 130, 109, 130, 130, 112, 113, 95, 87, 97,\r
- /* 1070 */ 130, 130, 119, 101, 130, 130, 95, 124, 97, 98,\r
- /* 1080 */ 130, 100, 101, 130, 130, 113, 130, 130, 130, 130,\r
- /* 1090 */ 109, 119, 130, 112, 113, 130, 87, 130, 130, 130,\r
- /* 1100 */ 119, 130, 130, 130, 95, 124, 97, 98, 130, 100,\r
- /* 1110 */ 101, 130, 130, 130, 130, 130, 130, 130, 109, 130,\r
- /* 1120 */ 130, 112, 113, 130, 87, 130, 130, 130, 119, 130,\r
- /* 1130 */ 130, 130, 95, 124, 97, 98, 130, 130, 101, 130,\r
- /* 1140 */ 130, 130, 130, 130, 130, 130, 109, 130, 130, 112,\r
- /* 1150 */ 113, 130, 130, 130, 130, 130, 119, 130, 130, 130,\r
- /* 1160 */ 87, 130, 130, 130, 127, 128, 130, 130, 95, 130,\r
- /* 1170 */ 97, 98, 130, 100, 101, 130, 130, 130, 130, 87,\r
- /* 1180 */ 130, 130, 109, 130, 130, 112, 113, 95, 87, 97,\r
- /* 1190 */ 130, 130, 119, 101, 130, 130, 95, 124, 97, 98,\r
- /* 1200 */ 130, 100, 101, 130, 130, 113, 130, 130, 130, 130,\r
- /* 1210 */ 109, 119, 130, 112, 113, 130, 87, 130, 130, 130,\r
- /* 1220 */ 119, 130, 130, 130, 95, 124, 97, 98, 130, 100,\r
- /* 1230 */ 101, 130, 130, 130, 130, 130, 130, 130, 109, 130,\r
- /* 1240 */ 130, 112, 113, 130, 87, 130, 130, 130, 119, 130,\r
- /* 1250 */ 130, 130, 95, 124, 97, 98, 130, 100, 101, 130,\r
- /* 1260 */ 130, 130, 130, 130, 130, 130, 109, 130, 130, 112,\r
- /* 1270 */ 113, 130, 130, 130, 87, 130, 119, 130, 130, 130,\r
- /* 1280 */ 130, 124, 95, 130, 97, 98, 130, 100, 101, 130,\r
- /* 1290 */ 130, 130, 130, 130, 130, 130, 109, 130, 130, 112,\r
- /* 1300 */ 113, 130, 87, 130, 130, 130, 119, 130, 130, 130,\r
- /* 1310 */ 95, 124, 97, 98, 130, 87, 101, 130, 130, 130,\r
- /* 1320 */ 130, 130, 130, 95, 109, 97, 98, 112, 113, 101,\r
- /* 1330 */ 130, 130, 130, 130, 119, 130, 130, 109, 130, 130,\r
- /* 1340 */ 112, 113, 87, 128, 116, 130, 130, 119, 130, 130,\r
- /* 1350 */ 95, 130, 97, 98, 130, 130, 101, 130, 130, 130,\r
- /* 1360 */ 130, 130, 87, 130, 109, 130, 130, 112, 113, 130,\r
- /* 1370 */ 95, 116, 97, 98, 119, 87, 101, 130, 130, 130,\r
- /* 1380 */ 130, 130, 130, 95, 109, 97, 98, 112, 113, 101,\r
- /* 1390 */ 130, 116, 130, 130, 119, 130, 130, 109, 87, 130,\r
- /* 1400 */ 112, 113, 130, 87, 116, 130, 95, 119, 97, 98,\r
- /* 1410 */ 99, 95, 101, 97, 98, 99, 130, 101, 130, 130,\r
- /* 1420 */ 109, 130, 130, 112, 113, 109, 130, 130, 112, 113,\r
- /* 1430 */ 119, 87, 130, 130, 130, 119, 130, 130, 130, 95,\r
- /* 1440 */ 87, 97, 98, 130, 130, 101, 130, 130, 95, 130,\r
- /* 1450 */ 97, 98, 130, 109, 101, 130, 112, 113, 130, 87,\r
- /* 1460 */ 130, 130, 109, 119, 130, 112, 113, 95, 130, 97,\r
- /* 1470 */ 98, 130, 119, 101, 130, 130, 130, 130, 130, 87,\r
- /* 1480 */ 130, 109, 130, 130, 112, 113, 130, 95, 87, 97,\r
- /* 1490 */ 98, 119, 130, 101, 130, 130, 95, 130, 97, 98,\r
- /* 1500 */ 130, 109, 101, 130, 112, 113, 130, 130, 87, 130,\r
- /* 1510 */ 109, 119, 130, 112, 113, 130, 95, 87, 97, 98,\r
- /* 1520 */ 119, 130, 101, 130, 130, 95, 130, 97, 98, 130,\r
- /* 1530 */ 109, 101, 130, 112, 113, 130, 87, 130, 130, 109,\r
- /* 1540 */ 119, 130, 112, 113, 95, 87, 97, 98, 130, 119,\r
- /* 1550 */ 101, 130, 130, 95, 130, 97, 98, 130, 109, 101,\r
- /* 1560 */ 130, 112, 113, 130, 130, 130, 130, 109, 119, 130,\r
- /* 1570 */ 112, 113, 87, 130, 130, 130, 130, 119, 130, 130,\r
- /* 1580 */ 95, 87, 97, 98, 130, 130, 101, 130, 130, 95,\r
- /* 1590 */ 130, 97, 98, 130, 109, 101, 130, 112, 113, 130,\r
- /* 1600 */ 130, 87, 130, 109, 119, 130, 112, 113, 130, 95,\r
- /* 1610 */ 87, 97, 98, 119, 130, 101, 130, 130, 95, 130,\r
- /* 1620 */ 97, 98, 130, 109, 101, 130, 112, 113, 130, 130,\r
- /* 1630 */ 87, 130, 109, 119, 130, 112, 113, 130, 95, 130,\r
- /* 1640 */ 97, 98, 119, 87, 101, 130, 130, 130, 130, 130,\r
- /* 1650 */ 87, 95, 109, 97, 98, 112, 113, 101, 95, 130,\r
- /* 1660 */ 97, 130, 119, 130, 101, 109, 130, 130, 112, 113,\r
- /* 1670 */ 87, 130, 130, 130, 130, 119, 113, 130, 95, 87,\r
- /* 1680 */ 97, 98, 119, 130, 101, 130, 130, 95, 130, 97,\r
- /* 1690 */ 130, 130, 109, 101, 130, 112, 113, 130, 87, 87,\r
- /* 1700 */ 130, 109, 119, 130, 112, 113, 95, 95, 97, 97,\r
- /* 1710 */ 130, 119, 101, 101, 130, 130, 130, 130, 87, 130,\r
- /* 1720 */ 109, 130, 130, 112, 113, 113, 95, 130, 97, 130,\r
- /* 1730 */ 119, 119, 101, 130, 130, 130, 130, 130, 87, 130,\r
- /* 1740 */ 109, 130, 130, 112, 113, 130, 95, 130, 97, 130,\r
- /* 1750 */ 119, 130, 101, 130, 130, 130, 130, 130, 130, 130,\r
- /* 1760 */ 130, 130, 130, 130, 113, 130, 130, 130, 130, 130,\r
- /* 1770 */ 119,\r
-);\r
- const YY_SHIFT_USE_DFLT = -49;\r
- const YY_SHIFT_MAX = 260;\r
- static public $yy_shift_ofst = array(\r
- /* 0 */ 679, 270, 342, 306, 342, 90, 90, 90, 90, 90,\r
- /* 10 */ 90, 90, 90, 90, 126, 90, 90, 90, 90, -19,\r
- /* 20 */ -19, 126, 54, 54, 54, 54, 54, 54, 54, 54,\r
- /* 30 */ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,\r
- /* 40 */ 54, 54, 17, 162, 198, 198, 234, 378, 378, 378,\r
- /* 50 */ 378, 378, 378, 446, 676, 734, 66, 588, 588, 679,\r
- /* 60 */ 38, 782, -14, 76, 132, 171, 283, 274, 330, 486,\r
- /* 70 */ 330, 486, 486, 330, 667, 587, 561, 364, 778, 74,\r
- /* 80 */ 12, 94, 12, 12, 138, 177, 246, 577, 447, 574,\r
- /* 90 */ 322, 447, 322, 447, 200, 322, 322, 447, 543, 447,\r
- /* 100 */ 447, 447, 447, 574, 802, 802, 806, 232, 232, 232,\r
- /* 110 */ 802, 824, 494, 384, 522, 468, 443, 547, 611, 611,\r
- /* 120 */ 611, 611, 611, 611, 611, 611, 611, 167, 144, 127,\r
- /* 130 */ 239, 208, 241, 252, 302, 390, 432, -48, 382, -5,\r
- /* 140 */ 385, 388, -42, 106, 551, -42, 450, 497, 193, 44,\r
- /* 150 */ 491, 492, 518, 523, 549, -42, 548, 235, 524, -42,\r
- /* 160 */ -42, -36, 355, 459, 453, 451, 148, 400, 824, 812,\r
- /* 170 */ 400, 400, 400, 812, 400, 232, 400, 232, 789, 400,\r
- /* 180 */ 232, 232, 400, 498, 400, -49, -49, -49, -49, -49,\r
- /* 190 */ -49, -49, 436, 109, 69, 29, 102, 217, 93, 187,\r
- /* 200 */ 154, 93, 150, -27, 276, 423, 460, 37, -27, -27,\r
- /* 210 */ 240, 68, 151, -27, 41, 743, 738, 742, 757, 715,\r
- /* 220 */ 697, 704, 687, 732, 771, 754, 791, 747, 774, 646,\r
- /* 230 */ 772, 776, 599, 281, 341, 70, 11, 122, 115, 402,\r
- /* 240 */ 573, 790, 377, 245, 398, 346, 746, 745, 794, 717,\r
- /* 250 */ 724, 685, 732, 766, 752, 713, 700, 759, 775, 717,\r
- /* 260 */ 783,\r
-);\r
- const YY_REDUCE_USE_DFLT = -53;\r
- const YY_REDUCE_MAX = 191;\r
- static public $yy_reduce_ofst = array(\r
- /* 0 */ -38, 668, 725, 753, 781, 1187, 895, 1157, 867, 809,\r
- /* 10 */ 839, 953, 981, 1101, 1037, 923, 1129, 1009, 1073, 1316,\r
- /* 20 */ 1311, 1215, 1228, 1255, 1288, 1275, 1430, 1458, 1556, 1583,\r
- /* 30 */ 1523, 1449, 1485, 1494, 1514, 1421, 1392, 1344, 1543, 1353,\r
- /* 40 */ 1372, 1401, 1631, 1592, 1611, 675, 612, 1612, 615, 858,\r
- /* 50 */ 972, 1092, 1563, 1651, 89, 139, 121, -52, 292, 285,\r
- /* 60 */ 216, 251, 305, 288, 273, 202, 180, 184, 220, 211,\r
- /* 70 */ 256, 237, 184, 365, 260, 224, 260, 224, 203, 580,\r
- /* 80 */ 534, 419, 509, 501, 481, 419, 481, 483, 521, 368,\r
- /* 90 */ 530, 558, 528, 442, 403, 254, 338, 87, 368, 393,\r
- /* 100 */ 368, 579, 652, 650, 608, 619, 597, 575, 589, 403,\r
- /* 110 */ 609, 535, 272, 272, 272, 272, 272, 272, 272, 272,\r
- /* 120 */ 272, 272, 272, 272, 272, 272, 272, 714, 714, 726,\r
- /* 130 */ 714, 714, 714, 714, 414, 708, 708, 414, 708, 414,\r
- /* 140 */ 708, 708, 701, 716, 708, 701, 708, 708, 414, 414,\r
- /* 150 */ 708, 708, 708, 708, 708, 701, 708, 712, 708, 701,\r
- /* 160 */ 701, 414, 414, 708, 708, 708, 414, 414, 748, 740,\r
- /* 170 */ 414, 414, 414, 735, 414, -8, 414, -8, 719, 414,\r
- /* 180 */ -8, -8, 414, 374, 414, 351, 438, 448, 527, 582,\r
- /* 190 */ 513, 452,\r
-);\r
- static public $yyExpectedTokens = array(\r
- /* 0 */ array(1, 2, 4, 5, 16, 19, 35, ),\r
- /* 1 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 2 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 3 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 4 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 5 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 6 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 7 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 8 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 9 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 10 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 11 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 12 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 13 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 14 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 15 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 16 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 17 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 18 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 19 */ array(19, 21, 22, 24, 26, 28, 29, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 20 */ array(19, 21, 22, 24, 26, 28, 29, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 21 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 22 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 23 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 24 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 25 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 26 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 27 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 28 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 29 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 30 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 31 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 32 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 33 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 34 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 35 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 36 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 37 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 38 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 39 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 40 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 41 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 42 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, 55, ),\r
- /* 43 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 44 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 45 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 46 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, 54, ),\r
- /* 47 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, ),\r
- /* 48 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, ),\r
- /* 49 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, ),\r
- /* 50 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, ),\r
- /* 51 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, ),\r
- /* 52 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, ),\r
- /* 53 */ array(19, 21, 22, 28, 35, 36, 41, 44, 45, 47, 48, 49, 50, 53, ),\r
- /* 54 */ array(20, 27, 56, 57, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),\r
- /* 55 */ array(20, 27, 56, 57, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),\r
- /* 56 */ array(19, 21, 22, 53, ),\r
- /* 57 */ array(27, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 58 */ array(27, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 59 */ array(1, 2, 4, 5, 16, 19, 35, ),\r
- /* 60 */ array(2, 3, 5, 16, 17, 18, ),\r
- /* 61 */ array(4, 19, 35, 50, 81, 82, ),\r
- /* 62 */ array(20, 25, 27, 41, 51, 56, ),\r
- /* 63 */ array(2, 3, 5, 16, 18, ),\r
- /* 64 */ array(20, 25, 27, 56, ),\r
- /* 65 */ array(21, 22, 53, ),\r
- /* 66 */ array(25, 46, 54, ),\r
- /* 67 */ array(20, 27, 56, ),\r
- /* 68 */ array(27, 38, ),\r
- /* 69 */ array(27, 56, ),\r
- /* 70 */ array(27, 38, ),\r
- /* 71 */ array(27, 56, ),\r
- /* 72 */ array(27, 56, ),\r
- /* 73 */ array(27, 38, ),\r
- /* 74 */ array(20, 27, 56, 57, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),\r
- /* 75 */ array(42, 56, 57, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),\r
- /* 76 */ array(42, 56, 57, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),\r
- /* 77 */ array(56, 57, 69, 70, 71, 72, 73, 74, 75, 76, 77, ),\r
- /* 78 */ array(4, 19, 35, 50, 81, 82, ),\r
- /* 79 */ array(19, 22, 23, 31, ),\r
- /* 80 */ array(6, 7, 9, 11, ),\r
- /* 81 */ array(19, 22, 23, 52, ),\r
- /* 82 */ array(6, 7, 9, 11, ),\r
- /* 83 */ array(6, 7, 9, 11, ),\r
- /* 84 */ array(20, 27, 31, ),\r
- /* 85 */ array(19, 22, 52, ),\r
- /* 86 */ array(20, 27, 31, ),\r
- /* 87 */ array(20, 27, ),\r
- /* 88 */ array(19, 22, ),\r
- /* 89 */ array(19, 22, ),\r
- /* 90 */ array(13, 14, ),\r
- /* 91 */ array(19, 22, ),\r
- /* 92 */ array(13, 14, ),\r
- /* 93 */ array(19, 22, ),\r
- /* 94 */ array(23, 25, ),\r
- /* 95 */ array(13, 14, ),\r
- /* 96 */ array(13, 14, ),\r
- /* 97 */ array(19, 22, ),\r
- /* 98 */ array(19, 22, ),\r
- /* 99 */ array(19, 22, ),\r
- /* 100 */ array(19, 22, ),\r
- /* 101 */ array(19, 22, ),\r
- /* 102 */ array(19, 22, ),\r
- /* 103 */ array(19, 22, ),\r
- /* 104 */ array(27, ),\r
- /* 105 */ array(27, ),\r
- /* 106 */ array(27, ),\r
- /* 107 */ array(25, ),\r
- /* 108 */ array(25, ),\r
- /* 109 */ array(25, ),\r
- /* 110 */ array(27, ),\r
- /* 111 */ array(21, ),\r
- /* 112 */ array(42, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 113 */ array(20, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 114 */ array(42, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 115 */ array(30, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 116 */ array(42, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 117 */ array(20, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 118 */ array(58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 119 */ array(58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 120 */ array(58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 121 */ array(58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 122 */ array(58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 123 */ array(58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 124 */ array(58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 125 */ array(58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 126 */ array(58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 78, 79, 80, ),\r
- /* 127 */ array(19, 20, 22, 34, ),\r
- /* 128 */ array(19, 20, 22, 34, ),\r
- /* 129 */ array(22, 24, 26, 29, ),\r
- /* 130 */ array(19, 20, 22, ),\r
- /* 131 */ array(19, 22, 23, ),\r
- /* 132 */ array(19, 22, 52, ),\r
- /* 133 */ array(19, 20, 22, ),\r
- /* 134 */ array(38, 56, ),\r
- /* 135 */ array(20, 27, ),\r
- /* 136 */ array(20, 27, ),\r
- /* 137 */ array(56, 81, ),\r
- /* 138 */ array(20, 27, ),\r
- /* 139 */ array(20, 56, ),\r
- /* 140 */ array(20, 27, ),\r
- /* 141 */ array(20, 27, ),\r
- /* 142 */ array(46, 54, ),\r
- /* 143 */ array(21, 22, ),\r
- /* 144 */ array(20, 27, ),\r
- /* 145 */ array(46, 54, ),\r
- /* 146 */ array(20, 27, ),\r
- /* 147 */ array(20, 27, ),\r
- /* 148 */ array(20, 56, ),\r
- /* 149 */ array(42, 56, ),\r
- /* 150 */ array(20, 27, ),\r
- /* 151 */ array(20, 27, ),\r
- /* 152 */ array(20, 27, ),\r
- /* 153 */ array(20, 27, ),\r
- /* 154 */ array(20, 27, ),\r
- /* 155 */ array(46, 54, ),\r
- /* 156 */ array(20, 27, ),\r
- /* 157 */ array(19, 41, ),\r
- /* 158 */ array(20, 27, ),\r
- /* 159 */ array(46, 54, ),\r
- /* 160 */ array(46, 54, ),\r
- /* 161 */ array(37, 56, ),\r
- /* 162 */ array(38, 56, ),\r
- /* 163 */ array(20, 27, ),\r
- /* 164 */ array(20, 27, ),\r
- /* 165 */ array(20, 27, ),\r
- /* 166 */ array(20, 56, ),\r
- /* 167 */ array(56, ),\r
- /* 168 */ array(21, ),\r
- /* 169 */ array(27, ),\r
- /* 170 */ array(56, ),\r
- /* 171 */ array(56, ),\r
- /* 172 */ array(56, ),\r
- /* 173 */ array(27, ),\r
- /* 174 */ array(56, ),\r
- /* 175 */ array(25, ),\r
- /* 176 */ array(56, ),\r
- /* 177 */ array(25, ),\r
- /* 178 */ array(38, ),\r
- /* 179 */ array(56, ),\r
- /* 180 */ array(25, ),\r
- /* 181 */ array(25, ),\r
- /* 182 */ array(56, ),\r
- /* 183 */ array(41, ),\r
- /* 184 */ array(56, ),\r
- /* 185 */ array(),\r
- /* 186 */ array(),\r
- /* 187 */ array(),\r
- /* 188 */ array(),\r
- /* 189 */ array(),\r
- /* 190 */ array(),\r
- /* 191 */ array(),\r
- /* 192 */ array(19, 21, 22, 36, 47, 48, ),\r
- /* 193 */ array(20, 27, 41, 51, ),\r
- /* 194 */ array(41, 46, 51, 55, ),\r
- /* 195 */ array(28, 39, 40, 55, ),\r
- /* 196 */ array(20, 28, 39, 40, ),\r
- /* 197 */ array(20, 27, 68, ),\r
- /* 198 */ array(28, 39, 40, ),\r
- /* 199 */ array(34, 41, 51, ),\r
- /* 200 */ array(23, 41, 51, ),\r
- /* 201 */ array(28, 39, 40, ),\r
- /* 202 */ array(22, 52, ),\r
- /* 203 */ array(41, 51, ),\r
- /* 204 */ array(20, 68, ),\r
- /* 205 */ array(30, 37, ),\r
- /* 206 */ array(37, 55, ),\r
- /* 207 */ array(23, 46, ),\r
- /* 208 */ array(41, 51, ),\r
- /* 209 */ array(41, 51, ),\r
- /* 210 */ array(27, 28, ),\r
- /* 211 */ array(23, 38, ),\r
- /* 212 */ array(31, 81, ),\r
- /* 213 */ array(41, 51, ),\r
- /* 214 */ array(22, 36, ),\r
- /* 215 */ array(15, ),\r
- /* 216 */ array(22, ),\r
- /* 217 */ array(22, ),\r
- /* 218 */ array(21, ),\r
- /* 219 */ array(20, ),\r
- /* 220 */ array(21, ),\r
- /* 221 */ array(22, ),\r
- /* 222 */ array(42, ),\r
- /* 223 */ array(43, ),\r
- /* 224 */ array(27, ),\r
- /* 225 */ array(46, ),\r
- /* 226 */ array(23, ),\r
- /* 227 */ array(55, ),\r
- /* 228 */ array(22, ),\r
- /* 229 */ array(36, ),\r
- /* 230 */ array(21, ),\r
- /* 231 */ array(42, ),\r
- /* 232 */ array(42, ),\r
- /* 233 */ array(31, ),\r
- /* 234 */ array(33, ),\r
- /* 235 */ array(10, ),\r
- /* 236 */ array(21, ),\r
- /* 237 */ array(33, ),\r
- /* 238 */ array(8, ),\r
- /* 239 */ array(22, ),\r
- /* 240 */ array(22, ),\r
- /* 241 */ array(53, ),\r
- /* 242 */ array(17, ),\r
- /* 243 */ array(20, ),\r
- /* 244 */ array(34, ),\r
- /* 245 */ array(20, ),\r
- /* 246 */ array(53, ),\r
- /* 247 */ array(38, ),\r
- /* 248 */ array(21, ),\r
- /* 249 */ array(68, ),\r
- /* 250 */ array(3, ),\r
- /* 251 */ array(32, ),\r
- /* 252 */ array(43, ),\r
- /* 253 */ array(23, ),\r
- /* 254 */ array(22, ),\r
- /* 255 */ array(43, ),\r
- /* 256 */ array(22, ),\r
- /* 257 */ array(20, ),\r
- /* 258 */ array(41, ),\r
- /* 259 */ array(68, ),\r
- /* 260 */ array(12, ),\r
- /* 261 */ array(),\r
- /* 262 */ array(),\r
- /* 263 */ array(),\r
- /* 264 */ array(),\r
- /* 265 */ array(),\r
- /* 266 */ array(),\r
- /* 267 */ array(),\r
- /* 268 */ array(),\r
- /* 269 */ array(),\r
- /* 270 */ array(),\r
- /* 271 */ array(),\r
- /* 272 */ array(),\r
- /* 273 */ array(),\r
- /* 274 */ array(),\r
- /* 275 */ array(),\r
- /* 276 */ array(),\r
- /* 277 */ array(),\r
- /* 278 */ array(),\r
- /* 279 */ array(),\r
- /* 280 */ array(),\r
- /* 281 */ array(),\r
- /* 282 */ array(),\r
- /* 283 */ array(),\r
- /* 284 */ array(),\r
- /* 285 */ array(),\r
- /* 286 */ array(),\r
- /* 287 */ array(),\r
- /* 288 */ array(),\r
- /* 289 */ array(),\r
- /* 290 */ array(),\r
- /* 291 */ array(),\r
- /* 292 */ array(),\r
- /* 293 */ array(),\r
- /* 294 */ array(),\r
- /* 295 */ array(),\r
- /* 296 */ array(),\r
- /* 297 */ array(),\r
- /* 298 */ array(),\r
- /* 299 */ array(),\r
- /* 300 */ array(),\r
- /* 301 */ array(),\r
- /* 302 */ array(),\r
- /* 303 */ array(),\r
- /* 304 */ array(),\r
- /* 305 */ array(),\r
- /* 306 */ array(),\r
- /* 307 */ array(),\r
- /* 308 */ array(),\r
- /* 309 */ array(),\r
- /* 310 */ array(),\r
- /* 311 */ array(),\r
- /* 312 */ array(),\r
- /* 313 */ array(),\r
- /* 314 */ array(),\r
- /* 315 */ array(),\r
- /* 316 */ array(),\r
- /* 317 */ array(),\r
- /* 318 */ array(),\r
- /* 319 */ array(),\r
- /* 320 */ array(),\r
- /* 321 */ array(),\r
- /* 322 */ array(),\r
- /* 323 */ array(),\r
- /* 324 */ array(),\r
- /* 325 */ array(),\r
- /* 326 */ array(),\r
- /* 327 */ array(),\r
- /* 328 */ array(),\r
- /* 329 */ array(),\r
- /* 330 */ array(),\r
- /* 331 */ array(),\r
- /* 332 */ array(),\r
- /* 333 */ array(),\r
- /* 334 */ array(),\r
- /* 335 */ array(),\r
- /* 336 */ array(),\r
- /* 337 */ array(),\r
- /* 338 */ array(),\r
- /* 339 */ array(),\r
- /* 340 */ array(),\r
- /* 341 */ array(),\r
- /* 342 */ array(),\r
- /* 343 */ array(),\r
- /* 344 */ array(),\r
- /* 345 */ array(),\r
- /* 346 */ array(),\r
- /* 347 */ array(),\r
- /* 348 */ array(),\r
- /* 349 */ array(),\r
- /* 350 */ array(),\r
- /* 351 */ array(),\r
- /* 352 */ array(),\r
- /* 353 */ array(),\r
- /* 354 */ array(),\r
- /* 355 */ array(),\r
- /* 356 */ array(),\r
- /* 357 */ array(),\r
- /* 358 */ array(),\r
- /* 359 */ array(),\r
- /* 360 */ array(),\r
- /* 361 */ array(),\r
- /* 362 */ array(),\r
- /* 363 */ array(),\r
- /* 364 */ array(),\r
- /* 365 */ array(),\r
- /* 366 */ array(),\r
- /* 367 */ array(),\r
- /* 368 */ array(),\r
- /* 369 */ array(),\r
- /* 370 */ array(),\r
- /* 371 */ array(),\r
- /* 372 */ array(),\r
- /* 373 */ array(),\r
- /* 374 */ array(),\r
- /* 375 */ array(),\r
- /* 376 */ array(),\r
- /* 377 */ array(),\r
- /* 378 */ array(),\r
- /* 379 */ array(),\r
- /* 380 */ array(),\r
- /* 381 */ array(),\r
- /* 382 */ array(),\r
- /* 383 */ array(),\r
- /* 384 */ array(),\r
- /* 385 */ array(),\r
- /* 386 */ array(),\r
- /* 387 */ array(),\r
- /* 388 */ array(),\r
- /* 389 */ array(),\r
- /* 390 */ array(),\r
- /* 391 */ array(),\r
- /* 392 */ array(),\r
- /* 393 */ array(),\r
- /* 394 */ array(),\r
- /* 395 */ array(),\r
- /* 396 */ array(),\r
- /* 397 */ array(),\r
- /* 398 */ array(),\r
- /* 399 */ array(),\r
- /* 400 */ array(),\r
- /* 401 */ array(),\r
- /* 402 */ array(),\r
- /* 403 */ array(),\r
- /* 404 */ array(),\r
- /* 405 */ array(),\r
- /* 406 */ array(),\r
-);\r
- static public $yy_default = array(\r
- /* 0 */ 611, 611, 611, 611, 611, 611, 611, 611, 611, 611,\r
- /* 10 */ 611, 611, 611, 611, 596, 611, 611, 611, 611, 611,\r
- /* 20 */ 611, 611, 554, 554, 554, 554, 611, 611, 611, 611,\r
- /* 30 */ 611, 611, 611, 611, 611, 611, 611, 611, 611, 611,\r
- /* 40 */ 611, 611, 611, 611, 611, 611, 611, 611, 611, 611,\r
- /* 50 */ 611, 611, 611, 611, 564, 564, 611, 475, 475, 407,\r
- /* 60 */ 611, 611, 611, 429, 611, 611, 516, 611, 475, 475,\r
- /* 70 */ 475, 475, 475, 475, 564, 564, 564, 564, 611, 611,\r
- /* 80 */ 417, 526, 417, 417, 497, 526, 497, 490, 611, 611,\r
- /* 90 */ 423, 611, 423, 611, 519, 423, 423, 611, 611, 611,\r
- /* 100 */ 611, 611, 611, 611, 475, 475, 475, 512, 511, 519,\r
- /* 110 */ 475, 611, 611, 611, 611, 611, 611, 611, 577, 570,\r
- /* 120 */ 574, 573, 569, 578, 478, 568, 562, 611, 611, 611,\r
- /* 130 */ 611, 611, 527, 611, 611, 611, 611, 611, 611, 611,\r
- /* 140 */ 611, 611, 546, 611, 611, 548, 611, 611, 611, 611,\r
- /* 150 */ 611, 611, 611, 611, 611, 524, 611, 526, 611, 547,\r
- /* 160 */ 545, 553, 611, 611, 611, 611, 611, 485, 611, 610,\r
- /* 170 */ 496, 458, 495, 610, 597, 514, 598, 517, 489, 599,\r
- /* 180 */ 513, 542, 482, 526, 565, 558, 558, 526, 526, 558,\r
- /* 190 */ 558, 526, 611, 486, 611, 611, 611, 490, 559, 486,\r
- /* 200 */ 481, 487, 611, 560, 490, 611, 611, 502, 579, 486,\r
- /* 210 */ 611, 540, 497, 611, 611, 611, 611, 611, 611, 611,\r
- /* 220 */ 611, 611, 611, 611, 611, 502, 481, 611, 611, 611,\r
- /* 230 */ 611, 611, 611, 497, 611, 611, 611, 611, 611, 611,\r
- /* 240 */ 611, 611, 611, 611, 490, 611, 611, 540, 611, 490,\r
- /* 250 */ 611, 483, 563, 611, 611, 507, 611, 611, 515, 490,\r
- /* 260 */ 611, 455, 601, 535, 537, 551, 534, 536, 532, 533,\r
- /* 270 */ 549, 472, 480, 408, 469, 468, 466, 467, 531, 530,\r
- /* 280 */ 509, 600, 603, 460, 484, 459, 609, 602, 604, 541,\r
- /* 290 */ 529, 493, 510, 607, 608, 457, 571, 500, 499, 503,\r
- /* 300 */ 504, 505, 498, 501, 474, 471, 557, 490, 491, 506,\r
- /* 310 */ 544, 437, 508, 605, 438, 555, 492, 540, 520, 543,\r
- /* 320 */ 525, 528, 539, 470, 465, 422, 419, 424, 420, 421,\r
- /* 330 */ 418, 416, 410, 409, 411, 412, 413, 425, 414, 434,\r
- /* 340 */ 433, 435, 436, 473, 432, 431, 426, 415, 427, 428,\r
- /* 350 */ 430, 556, 606, 590, 576, 591, 592, 444, 575, 572,\r
- /* 360 */ 443, 589, 507, 561, 563, 445, 446, 462, 461, 463,\r
- /* 370 */ 464, 454, 449, 452, 448, 447, 450, 451, 453, 588,\r
- /* 380 */ 587, 523, 522, 552, 593, 595, 521, 518, 440, 439,\r
- /* 390 */ 488, 538, 494, 594, 550, 583, 582, 584, 585, 586,\r
- /* 400 */ 581, 567, 580, 441, 442, 566, 456,\r
-);\r
- const YYNOCODE = 131;\r
- const YYSTACKDEPTH = 100;\r
- const YYNSTATE = 407;\r
- const YYNRULE = 204;\r
- const YYERRORSYMBOL = 83;\r
- const YYERRSYMDT = 'yy0';\r
- const YYFALLBACK = 0;\r
- static public $yyFallback = array(\r
- );\r
- static function Trace($TraceFILE, $zTracePrompt)\r
- {\r
- if (!$TraceFILE) {\r
- $zTracePrompt = 0;\r
- } elseif (!$zTracePrompt) {\r
- $TraceFILE = 0;\r
- }\r
- self::$yyTraceFILE = $TraceFILE;\r
- self::$yyTracePrompt = $zTracePrompt;\r
- }\r
-\r
- static function PrintTrace()\r
- {\r
- self::$yyTraceFILE = fopen('php://output', 'w');\r
- self::$yyTracePrompt = '<br>';\r
- }\r
-\r
- static public $yyTraceFILE;\r
- static public $yyTracePrompt;\r
- public $yyidx; /* Index of top element in stack */\r
- public $yyerrcnt; /* Shifts left before out of the error */\r
- public $yystack = array(); /* The parser's stack */\r
-\r
- public $yyTokenName = array( \r
- '$', 'COMMENT', 'PHPSTARTTAG', 'PHPENDTAG', \r
- 'OTHER', 'FAKEPHPSTARTTAG', 'PHP_CODE', 'PHP_CODE_START_DOUBLEQUOTE',\r
- 'PHP_CODE_DOUBLEQUOTE', 'PHP_HEREDOC_START', 'PHP_HEREDOC_END', 'PHP_NOWDOC_START',\r
- 'PHP_NOWDOC_END', 'PHP_DQ_CONTENT', 'PHP_DQ_EMBED_START', 'PHP_DQ_EMBED_END',\r
- 'LITERALSTART', 'LITERALEND', 'LITERAL', 'LDEL', \r
- 'RDEL', 'DOLLAR', 'ID', 'EQUAL', \r
- 'FOREACH', 'PTR', 'IF', 'SPACE', \r
- 'UNIMATH', 'FOR', 'SEMICOLON', 'INCDEC', \r
- 'TO', 'AS', 'APTR', 'LDELSLASH', \r
- 'INTEGER', 'COMMA', 'COLON', 'MATH', \r
- 'ANDSYM', 'OPENP', 'CLOSEP', 'QMARK', \r
- 'NOT', 'TYPECAST', 'DOT', 'BOOLEAN', \r
- 'NULL', 'SINGLEQUOTESTRING', 'QUOTE', 'DOUBLECOLON', \r
- 'AT', 'HATCH', 'OPENB', 'CLOSEB', \r
- 'VERT', 'ISIN', 'ISDIVBY', 'ISNOTDIVBY', \r
- 'ISEVEN', 'ISNOTEVEN', 'ISEVENBY', 'ISNOTEVENBY', \r
- 'ISODD', 'ISNOTODD', 'ISODDBY', 'ISNOTODDBY', \r
- 'INSTANCEOF', 'EQUALS', 'NOTEQUALS', 'GREATERTHAN', \r
- 'LESSTHAN', 'GREATEREQUAL', 'LESSEQUAL', 'IDENTITY', \r
- 'NONEIDENTITY', 'MOD', 'LAND', 'LOR', \r
- 'LXOR', 'BACKTICK', 'DOLLARID', 'error', \r
- 'start', 'template', 'template_element', 'smartytag', \r
- 'literal', 'php_code', 'php_code_element', 'php_dq_contents',\r
- 'php_dq_content', 'literal_elements', 'literal_element', 'value', \r
- 'attributes', 'variable', 'expr', 'ternary', \r
- 'ifexprs', 'varindexed', 'modifier', 'modparameters',\r
- 'statement', 'statements', 'optspace', 'varvar', \r
- 'foraction', 'array', 'specialclose', 'attribute', \r
- 'exprs', 'function', 'doublequoted', 'method', \r
- 'params', 'objectchain', 'arrayindex', 'object', \r
- 'indexdef', 'varvarele', 'objectelement', 'modparameter',\r
- 'ifexpr', 'ifcond', 'lop', 'arrayelements',\r
- 'arrayelement', 'doublequotedcontent',\r
- );\r
-\r
- static public $yyRuleName = array(\r
- /* 0 */ "start ::= template",\r
- /* 1 */ "template ::= template_element",\r
- /* 2 */ "template ::= template template_element",\r
- /* 3 */ "template_element ::= smartytag",\r
- /* 4 */ "template_element ::= COMMENT",\r
- /* 5 */ "template_element ::= literal",\r
- /* 6 */ "template_element ::= PHPSTARTTAG php_code PHPENDTAG",\r
- /* 7 */ "template_element ::= OTHER",\r
- /* 8 */ "template_element ::= FAKEPHPSTARTTAG",\r
- /* 9 */ "php_code ::= php_code_element php_code",\r
- /* 10 */ "php_code ::=",\r
- /* 11 */ "php_code_element ::= PHP_CODE",\r
- /* 12 */ "php_code_element ::= PHP_CODE_START_DOUBLEQUOTE php_dq_contents PHP_CODE_DOUBLEQUOTE",\r
- /* 13 */ "php_code_element ::= PHP_HEREDOC_START php_dq_contents PHP_HEREDOC_END",\r
- /* 14 */ "php_code_element ::= PHP_NOWDOC_START php_dq_contents PHP_NOWDOC_END",\r
- /* 15 */ "php_dq_contents ::= php_dq_content php_dq_contents",\r
- /* 16 */ "php_dq_contents ::=",\r
- /* 17 */ "php_dq_content ::= PHP_DQ_CONTENT",\r
- /* 18 */ "php_dq_content ::= PHP_DQ_EMBED_START php_code PHP_DQ_EMBED_END",\r
- /* 19 */ "literal ::= LITERALSTART LITERALEND",\r
- /* 20 */ "literal ::= LITERALSTART literal_elements LITERALEND",\r
- /* 21 */ "literal_elements ::= literal_element literal_elements",\r
- /* 22 */ "literal_elements ::=",\r
- /* 23 */ "literal_element ::= literal",\r
- /* 24 */ "literal_element ::= LITERAL",\r
- /* 25 */ "literal_element ::= PHPSTARTTAG",\r
- /* 26 */ "literal_element ::= FAKEPHPSTARTTAG",\r
- /* 27 */ "literal_element ::= PHPENDTAG",\r
- /* 28 */ "smartytag ::= LDEL value RDEL",\r
- /* 29 */ "smartytag ::= LDEL value attributes RDEL",\r
- /* 30 */ "smartytag ::= LDEL variable attributes RDEL",\r
- /* 31 */ "smartytag ::= LDEL expr attributes RDEL",\r
- /* 32 */ "smartytag ::= LDEL ternary attributes RDEL",\r
- /* 33 */ "smartytag ::= LDEL DOLLAR ID EQUAL value RDEL",\r
- /* 34 */ "smartytag ::= LDEL DOLLAR ID EQUAL expr RDEL",\r
- /* 35 */ "smartytag ::= LDEL DOLLAR ID EQUAL expr attributes RDEL",\r
- /* 36 */ "smartytag ::= LDEL DOLLAR ID EQUAL ifexprs attributes RDEL",\r
- /* 37 */ "smartytag ::= LDEL DOLLAR ID EQUAL ternary attributes RDEL",\r
- /* 38 */ "smartytag ::= LDEL varindexed EQUAL expr attributes RDEL",\r
- /* 39 */ "smartytag ::= LDEL varindexed EQUAL ternary attributes RDEL",\r
- /* 40 */ "smartytag ::= LDEL varindexed EQUAL ifexprs attributes RDEL",\r
- /* 41 */ "smartytag ::= LDEL ID attributes RDEL",\r
- /* 42 */ "smartytag ::= LDEL FOREACH attributes RDEL",\r
- /* 43 */ "smartytag ::= LDEL ID RDEL",\r
- /* 44 */ "smartytag ::= LDEL ID PTR ID attributes RDEL",\r
- /* 45 */ "smartytag ::= LDEL ID modifier modparameters attributes RDEL",\r
- /* 46 */ "smartytag ::= LDEL ID PTR ID modifier modparameters attributes RDEL",\r
- /* 47 */ "smartytag ::= LDEL IF SPACE ifexprs RDEL",\r
- /* 48 */ "smartytag ::= LDEL IF UNIMATH ifexprs RDEL",\r
- /* 49 */ "smartytag ::= LDEL IF SPACE statement RDEL",\r
- /* 50 */ "smartytag ::= LDEL FOR SPACE statements SEMICOLON optspace ifexprs SEMICOLON optspace DOLLAR varvar foraction RDEL",\r
- /* 51 */ "foraction ::= EQUAL expr",\r
- /* 52 */ "foraction ::= INCDEC",\r
- /* 53 */ "smartytag ::= LDEL FOR SPACE statement TO expr attributes RDEL",\r
- /* 54 */ "smartytag ::= LDEL FOREACH SPACE value AS DOLLAR varvar RDEL",\r
- /* 55 */ "smartytag ::= LDEL FOREACH SPACE value AS DOLLAR varvar APTR DOLLAR varvar RDEL",\r
- /* 56 */ "smartytag ::= LDEL FOREACH SPACE array AS DOLLAR varvar RDEL",\r
- /* 57 */ "smartytag ::= LDEL FOREACH SPACE array AS DOLLAR varvar APTR DOLLAR varvar RDEL",\r
- /* 58 */ "smartytag ::= LDELSLASH ID RDEL",\r
- /* 59 */ "smartytag ::= LDELSLASH specialclose RDEL",\r
- /* 60 */ "specialclose ::= IF",\r
- /* 61 */ "specialclose ::= FOR",\r
- /* 62 */ "specialclose ::= FOREACH",\r
- /* 63 */ "smartytag ::= LDELSLASH ID attributes RDEL",\r
- /* 64 */ "smartytag ::= LDELSLASH ID modifier modparameters attributes RDEL",\r
- /* 65 */ "smartytag ::= LDELSLASH ID PTR ID RDEL",\r
- /* 66 */ "attributes ::= attributes attribute",\r
- /* 67 */ "attributes ::= attribute",\r
- /* 68 */ "attributes ::=",\r
- /* 69 */ "attribute ::= SPACE ID EQUAL ID",\r
- /* 70 */ "attribute ::= SPACE ID EQUAL expr",\r
- /* 71 */ "attribute ::= SPACE ID EQUAL ifexprs",\r
- /* 72 */ "attribute ::= SPACE ID EQUAL value",\r
- /* 73 */ "attribute ::= SPACE ID EQUAL ternary",\r
- /* 74 */ "attribute ::= SPACE ID",\r
- /* 75 */ "attribute ::= SPACE INTEGER EQUAL expr",\r
- /* 76 */ "statements ::= statement",\r
- /* 77 */ "statements ::= statements COMMA statement",\r
- /* 78 */ "statement ::= DOLLAR varvar EQUAL expr",\r
- /* 79 */ "expr ::= ID",\r
- /* 80 */ "expr ::= exprs",\r
- /* 81 */ "expr ::= DOLLAR ID COLON ID",\r
- /* 82 */ "expr ::= expr modifier modparameters",\r
- /* 83 */ "exprs ::= value",\r
- /* 84 */ "exprs ::= exprs MATH value",\r
- /* 85 */ "exprs ::= exprs UNIMATH value",\r
- /* 86 */ "exprs ::= exprs ANDSYM value",\r
- /* 87 */ "exprs ::= array",\r
- /* 88 */ "ternary ::= OPENP ifexprs CLOSEP QMARK expr COLON expr",\r
- /* 89 */ "ternary ::= OPENP expr CLOSEP QMARK expr COLON expr",\r
- /* 90 */ "value ::= variable",\r
- /* 91 */ "value ::= UNIMATH value",\r
- /* 92 */ "value ::= NOT value",\r
- /* 93 */ "value ::= TYPECAST value",\r
- /* 94 */ "value ::= variable INCDEC",\r
- /* 95 */ "value ::= INTEGER",\r
- /* 96 */ "value ::= INTEGER DOT INTEGER",\r
- /* 97 */ "value ::= BOOLEAN",\r
- /* 98 */ "value ::= NULL",\r
- /* 99 */ "value ::= function",\r
- /* 100 */ "value ::= OPENP expr CLOSEP",\r
- /* 101 */ "value ::= SINGLEQUOTESTRING",\r
- /* 102 */ "value ::= QUOTE doublequoted QUOTE",\r
- /* 103 */ "value ::= QUOTE QUOTE",\r
- /* 104 */ "value ::= ID DOUBLECOLON method",\r
- /* 105 */ "value ::= ID DOUBLECOLON DOLLAR ID OPENP params CLOSEP",\r
- /* 106 */ "value ::= ID DOUBLECOLON method objectchain",\r
- /* 107 */ "value ::= ID DOUBLECOLON DOLLAR ID OPENP params CLOSEP objectchain",\r
- /* 108 */ "value ::= ID DOUBLECOLON ID",\r
- /* 109 */ "value ::= ID DOUBLECOLON DOLLAR ID arrayindex",\r
- /* 110 */ "value ::= ID DOUBLECOLON DOLLAR ID arrayindex objectchain",\r
- /* 111 */ "value ::= smartytag",\r
- /* 112 */ "variable ::= varindexed",\r
- /* 113 */ "variable ::= DOLLAR varvar AT ID",\r
- /* 114 */ "variable ::= object",\r
- /* 115 */ "variable ::= HATCH ID HATCH",\r
- /* 116 */ "variable ::= HATCH variable HATCH",\r
- /* 117 */ "varindexed ::= DOLLAR varvar arrayindex",\r
- /* 118 */ "arrayindex ::= arrayindex indexdef",\r
- /* 119 */ "arrayindex ::=",\r
- /* 120 */ "indexdef ::= DOT DOLLAR varvar",\r
- /* 121 */ "indexdef ::= DOT DOLLAR varvar AT ID",\r
- /* 122 */ "indexdef ::= DOT ID",\r
- /* 123 */ "indexdef ::= DOT BOOLEAN",\r
- /* 124 */ "indexdef ::= DOT NULL",\r
- /* 125 */ "indexdef ::= DOT INTEGER",\r
- /* 126 */ "indexdef ::= DOT LDEL exprs RDEL",\r
- /* 127 */ "indexdef ::= OPENB ID CLOSEB",\r
- /* 128 */ "indexdef ::= OPENB ID DOT ID CLOSEB",\r
- /* 129 */ "indexdef ::= OPENB exprs CLOSEB",\r
- /* 130 */ "indexdef ::= OPENB CLOSEB",\r
- /* 131 */ "varvar ::= varvarele",\r
- /* 132 */ "varvar ::= varvar varvarele",\r
- /* 133 */ "varvarele ::= ID",\r
- /* 134 */ "varvarele ::= LDEL expr RDEL",\r
- /* 135 */ "object ::= varindexed objectchain",\r
- /* 136 */ "objectchain ::= objectelement",\r
- /* 137 */ "objectchain ::= objectchain objectelement",\r
- /* 138 */ "objectelement ::= PTR ID arrayindex",\r
- /* 139 */ "objectelement ::= PTR variable arrayindex",\r
- /* 140 */ "objectelement ::= PTR LDEL expr RDEL arrayindex",\r
- /* 141 */ "objectelement ::= PTR ID LDEL expr RDEL arrayindex",\r
- /* 142 */ "objectelement ::= PTR method",\r
- /* 143 */ "function ::= ID OPENP params CLOSEP",\r
- /* 144 */ "method ::= ID OPENP params CLOSEP",\r
- /* 145 */ "params ::= expr COMMA params",\r
- /* 146 */ "params ::= expr",\r
- /* 147 */ "params ::=",\r
- /* 148 */ "modifier ::= VERT AT ID",\r
- /* 149 */ "modifier ::= VERT ID",\r
- /* 150 */ "modparameters ::= modparameters modparameter",\r
- /* 151 */ "modparameters ::=",\r
- /* 152 */ "modparameter ::= COLON exprs",\r
- /* 153 */ "modparameter ::= COLON ID",\r
- /* 154 */ "ifexprs ::= ifexpr",\r
- /* 155 */ "ifexprs ::= NOT ifexprs",\r
- /* 156 */ "ifexprs ::= OPENP ifexprs CLOSEP",\r
- /* 157 */ "ifexpr ::= expr",\r
- /* 158 */ "ifexpr ::= expr ifcond expr",\r
- /* 159 */ "ifexpr ::= expr ISIN array",\r
- /* 160 */ "ifexpr ::= expr ISIN value",\r
- /* 161 */ "ifexpr ::= ifexprs lop ifexprs",\r
- /* 162 */ "ifexpr ::= ifexprs ISDIVBY ifexprs",\r
- /* 163 */ "ifexpr ::= ifexprs ISNOTDIVBY ifexprs",\r
- /* 164 */ "ifexpr ::= ifexprs ISEVEN",\r
- /* 165 */ "ifexpr ::= ifexprs ISNOTEVEN",\r
- /* 166 */ "ifexpr ::= ifexprs ISEVENBY ifexprs",\r
- /* 167 */ "ifexpr ::= ifexprs ISNOTEVENBY ifexprs",\r
- /* 168 */ "ifexpr ::= ifexprs ISODD",\r
- /* 169 */ "ifexpr ::= ifexprs ISNOTODD",\r
- /* 170 */ "ifexpr ::= ifexprs ISODDBY ifexprs",\r
- /* 171 */ "ifexpr ::= ifexprs ISNOTODDBY ifexprs",\r
- /* 172 */ "ifexpr ::= value INSTANCEOF ID",\r
- /* 173 */ "ifexpr ::= value INSTANCEOF value",\r
- /* 174 */ "ifcond ::= EQUALS",\r
- /* 175 */ "ifcond ::= NOTEQUALS",\r
- /* 176 */ "ifcond ::= GREATERTHAN",\r
- /* 177 */ "ifcond ::= LESSTHAN",\r
- /* 178 */ "ifcond ::= GREATEREQUAL",\r
- /* 179 */ "ifcond ::= LESSEQUAL",\r
- /* 180 */ "ifcond ::= IDENTITY",\r
- /* 181 */ "ifcond ::= NONEIDENTITY",\r
- /* 182 */ "ifcond ::= MOD",\r
- /* 183 */ "lop ::= LAND",\r
- /* 184 */ "lop ::= LOR",\r
- /* 185 */ "lop ::= LXOR",\r
- /* 186 */ "array ::= OPENB arrayelements CLOSEB",\r
- /* 187 */ "arrayelements ::= arrayelement",\r
- /* 188 */ "arrayelements ::= arrayelements COMMA arrayelement",\r
- /* 189 */ "arrayelements ::=",\r
- /* 190 */ "arrayelement ::= value APTR expr",\r
- /* 191 */ "arrayelement ::= ID APTR expr",\r
- /* 192 */ "arrayelement ::= expr",\r
- /* 193 */ "doublequoted ::= doublequoted doublequotedcontent",\r
- /* 194 */ "doublequoted ::= doublequotedcontent",\r
- /* 195 */ "doublequotedcontent ::= BACKTICK variable BACKTICK",\r
- /* 196 */ "doublequotedcontent ::= BACKTICK expr BACKTICK",\r
- /* 197 */ "doublequotedcontent ::= DOLLARID",\r
- /* 198 */ "doublequotedcontent ::= LDEL variable RDEL",\r
- /* 199 */ "doublequotedcontent ::= LDEL expr RDEL",\r
- /* 200 */ "doublequotedcontent ::= smartytag",\r
- /* 201 */ "doublequotedcontent ::= OTHER",\r
- /* 202 */ "optspace ::= SPACE",\r
- /* 203 */ "optspace ::=",\r
- );\r
-\r
- function tokenName($tokenType)\r
- {\r
- if ($tokenType === 0) {\r
- return 'End of Input';\r
- }\r
- if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) {\r
- return $this->yyTokenName[$tokenType];\r
- } else {\r
- return "Unknown";\r
- }\r
- }\r
-\r
- static function yy_destructor($yymajor, $yypminor)\r
- {\r
- switch ($yymajor) {\r
- default: break; /* If no destructor action specified: do nothing */\r
- }\r
- }\r
-\r
- function yy_pop_parser_stack()\r
- {\r
- if (!count($this->yystack)) {\r
- return;\r
- }\r
- $yytos = array_pop($this->yystack);\r
- if (self::$yyTraceFILE && $this->yyidx >= 0) {\r
- fwrite(self::$yyTraceFILE,\r
- self::$yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] .\r
- "\n");\r
- }\r
- $yymajor = $yytos->major;\r
- self::yy_destructor($yymajor, $yytos->minor);\r
- $this->yyidx--;\r
- return $yymajor;\r
- }\r
-\r
- function __destruct()\r
- {\r
- while ($this->yyidx >= 0) {\r
- $this->yy_pop_parser_stack();\r
- }\r
- if (is_resource(self::$yyTraceFILE)) {\r
- fclose(self::$yyTraceFILE);\r
- }\r
- }\r
-\r
- function yy_get_expected_tokens($token)\r
- {\r
- $state = $this->yystack[$this->yyidx]->stateno;\r
- $expected = self::$yyExpectedTokens[$state];\r
- if (in_array($token, self::$yyExpectedTokens[$state], true)) {\r
- return $expected;\r
- }\r
- $stack = $this->yystack;\r
- $yyidx = $this->yyidx;\r
- do {\r
- $yyact = $this->yy_find_shift_action($token);\r
- if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\r
- // reduce action\r
- $done = 0;\r
- do {\r
- if ($done++ == 100) {\r
- $this->yyidx = $yyidx;\r
- $this->yystack = $stack;\r
- // too much recursion prevents proper detection\r
- // so give up\r
- return array_unique($expected);\r
- }\r
- $yyruleno = $yyact - self::YYNSTATE;\r
- $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];\r
- $nextstate = $this->yy_find_reduce_action(\r
- $this->yystack[$this->yyidx]->stateno,\r
- self::$yyRuleInfo[$yyruleno]['lhs']);\r
- if (isset(self::$yyExpectedTokens[$nextstate])) {\r
- $expected += self::$yyExpectedTokens[$nextstate];\r
- if (in_array($token,\r
- self::$yyExpectedTokens[$nextstate], true)) {\r
- $this->yyidx = $yyidx;\r
- $this->yystack = $stack;\r
- return array_unique($expected);\r
- }\r
- }\r
- if ($nextstate < self::YYNSTATE) {\r
- // we need to shift a non-terminal\r
- $this->yyidx++;\r
- $x = new TP_yyStackEntry;\r
- $x->stateno = $nextstate;\r
- $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];\r
- $this->yystack[$this->yyidx] = $x;\r
- continue 2;\r
- } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {\r
- $this->yyidx = $yyidx;\r
- $this->yystack = $stack;\r
- // the last token was just ignored, we can't accept\r
- // by ignoring input, this is in essence ignoring a\r
- // syntax error!\r
- return array_unique($expected);\r
- } elseif ($nextstate === self::YY_NO_ACTION) {\r
- $this->yyidx = $yyidx;\r
- $this->yystack = $stack;\r
- // input accepted, but not shifted (I guess)\r
- return $expected;\r
- } else {\r
- $yyact = $nextstate;\r
- }\r
- } while (true);\r
- }\r
- break;\r
- } while (true);\r
- return array_unique($expected);\r
- }\r
-\r
- function yy_is_expected_token($token)\r
- {\r
- if ($token === 0) {\r
- return true; // 0 is not part of this\r
- }\r
- $state = $this->yystack[$this->yyidx]->stateno;\r
- if (in_array($token, self::$yyExpectedTokens[$state], true)) {\r
- return true;\r
- }\r
- $stack = $this->yystack;\r
- $yyidx = $this->yyidx;\r
- do {\r
- $yyact = $this->yy_find_shift_action($token);\r
- if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) {\r
- // reduce action\r
- $done = 0;\r
- do {\r
- if ($done++ == 100) {\r
- $this->yyidx = $yyidx;\r
- $this->yystack = $stack;\r
- // too much recursion prevents proper detection\r
- // so give up\r
- return true;\r
- }\r
- $yyruleno = $yyact - self::YYNSTATE;\r
- $this->yyidx -= self::$yyRuleInfo[$yyruleno]['rhs'];\r
- $nextstate = $this->yy_find_reduce_action(\r
- $this->yystack[$this->yyidx]->stateno,\r
- self::$yyRuleInfo[$yyruleno]['lhs']);\r
- if (isset(self::$yyExpectedTokens[$nextstate]) &&\r
- in_array($token, self::$yyExpectedTokens[$nextstate], true)) {\r
- $this->yyidx = $yyidx;\r
- $this->yystack = $stack;\r
- return true;\r
- }\r
- if ($nextstate < self::YYNSTATE) {\r
- // we need to shift a non-terminal\r
- $this->yyidx++;\r
- $x = new TP_yyStackEntry;\r
- $x->stateno = $nextstate;\r
- $x->major = self::$yyRuleInfo[$yyruleno]['lhs'];\r
- $this->yystack[$this->yyidx] = $x;\r
- continue 2;\r
- } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) {\r
- $this->yyidx = $yyidx;\r
- $this->yystack = $stack;\r
- if (!$token) {\r
- // end of input: this is valid\r
- return true;\r
- }\r
- // the last token was just ignored, we can't accept\r
- // by ignoring input, this is in essence ignoring a\r
- // syntax error!\r
- return false;\r
- } elseif ($nextstate === self::YY_NO_ACTION) {\r
- $this->yyidx = $yyidx;\r
- $this->yystack = $stack;\r
- // input accepted, but not shifted (I guess)\r
- return true;\r
- } else {\r
- $yyact = $nextstate;\r
- }\r
- } while (true);\r
- }\r
- break;\r
- } while (true);\r
- $this->yyidx = $yyidx;\r
- $this->yystack = $stack;\r
- return true;\r
- }\r
-\r
- function yy_find_shift_action($iLookAhead)\r
- {\r
- $stateno = $this->yystack[$this->yyidx]->stateno;\r
- \r
- /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */\r
- if (!isset(self::$yy_shift_ofst[$stateno])) {\r
- // no shift actions\r
- return self::$yy_default[$stateno];\r
- }\r
- $i = self::$yy_shift_ofst[$stateno];\r
- if ($i === self::YY_SHIFT_USE_DFLT) {\r
- return self::$yy_default[$stateno];\r
- }\r
- if ($iLookAhead == self::YYNOCODE) {\r
- return self::YY_NO_ACTION;\r
- }\r
- $i += $iLookAhead;\r
- if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||\r
- self::$yy_lookahead[$i] != $iLookAhead) {\r
- if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback)\r
- && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) {\r
- if (self::$yyTraceFILE) {\r
- fwrite(self::$yyTraceFILE, self::$yyTracePrompt . "FALLBACK " .\r
- $this->yyTokenName[$iLookAhead] . " => " .\r
- $this->yyTokenName[$iFallback] . "\n");\r
- }\r
- return $this->yy_find_shift_action($iFallback);\r
- }\r
- return self::$yy_default[$stateno];\r
- } else {\r
- return self::$yy_action[$i];\r
- }\r
- }\r
-\r
- function yy_find_reduce_action($stateno, $iLookAhead)\r
- {\r
- /* $stateno = $this->yystack[$this->yyidx]->stateno; */\r
-\r
- if (!isset(self::$yy_reduce_ofst[$stateno])) {\r
- return self::$yy_default[$stateno];\r
- }\r
- $i = self::$yy_reduce_ofst[$stateno];\r
- if ($i == self::YY_REDUCE_USE_DFLT) {\r
- return self::$yy_default[$stateno];\r
- }\r
- if ($iLookAhead == self::YYNOCODE) {\r
- return self::YY_NO_ACTION;\r
- }\r
- $i += $iLookAhead;\r
- if ($i < 0 || $i >= self::YY_SZ_ACTTAB ||\r
- self::$yy_lookahead[$i] != $iLookAhead) {\r
- return self::$yy_default[$stateno];\r
- } else {\r
- return self::$yy_action[$i];\r
- }\r
- }\r
-\r
- function yy_shift($yyNewState, $yyMajor, $yypMinor)\r
- {\r
- $this->yyidx++;\r
- if ($this->yyidx >= self::YYSTACKDEPTH) {\r
- $this->yyidx--;\r
- if (self::$yyTraceFILE) {\r
- fprintf(self::$yyTraceFILE, "%sStack Overflow!\n", self::$yyTracePrompt);\r
- }\r
- while ($this->yyidx >= 0) {\r
- $this->yy_pop_parser_stack();\r
- }\r
- return;\r
- }\r
- $yytos = new TP_yyStackEntry;\r
- $yytos->stateno = $yyNewState;\r
- $yytos->major = $yyMajor;\r
- $yytos->minor = $yypMinor;\r
- array_push($this->yystack, $yytos);\r
- if (self::$yyTraceFILE && $this->yyidx > 0) {\r
- fprintf(self::$yyTraceFILE, "%sShift %d\n", self::$yyTracePrompt,\r
- $yyNewState);\r
- fprintf(self::$yyTraceFILE, "%sStack:", self::$yyTracePrompt);\r
- for($i = 1; $i <= $this->yyidx; $i++) {\r
- fprintf(self::$yyTraceFILE, " %s",\r
- $this->yyTokenName[$this->yystack[$i]->major]);\r
- }\r
- fwrite(self::$yyTraceFILE,"\n");\r
- }\r
- }\r
-\r
- static public $yyRuleInfo = array(\r
- array( 'lhs' => 84, 'rhs' => 1 ),\r
- array( 'lhs' => 85, 'rhs' => 1 ),\r
- array( 'lhs' => 85, 'rhs' => 2 ),\r
- array( 'lhs' => 86, 'rhs' => 1 ),\r
- array( 'lhs' => 86, 'rhs' => 1 ),\r
- array( 'lhs' => 86, 'rhs' => 1 ),\r
- array( 'lhs' => 86, 'rhs' => 3 ),\r
- array( 'lhs' => 86, 'rhs' => 1 ),\r
- array( 'lhs' => 86, 'rhs' => 1 ),\r
- array( 'lhs' => 89, 'rhs' => 2 ),\r
- array( 'lhs' => 89, 'rhs' => 0 ),\r
- array( 'lhs' => 90, 'rhs' => 1 ),\r
- array( 'lhs' => 90, 'rhs' => 3 ),\r
- array( 'lhs' => 90, 'rhs' => 3 ),\r
- array( 'lhs' => 90, 'rhs' => 3 ),\r
- array( 'lhs' => 91, 'rhs' => 2 ),\r
- array( 'lhs' => 91, 'rhs' => 0 ),\r
- array( 'lhs' => 92, 'rhs' => 1 ),\r
- array( 'lhs' => 92, 'rhs' => 3 ),\r
- array( 'lhs' => 88, 'rhs' => 2 ),\r
- array( 'lhs' => 88, 'rhs' => 3 ),\r
- array( 'lhs' => 93, 'rhs' => 2 ),\r
- array( 'lhs' => 93, 'rhs' => 0 ),\r
- array( 'lhs' => 94, 'rhs' => 1 ),\r
- array( 'lhs' => 94, 'rhs' => 1 ),\r
- array( 'lhs' => 94, 'rhs' => 1 ),\r
- array( 'lhs' => 94, 'rhs' => 1 ),\r
- array( 'lhs' => 94, 'rhs' => 1 ),\r
- array( 'lhs' => 87, 'rhs' => 3 ),\r
- array( 'lhs' => 87, 'rhs' => 4 ),\r
- array( 'lhs' => 87, 'rhs' => 4 ),\r
- array( 'lhs' => 87, 'rhs' => 4 ),\r
- array( 'lhs' => 87, 'rhs' => 4 ),\r
- array( 'lhs' => 87, 'rhs' => 6 ),\r
- array( 'lhs' => 87, 'rhs' => 6 ),\r
- array( 'lhs' => 87, 'rhs' => 7 ),\r
- array( 'lhs' => 87, 'rhs' => 7 ),\r
- array( 'lhs' => 87, 'rhs' => 7 ),\r
- array( 'lhs' => 87, 'rhs' => 6 ),\r
- array( 'lhs' => 87, 'rhs' => 6 ),\r
- array( 'lhs' => 87, 'rhs' => 6 ),\r
- array( 'lhs' => 87, 'rhs' => 4 ),\r
- array( 'lhs' => 87, 'rhs' => 4 ),\r
- array( 'lhs' => 87, 'rhs' => 3 ),\r
- array( 'lhs' => 87, 'rhs' => 6 ),\r
- array( 'lhs' => 87, 'rhs' => 6 ),\r
- array( 'lhs' => 87, 'rhs' => 8 ),\r
- array( 'lhs' => 87, 'rhs' => 5 ),\r
- array( 'lhs' => 87, 'rhs' => 5 ),\r
- array( 'lhs' => 87, 'rhs' => 5 ),\r
- array( 'lhs' => 87, 'rhs' => 13 ),\r
- array( 'lhs' => 108, 'rhs' => 2 ),\r
- array( 'lhs' => 108, 'rhs' => 1 ),\r
- array( 'lhs' => 87, 'rhs' => 8 ),\r
- array( 'lhs' => 87, 'rhs' => 8 ),\r
- array( 'lhs' => 87, 'rhs' => 11 ),\r
- array( 'lhs' => 87, 'rhs' => 8 ),\r
- array( 'lhs' => 87, 'rhs' => 11 ),\r
- array( 'lhs' => 87, 'rhs' => 3 ),\r
- array( 'lhs' => 87, 'rhs' => 3 ),\r
- array( 'lhs' => 110, 'rhs' => 1 ),\r
- array( 'lhs' => 110, 'rhs' => 1 ),\r
- array( 'lhs' => 110, 'rhs' => 1 ),\r
- array( 'lhs' => 87, 'rhs' => 4 ),\r
- array( 'lhs' => 87, 'rhs' => 6 ),\r
- array( 'lhs' => 87, 'rhs' => 5 ),\r
- array( 'lhs' => 96, 'rhs' => 2 ),\r
- array( 'lhs' => 96, 'rhs' => 1 ),\r
- array( 'lhs' => 96, 'rhs' => 0 ),\r
- array( 'lhs' => 111, 'rhs' => 4 ),\r
- array( 'lhs' => 111, 'rhs' => 4 ),\r
- array( 'lhs' => 111, 'rhs' => 4 ),\r
- array( 'lhs' => 111, 'rhs' => 4 ),\r
- array( 'lhs' => 111, 'rhs' => 4 ),\r
- array( 'lhs' => 111, 'rhs' => 2 ),\r
- array( 'lhs' => 111, 'rhs' => 4 ),\r
- array( 'lhs' => 105, 'rhs' => 1 ),\r
- array( 'lhs' => 105, 'rhs' => 3 ),\r
- array( 'lhs' => 104, 'rhs' => 4 ),\r
- array( 'lhs' => 98, 'rhs' => 1 ),\r
- array( 'lhs' => 98, 'rhs' => 1 ),\r
- array( 'lhs' => 98, 'rhs' => 4 ),\r
- array( 'lhs' => 98, 'rhs' => 3 ),\r
- array( 'lhs' => 112, 'rhs' => 1 ),\r
- array( 'lhs' => 112, 'rhs' => 3 ),\r
- array( 'lhs' => 112, 'rhs' => 3 ),\r
- array( 'lhs' => 112, 'rhs' => 3 ),\r
- array( 'lhs' => 112, 'rhs' => 1 ),\r
- array( 'lhs' => 99, 'rhs' => 7 ),\r
- array( 'lhs' => 99, 'rhs' => 7 ),\r
- array( 'lhs' => 95, 'rhs' => 1 ),\r
- array( 'lhs' => 95, 'rhs' => 2 ),\r
- array( 'lhs' => 95, 'rhs' => 2 ),\r
- array( 'lhs' => 95, 'rhs' => 2 ),\r
- array( 'lhs' => 95, 'rhs' => 2 ),\r
- array( 'lhs' => 95, 'rhs' => 1 ),\r
- array( 'lhs' => 95, 'rhs' => 3 ),\r
- array( 'lhs' => 95, 'rhs' => 1 ),\r
- array( 'lhs' => 95, 'rhs' => 1 ),\r
- array( 'lhs' => 95, 'rhs' => 1 ),\r
- array( 'lhs' => 95, 'rhs' => 3 ),\r
- array( 'lhs' => 95, 'rhs' => 1 ),\r
- array( 'lhs' => 95, 'rhs' => 3 ),\r
- array( 'lhs' => 95, 'rhs' => 2 ),\r
- array( 'lhs' => 95, 'rhs' => 3 ),\r
- array( 'lhs' => 95, 'rhs' => 7 ),\r
- array( 'lhs' => 95, 'rhs' => 4 ),\r
- array( 'lhs' => 95, 'rhs' => 8 ),\r
- array( 'lhs' => 95, 'rhs' => 3 ),\r
- array( 'lhs' => 95, 'rhs' => 5 ),\r
- array( 'lhs' => 95, 'rhs' => 6 ),\r
- array( 'lhs' => 95, 'rhs' => 1 ),\r
- array( 'lhs' => 97, 'rhs' => 1 ),\r
- array( 'lhs' => 97, 'rhs' => 4 ),\r
- array( 'lhs' => 97, 'rhs' => 1 ),\r
- array( 'lhs' => 97, 'rhs' => 3 ),\r
- array( 'lhs' => 97, 'rhs' => 3 ),\r
- array( 'lhs' => 101, 'rhs' => 3 ),\r
- array( 'lhs' => 118, 'rhs' => 2 ),\r
- array( 'lhs' => 118, 'rhs' => 0 ),\r
- array( 'lhs' => 120, 'rhs' => 3 ),\r
- array( 'lhs' => 120, 'rhs' => 5 ),\r
- array( 'lhs' => 120, 'rhs' => 2 ),\r
- array( 'lhs' => 120, 'rhs' => 2 ),\r
- array( 'lhs' => 120, 'rhs' => 2 ),\r
- array( 'lhs' => 120, 'rhs' => 2 ),\r
- array( 'lhs' => 120, 'rhs' => 4 ),\r
- array( 'lhs' => 120, 'rhs' => 3 ),\r
- array( 'lhs' => 120, 'rhs' => 5 ),\r
- array( 'lhs' => 120, 'rhs' => 3 ),\r
- array( 'lhs' => 120, 'rhs' => 2 ),\r
- array( 'lhs' => 107, 'rhs' => 1 ),\r
- array( 'lhs' => 107, 'rhs' => 2 ),\r
- array( 'lhs' => 121, 'rhs' => 1 ),\r
- array( 'lhs' => 121, 'rhs' => 3 ),\r
- array( 'lhs' => 119, 'rhs' => 2 ),\r
- array( 'lhs' => 117, 'rhs' => 1 ),\r
- array( 'lhs' => 117, 'rhs' => 2 ),\r
- array( 'lhs' => 122, 'rhs' => 3 ),\r
- array( 'lhs' => 122, 'rhs' => 3 ),\r
- array( 'lhs' => 122, 'rhs' => 5 ),\r
- array( 'lhs' => 122, 'rhs' => 6 ),\r
- array( 'lhs' => 122, 'rhs' => 2 ),\r
- array( 'lhs' => 113, 'rhs' => 4 ),\r
- array( 'lhs' => 115, 'rhs' => 4 ),\r
- array( 'lhs' => 116, 'rhs' => 3 ),\r
- array( 'lhs' => 116, 'rhs' => 1 ),\r
- array( 'lhs' => 116, 'rhs' => 0 ),\r
- array( 'lhs' => 102, 'rhs' => 3 ),\r
- array( 'lhs' => 102, 'rhs' => 2 ),\r
- array( 'lhs' => 103, 'rhs' => 2 ),\r
- array( 'lhs' => 103, 'rhs' => 0 ),\r
- array( 'lhs' => 123, 'rhs' => 2 ),\r
- array( 'lhs' => 123, 'rhs' => 2 ),\r
- array( 'lhs' => 100, 'rhs' => 1 ),\r
- array( 'lhs' => 100, 'rhs' => 2 ),\r
- array( 'lhs' => 100, 'rhs' => 3 ),\r
- array( 'lhs' => 124, 'rhs' => 1 ),\r
- array( 'lhs' => 124, 'rhs' => 3 ),\r
- array( 'lhs' => 124, 'rhs' => 3 ),\r
- array( 'lhs' => 124, 'rhs' => 3 ),\r
- array( 'lhs' => 124, 'rhs' => 3 ),\r
- array( 'lhs' => 124, 'rhs' => 3 ),\r
- array( 'lhs' => 124, 'rhs' => 3 ),\r
- array( 'lhs' => 124, 'rhs' => 2 ),\r
- array( 'lhs' => 124, 'rhs' => 2 ),\r
- array( 'lhs' => 124, 'rhs' => 3 ),\r
- array( 'lhs' => 124, 'rhs' => 3 ),\r
- array( 'lhs' => 124, 'rhs' => 2 ),\r
- array( 'lhs' => 124, 'rhs' => 2 ),\r
- array( 'lhs' => 124, 'rhs' => 3 ),\r
- array( 'lhs' => 124, 'rhs' => 3 ),\r
- array( 'lhs' => 124, 'rhs' => 3 ),\r
- array( 'lhs' => 124, 'rhs' => 3 ),\r
- array( 'lhs' => 125, 'rhs' => 1 ),\r
- array( 'lhs' => 125, 'rhs' => 1 ),\r
- array( 'lhs' => 125, 'rhs' => 1 ),\r
- array( 'lhs' => 125, 'rhs' => 1 ),\r
- array( 'lhs' => 125, 'rhs' => 1 ),\r
- array( 'lhs' => 125, 'rhs' => 1 ),\r
- array( 'lhs' => 125, 'rhs' => 1 ),\r
- array( 'lhs' => 125, 'rhs' => 1 ),\r
- array( 'lhs' => 125, 'rhs' => 1 ),\r
- array( 'lhs' => 126, 'rhs' => 1 ),\r
- array( 'lhs' => 126, 'rhs' => 1 ),\r
- array( 'lhs' => 126, 'rhs' => 1 ),\r
- array( 'lhs' => 109, 'rhs' => 3 ),\r
- array( 'lhs' => 127, 'rhs' => 1 ),\r
- array( 'lhs' => 127, 'rhs' => 3 ),\r
- array( 'lhs' => 127, 'rhs' => 0 ),\r
- array( 'lhs' => 128, 'rhs' => 3 ),\r
- array( 'lhs' => 128, 'rhs' => 3 ),\r
- array( 'lhs' => 128, 'rhs' => 1 ),\r
- array( 'lhs' => 114, 'rhs' => 2 ),\r
- array( 'lhs' => 114, 'rhs' => 1 ),\r
- array( 'lhs' => 129, 'rhs' => 3 ),\r
- array( 'lhs' => 129, 'rhs' => 3 ),\r
- array( 'lhs' => 129, 'rhs' => 1 ),\r
- array( 'lhs' => 129, 'rhs' => 3 ),\r
- array( 'lhs' => 129, 'rhs' => 3 ),\r
- array( 'lhs' => 129, 'rhs' => 1 ),\r
- array( 'lhs' => 129, 'rhs' => 1 ),\r
- array( 'lhs' => 106, 'rhs' => 1 ),\r
- array( 'lhs' => 106, 'rhs' => 0 ),\r
- );\r
-\r
- static public $yyReduceMap = array(\r
- 0 => 0,\r
- 5 => 0,\r
- 11 => 0,\r
- 17 => 0,\r
- 23 => 0,\r
- 24 => 0,\r
- 60 => 0,\r
- 61 => 0,\r
- 62 => 0,\r
- 83 => 0,\r
- 90 => 0,\r
- 95 => 0,\r
- 97 => 0,\r
- 98 => 0,\r
- 99 => 0,\r
- 101 => 0,\r
- 114 => 0,\r
- 187 => 0,\r
- 1 => 1,\r
- 2 => 2,\r
- 3 => 3,\r
- 4 => 4,\r
- 6 => 6,\r
- 7 => 7,\r
- 8 => 8,\r
- 9 => 9,\r
- 15 => 9,\r
- 21 => 9,\r
- 91 => 9,\r
- 93 => 9,\r
- 94 => 9,\r
- 10 => 10,\r
- 16 => 10,\r
- 19 => 10,\r
- 22 => 10,\r
- 12 => 12,\r
- 13 => 12,\r
- 14 => 12,\r
- 18 => 12,\r
- 20 => 20,\r
- 25 => 25,\r
- 26 => 25,\r
- 27 => 27,\r
- 28 => 28,\r
- 29 => 29,\r
- 30 => 29,\r
- 31 => 29,\r
- 32 => 29,\r
- 33 => 33,\r
- 34 => 33,\r
- 35 => 35,\r
- 36 => 35,\r
- 37 => 35,\r
- 38 => 38,\r
- 39 => 38,\r
- 40 => 38,\r
- 41 => 41,\r
- 42 => 41,\r
- 43 => 43,\r
- 44 => 44,\r
- 45 => 45,\r
- 46 => 46,\r
- 47 => 47,\r
- 49 => 47,\r
- 48 => 48,\r
- 50 => 50,\r
- 51 => 51,\r
- 52 => 52,\r
- 67 => 52,\r
- 146 => 52,\r
- 192 => 52,\r
- 53 => 53,\r
- 54 => 54,\r
- 55 => 55,\r
- 56 => 56,\r
- 57 => 57,\r
- 58 => 58,\r
- 59 => 58,\r
- 63 => 63,\r
- 64 => 64,\r
- 65 => 65,\r
- 66 => 66,\r
- 68 => 68,\r
- 69 => 69,\r
- 70 => 70,\r
- 71 => 70,\r
- 72 => 70,\r
- 73 => 70,\r
- 75 => 70,\r
- 74 => 74,\r
- 76 => 76,\r
- 77 => 77,\r
- 78 => 78,\r
- 79 => 79,\r
- 80 => 80,\r
- 87 => 80,\r
- 131 => 80,\r
- 154 => 80,\r
- 194 => 80,\r
- 201 => 80,\r
- 202 => 80,\r
- 81 => 81,\r
- 82 => 82,\r
- 84 => 84,\r
- 85 => 84,\r
- 86 => 84,\r
- 88 => 88,\r
- 89 => 88,\r
- 92 => 92,\r
- 96 => 96,\r
- 100 => 100,\r
- 102 => 102,\r
- 103 => 103,\r
- 104 => 104,\r
- 105 => 105,\r
- 106 => 106,\r
- 107 => 107,\r
- 108 => 108,\r
- 109 => 109,\r
- 110 => 110,\r
- 111 => 111,\r
- 112 => 112,\r
- 113 => 113,\r
- 115 => 115,\r
- 116 => 116,\r
- 117 => 117,\r
- 118 => 118,\r
- 193 => 118,\r
- 119 => 119,\r
- 151 => 119,\r
- 120 => 120,\r
- 121 => 121,\r
- 122 => 122,\r
- 123 => 122,\r
- 124 => 122,\r
- 125 => 125,\r
- 126 => 126,\r
- 129 => 126,\r
- 127 => 127,\r
- 128 => 128,\r
- 130 => 130,\r
- 203 => 130,\r
- 132 => 132,\r
- 133 => 133,\r
- 134 => 134,\r
- 156 => 134,\r
- 135 => 135,\r
- 136 => 136,\r
- 137 => 137,\r
- 138 => 138,\r
- 139 => 139,\r
- 140 => 140,\r
- 141 => 141,\r
- 142 => 142,\r
- 143 => 143,\r
- 144 => 144,\r
- 145 => 145,\r
- 147 => 147,\r
- 148 => 148,\r
- 149 => 148,\r
- 150 => 150,\r
- 152 => 152,\r
- 153 => 153,\r
- 155 => 155,\r
- 157 => 157,\r
- 158 => 158,\r
- 161 => 158,\r
- 172 => 158,\r
- 159 => 159,\r
- 160 => 160,\r
- 162 => 162,\r
- 163 => 163,\r
- 164 => 164,\r
- 169 => 164,\r
- 165 => 165,\r
- 168 => 165,\r
- 166 => 166,\r
- 171 => 166,\r
- 167 => 167,\r
- 170 => 167,\r
- 173 => 173,\r
- 174 => 174,\r
- 175 => 175,\r
- 176 => 176,\r
- 177 => 177,\r
- 178 => 178,\r
- 179 => 179,\r
- 180 => 180,\r
- 181 => 181,\r
- 182 => 182,\r
- 183 => 183,\r
- 184 => 184,\r
- 185 => 185,\r
- 186 => 186,\r
- 188 => 188,\r
- 189 => 189,\r
- 190 => 190,\r
- 191 => 191,\r
- 195 => 195,\r
- 198 => 195,\r
- 196 => 196,\r
- 197 => 197,\r
- 199 => 199,\r
- 200 => 200,\r
- );\r
-#line 81 "smarty_internal_templateparser.y"\r
- function yy_r0(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2044 "smarty_internal_templateparser.php"\r
-#line 87 "smarty_internal_templateparser.y"\r
- function yy_r1(){if ($this->template->extract_code == false) {\r
- $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;\r
- } else {\r
- // store code in extract buffer\r
- $this->template->extracted_compiled_code .= $this->yystack[$this->yyidx + 0]->minor;\r
- } \r
- }\r
-#line 2053 "smarty_internal_templateparser.php"\r
-#line 95 "smarty_internal_templateparser.y"\r
- function yy_r2(){if ($this->template->extract_code == false) {\r
- $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor;\r
- } else {\r
- // store code in extract buffer\r
- $this->template->extracted_compiled_code .= $this->yystack[$this->yyidx + 0]->minor;\r
- $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor;\r
- } \r
- }\r
-#line 2063 "smarty_internal_templateparser.php"\r
-#line 108 "smarty_internal_templateparser.y"\r
- function yy_r3(){\r
- if ($this->compiler->has_code) {\r
- $tmp =''; foreach ($this->compiler->prefix_code as $code) {$tmp.=$code;} $this->compiler->prefix_code=array();\r
- $this->_retvalue = $this->compiler->processNocacheCode($tmp.$this->yystack[$this->yyidx + 0]->minor,true);\r
- } else { $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor;} $this->compiler->has_variable_string = false; }\r
-#line 2070 "smarty_internal_templateparser.php"\r
-#line 115 "smarty_internal_templateparser.y"\r
- function yy_r4(){ $this->_retvalue = ''; }\r
-#line 2073 "smarty_internal_templateparser.php"\r
-#line 121 "smarty_internal_templateparser.y"\r
- function yy_r6(){\r
- if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU) {\r
- $this->_retvalue = self::escape_start_tag($this->yystack[$this->yyidx + -2]->minor) . str_replace('<?','<?',$this->yystack[$this->yyidx + -1]->minor) . '?<??>>';\r
- } elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) {\r
- $this->_retvalue = $this->compiler->processNocacheCode(htmlspecialchars($this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.'?>', ENT_QUOTES), false);\r
- }elseif ($this->sec_obj->php_handling == SMARTY_PHP_ALLOW) {\r
- $this->_retvalue = $this->compiler->processNocacheCode('<?php'.$this->yystack[$this->yyidx + -1]->minor.'?>', true);\r
- }elseif ($this->sec_obj->php_handling == SMARTY_PHP_REMOVE) {\r
- $this->_retvalue = '';\r
- }\r
- }\r
-#line 2086 "smarty_internal_templateparser.php"\r
-#line 135 "smarty_internal_templateparser.y"\r
- function yy_r7(){if ($this->lex->strip) {\r
- $this->_retvalue = preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor); \r
- } else {\r
- $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; \r
- }\r
- }\r
-#line 2094 "smarty_internal_templateparser.php"\r
-#line 141 "smarty_internal_templateparser.y"\r
- function yy_r8(){if ($this->lex->strip) {\r
- $this->_retvalue = preg_replace('![\$this->yystack[$this->yyidx + 0]->minor ]*[\r\n]+[\$this->yystack[$this->yyidx + 0]->minor ]*!', '', self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor)); \r
- } else {\r
- $this->_retvalue = self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor); \r
- }\r
- }\r
-#line 2102 "smarty_internal_templateparser.php"\r
-#line 150 "smarty_internal_templateparser.y"\r
- function yy_r9(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2105 "smarty_internal_templateparser.php"\r
-#line 151 "smarty_internal_templateparser.y"\r
- function yy_r10(){ $this->_retvalue = ''; }\r
-#line 2108 "smarty_internal_templateparser.php"\r
-#line 154 "smarty_internal_templateparser.y"\r
- function yy_r12(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2111 "smarty_internal_templateparser.php"\r
-#line 167 "smarty_internal_templateparser.y"\r
- function yy_r20(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; }\r
-#line 2114 "smarty_internal_templateparser.php"\r
-#line 174 "smarty_internal_templateparser.y"\r
- function yy_r25(){ $this->_retvalue = self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor); }\r
-#line 2117 "smarty_internal_templateparser.php"\r
-#line 176 "smarty_internal_templateparser.y"\r
- function yy_r27(){ $this->_retvalue = self::escape_end_tag($this->yystack[$this->yyidx + 0]->minor); }\r
-#line 2120 "smarty_internal_templateparser.php"\r
-#line 184 "smarty_internal_templateparser.y"\r
- function yy_r28(){ $this->_retvalue = $this->compiler->compileTag('private_print_expression',array('value'=>$this->yystack[$this->yyidx + -1]->minor)); }\r
-#line 2123 "smarty_internal_templateparser.php"\r
-#line 185 "smarty_internal_templateparser.y"\r
- function yy_r29(){ $this->_retvalue = $this->compiler->compileTag('private_print_expression',array_merge(array('value'=>$this->yystack[$this->yyidx + -2]->minor),$this->yystack[$this->yyidx + -1]->minor)); }\r
-#line 2126 "smarty_internal_templateparser.php"\r
-#line 196 "smarty_internal_templateparser.y"\r
- function yy_r33(){ $this->_retvalue = $this->compiler->compileTag('assign',array('value'=>$this->yystack[$this->yyidx + -1]->minor,'var'=>"'".$this->yystack[$this->yyidx + -3]->minor."'")); }\r
-#line 2129 "smarty_internal_templateparser.php"\r
-#line 198 "smarty_internal_templateparser.y"\r
- function yy_r35(){ $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array('value'=>$this->yystack[$this->yyidx + -2]->minor,'var'=>"'".$this->yystack[$this->yyidx + -4]->minor."'"),$this->yystack[$this->yyidx + -1]->minor)); }\r
-#line 2132 "smarty_internal_templateparser.php"\r
-#line 201 "smarty_internal_templateparser.y"\r
- function yy_r38(){ $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)); }\r
-#line 2135 "smarty_internal_templateparser.php"\r
-#line 205 "smarty_internal_templateparser.y"\r
- function yy_r41(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor,$this->yystack[$this->yyidx + -1]->minor); }\r
-#line 2138 "smarty_internal_templateparser.php"\r
-#line 207 "smarty_internal_templateparser.y"\r
- function yy_r43(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor,array()); }\r
-#line 2141 "smarty_internal_templateparser.php"\r
-#line 209 "smarty_internal_templateparser.y"\r
- function yy_r44(){ $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)); }\r
-#line 2144 "smarty_internal_templateparser.php"\r
-#line 211 "smarty_internal_templateparser.y"\r
- function yy_r45(){ $this->_retvalue = '<?php ob_start();?>'.$this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor,$this->yystack[$this->yyidx + -1]->minor).'<?php echo ';\r
- $this->_retvalue .= $this->compiler->compileTag('private_modifier',array('modifier'=>$this->yystack[$this->yyidx + -3]->minor,'params'=>'ob_get_clean()'.$this->yystack[$this->yyidx + -2]->minor)).'?>';\r
- }\r
-#line 2149 "smarty_internal_templateparser.php"\r
-#line 215 "smarty_internal_templateparser.y"\r
- function yy_r46(){ $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 ';\r
- $this->_retvalue .= $this->compiler->compileTag('private_modifier',array('modifier'=>$this->yystack[$this->yyidx + -3]->minor,'params'=>'ob_get_clean()'.$this->yystack[$this->yyidx + -2]->minor)).'?>';\r
- }\r
-#line 2154 "smarty_internal_templateparser.php"\r
-#line 219 "smarty_internal_templateparser.y"\r
- function yy_r47(){ $this->_retvalue = $this->compiler->compileTag(($this->yystack[$this->yyidx + -3]->minor == 'else if')? 'elseif' : $this->yystack[$this->yyidx + -3]->minor,array('if condition'=>$this->yystack[$this->yyidx + -1]->minor)); }\r
-#line 2157 "smarty_internal_templateparser.php"\r
-#line 220 "smarty_internal_templateparser.y"\r
- function yy_r48(){ $this->_retvalue = $this->compiler->compileTag(($this->yystack[$this->yyidx + -3]->minor == 'else if')? 'elseif' : $this->yystack[$this->yyidx + -3]->minor,array('if condition'=>trim($this->yystack[$this->yyidx + -2]->minor).$this->yystack[$this->yyidx + -1]->minor)); }\r
-#line 2160 "smarty_internal_templateparser.php"\r
-#line 223 "smarty_internal_templateparser.y"\r
- function yy_r50(){\r
- $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)); }\r
-#line 2164 "smarty_internal_templateparser.php"\r
-#line 225 "smarty_internal_templateparser.y"\r
- function yy_r51(){ $this->_retvalue = '='.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2167 "smarty_internal_templateparser.php"\r
-#line 226 "smarty_internal_templateparser.y"\r
- function yy_r52(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2170 "smarty_internal_templateparser.php"\r
-#line 227 "smarty_internal_templateparser.y"\r
- function yy_r53(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -6]->minor,array_merge(array('start'=>$this->yystack[$this->yyidx + -4]->minor,'to'=>$this->yystack[$this->yyidx + -2]->minor),$this->yystack[$this->yyidx + -1]->minor)); }\r
-#line 2173 "smarty_internal_templateparser.php"\r
-#line 230 "smarty_internal_templateparser.y"\r
- function yy_r54(){\r
- $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)); }\r
-#line 2177 "smarty_internal_templateparser.php"\r
-#line 232 "smarty_internal_templateparser.y"\r
- function yy_r55(){\r
- $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)); }\r
-#line 2181 "smarty_internal_templateparser.php"\r
-#line 234 "smarty_internal_templateparser.y"\r
- function yy_r56(){ \r
- $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)); }\r
-#line 2185 "smarty_internal_templateparser.php"\r
-#line 236 "smarty_internal_templateparser.y"\r
- function yy_r57(){ \r
- $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)); }\r
-#line 2189 "smarty_internal_templateparser.php"\r
-#line 240 "smarty_internal_templateparser.y"\r
- function yy_r58(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor.'close',array()); }\r
-#line 2192 "smarty_internal_templateparser.php"\r
-#line 245 "smarty_internal_templateparser.y"\r
- function yy_r63(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor.'close',$this->yystack[$this->yyidx + -1]->minor); }\r
-#line 2195 "smarty_internal_templateparser.php"\r
-#line 246 "smarty_internal_templateparser.y"\r
- function yy_r64(){ $this->_retvalue = '<?php ob_start();?>'.$this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor.'close',$this->yystack[$this->yyidx + -1]->minor).'<?php echo ';\r
- $this->_retvalue .= $this->compiler->compileTag('private_modifier',array('modifier'=>$this->yystack[$this->yyidx + -3]->minor,'params'=>'ob_get_clean()'.$this->yystack[$this->yyidx + -2]->minor)).'?>';\r
- }\r
-#line 2200 "smarty_internal_templateparser.php"\r
-#line 250 "smarty_internal_templateparser.y"\r
- function yy_r65(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor.'close',array('object_methode'=>$this->yystack[$this->yyidx + -1]->minor)); }\r
-#line 2203 "smarty_internal_templateparser.php"\r
-#line 257 "smarty_internal_templateparser.y"\r
- function yy_r66(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); }\r
-#line 2206 "smarty_internal_templateparser.php"\r
-#line 261 "smarty_internal_templateparser.y"\r
- function yy_r68(){ $this->_retvalue = array(); }\r
-#line 2209 "smarty_internal_templateparser.php"\r
-#line 264 "smarty_internal_templateparser.y"\r
- function yy_r69(){ $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>"'".$this->yystack[$this->yyidx + 0]->minor."'"); }\r
-#line 2212 "smarty_internal_templateparser.php"\r
-#line 265 "smarty_internal_templateparser.y"\r
- function yy_r70(){ $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>$this->yystack[$this->yyidx + 0]->minor); }\r
-#line 2215 "smarty_internal_templateparser.php"\r
-#line 269 "smarty_internal_templateparser.y"\r
- function yy_r74(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor=>'true'); }\r
-#line 2218 "smarty_internal_templateparser.php"\r
-#line 276 "smarty_internal_templateparser.y"\r
- function yy_r76(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); }\r
-#line 2221 "smarty_internal_templateparser.php"\r
-#line 277 "smarty_internal_templateparser.y"\r
- function yy_r77(){ $this->yystack[$this->yyidx + -2]->minor[]=$this->yystack[$this->yyidx + 0]->minor; $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor; }\r
-#line 2224 "smarty_internal_templateparser.php"\r
-#line 279 "smarty_internal_templateparser.y"\r
- function yy_r78(){ $this->_retvalue = array('var' => $this->yystack[$this->yyidx + -2]->minor, 'value'=>$this->yystack[$this->yyidx + 0]->minor); }\r
-#line 2227 "smarty_internal_templateparser.php"\r
-#line 285 "smarty_internal_templateparser.y"\r
- function yy_r79(){ $this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; }\r
-#line 2230 "smarty_internal_templateparser.php"\r
-#line 286 "smarty_internal_templateparser.y"\r
- function yy_r80(){$this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2233 "smarty_internal_templateparser.php"\r
-#line 288 "smarty_internal_templateparser.y"\r
- function yy_r81(){$this->_retvalue = '$_smarty_tpl->getStreamVariable(\''. $this->yystack[$this->yyidx + -2]->minor .'://'. $this->yystack[$this->yyidx + 0]->minor . '\')'; }\r
-#line 2236 "smarty_internal_templateparser.php"\r
-#line 289 "smarty_internal_templateparser.y"\r
- function yy_r82(){ $this->_retvalue = $this->compiler->compileTag('private_modifier',array('modifier'=>$this->yystack[$this->yyidx + -1]->minor,'params'=>$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor)); }\r
-#line 2239 "smarty_internal_templateparser.php"\r
-#line 294 "smarty_internal_templateparser.y"\r
- function yy_r84(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor . trim($this->yystack[$this->yyidx + -1]->minor) . $this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2242 "smarty_internal_templateparser.php"\r
-#line 307 "smarty_internal_templateparser.y"\r
- function yy_r88(){ $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2245 "smarty_internal_templateparser.php"\r
-#line 316 "smarty_internal_templateparser.y"\r
- function yy_r92(){ $this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2248 "smarty_internal_templateparser.php"\r
-#line 321 "smarty_internal_templateparser.y"\r
- function yy_r96(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2251 "smarty_internal_templateparser.php"\r
-#line 331 "smarty_internal_templateparser.y"\r
- function yy_r100(){ $this->_retvalue = "(". $this->yystack[$this->yyidx + -1]->minor .")"; }\r
-#line 2254 "smarty_internal_templateparser.php"\r
-#line 335 "smarty_internal_templateparser.y"\r
- function yy_r102(){ $_s = str_replace(array('."".','.""'),array('.',''),'"'.$this->yystack[$this->yyidx + -1]->minor.'"'); \r
- if (substr($_s,0,3) == '"".') {\r
- $this->_retvalue = substr($_s,3);\r
- } else {\r
- $this->_retvalue = $_s;\r
- }\r
- }\r
-#line 2263 "smarty_internal_templateparser.php"\r
-#line 342 "smarty_internal_templateparser.y"\r
- function yy_r103(){ $this->_retvalue = "''"; }\r
-#line 2266 "smarty_internal_templateparser.php"\r
-#line 344 "smarty_internal_templateparser.y"\r
- function yy_r104(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2269 "smarty_internal_templateparser.php"\r
-#line 345 "smarty_internal_templateparser.y"\r
- function yy_r105(){ $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 .')'; }\r
-#line 2272 "smarty_internal_templateparser.php"\r
-#line 347 "smarty_internal_templateparser.y"\r
- function yy_r106(){ $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor.'::'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2275 "smarty_internal_templateparser.php"\r
-#line 348 "smarty_internal_templateparser.y"\r
- function yy_r107(){ $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; }\r
-#line 2278 "smarty_internal_templateparser.php"\r
-#line 350 "smarty_internal_templateparser.y"\r
- function yy_r108(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2281 "smarty_internal_templateparser.php"\r
-#line 352 "smarty_internal_templateparser.y"\r
- function yy_r109(){ $this->_retvalue = $this->yystack[$this->yyidx + -4]->minor.'::$'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2284 "smarty_internal_templateparser.php"\r
-#line 354 "smarty_internal_templateparser.y"\r
- function yy_r110(){ $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; }\r
-#line 2287 "smarty_internal_templateparser.php"\r
-#line 356 "smarty_internal_templateparser.y"\r
- function yy_r111(){ $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; }\r
-#line 2290 "smarty_internal_templateparser.php"\r
-#line 365 "smarty_internal_templateparser.y"\r
- function yy_r112(){if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\'smarty\'') { $this->_retvalue = $this->compiler->compileTag('private_special_variable',$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']);} else {\r
- $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + 0]->minor['var'] .')->value'.$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor['var'],"'"), null, true, false)->nocache;} }\r
-#line 2294 "smarty_internal_templateparser.php"\r
-#line 368 "smarty_internal_templateparser.y"\r
- function yy_r113(){ $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,"'"), null, true, false)->nocache; }\r
-#line 2297 "smarty_internal_templateparser.php"\r
-#line 372 "smarty_internal_templateparser.y"\r
- function yy_r115(){$this->_retvalue = '$_smarty_tpl->getConfigVariable(\''. $this->yystack[$this->yyidx + -1]->minor .'\')'; }\r
-#line 2300 "smarty_internal_templateparser.php"\r
-#line 373 "smarty_internal_templateparser.y"\r
- function yy_r116(){$this->_retvalue = '$_smarty_tpl->getConfigVariable('. $this->yystack[$this->yyidx + -1]->minor .')'; }\r
-#line 2303 "smarty_internal_templateparser.php"\r
-#line 376 "smarty_internal_templateparser.y"\r
- function yy_r117(){$this->_retvalue = array('var'=>$this->yystack[$this->yyidx + -1]->minor, 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); }\r
-#line 2306 "smarty_internal_templateparser.php"\r
-#line 382 "smarty_internal_templateparser.y"\r
- function yy_r118(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2309 "smarty_internal_templateparser.php"\r
-#line 384 "smarty_internal_templateparser.y"\r
- function yy_r119(){return; }\r
-#line 2312 "smarty_internal_templateparser.php"\r
-#line 388 "smarty_internal_templateparser.y"\r
- function yy_r120(){ $this->_retvalue = '[$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + 0]->minor .')->value]'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable('$this->yystack[$this->yyidx + 0]->minor', null, true, false)->nocache; }\r
-#line 2315 "smarty_internal_templateparser.php"\r
-#line 389 "smarty_internal_templateparser.y"\r
- function yy_r121(){ $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,"'"), null, true, false)->nocache; }\r
-#line 2318 "smarty_internal_templateparser.php"\r
-#line 392 "smarty_internal_templateparser.y"\r
- function yy_r122(){ $this->_retvalue = "['". $this->yystack[$this->yyidx + 0]->minor ."']"; }\r
-#line 2321 "smarty_internal_templateparser.php"\r
-#line 396 "smarty_internal_templateparser.y"\r
- function yy_r125(){ $this->_retvalue = "[". $this->yystack[$this->yyidx + 0]->minor ."]"; }\r
-#line 2324 "smarty_internal_templateparser.php"\r
-#line 397 "smarty_internal_templateparser.y"\r
- function yy_r126(){ $this->_retvalue = "[". $this->yystack[$this->yyidx + -1]->minor ."]"; }\r
-#line 2327 "smarty_internal_templateparser.php"\r
-#line 399 "smarty_internal_templateparser.y"\r
- function yy_r127(){ $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable','[\'section\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\'][\'index\']').']'; }\r
-#line 2330 "smarty_internal_templateparser.php"\r
-#line 400 "smarty_internal_templateparser.y"\r
- function yy_r128(){ $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable','[\'section\'][\''.$this->yystack[$this->yyidx + -3]->minor.'\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\']').']'; }\r
-#line 2333 "smarty_internal_templateparser.php"\r
-#line 404 "smarty_internal_templateparser.y"\r
- function yy_r130(){$this->_retvalue = ''; }\r
-#line 2336 "smarty_internal_templateparser.php"\r
-#line 412 "smarty_internal_templateparser.y"\r
- function yy_r132(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2339 "smarty_internal_templateparser.php"\r
-#line 414 "smarty_internal_templateparser.y"\r
- function yy_r133(){$this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; }\r
-#line 2342 "smarty_internal_templateparser.php"\r
-#line 417 "smarty_internal_templateparser.y"\r
- function yy_r134(){$this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')'; }\r
-#line 2345 "smarty_internal_templateparser.php"\r
-#line 422 "smarty_internal_templateparser.y"\r
- function yy_r135(){ if ($this->yystack[$this->yyidx + -1]->minor['var'] == '\'smarty\'') { $this->_retvalue = $this->compiler->compileTag('private_special_variable',$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index']).$this->yystack[$this->yyidx + 0]->minor;} else {\r
- $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -1]->minor['var'] .')->value'.$this->yystack[$this->yyidx + -1]->minor['smarty_internal_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'],"'"), null, true, false)->nocache;} }\r
-#line 2349 "smarty_internal_templateparser.php"\r
-#line 425 "smarty_internal_templateparser.y"\r
- function yy_r136(){$this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2352 "smarty_internal_templateparser.php"\r
-#line 427 "smarty_internal_templateparser.y"\r
- function yy_r137(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2355 "smarty_internal_templateparser.php"\r
-#line 429 "smarty_internal_templateparser.y"\r
- function yy_r138(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2358 "smarty_internal_templateparser.php"\r
-#line 430 "smarty_internal_templateparser.y"\r
- function yy_r139(){ $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; }\r
-#line 2361 "smarty_internal_templateparser.php"\r
-#line 431 "smarty_internal_templateparser.y"\r
- function yy_r140(){ $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; }\r
-#line 2364 "smarty_internal_templateparser.php"\r
-#line 432 "smarty_internal_templateparser.y"\r
- function yy_r141(){ $this->_retvalue = '->{\''.$this->yystack[$this->yyidx + -4]->minor.'\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; }\r
-#line 2367 "smarty_internal_templateparser.php"\r
-#line 434 "smarty_internal_templateparser.y"\r
- function yy_r142(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2370 "smarty_internal_templateparser.php"\r
-#line 440 "smarty_internal_templateparser.y"\r
- function yy_r143(){if (!$this->template->security || $this->smarty->security_handler->isTrustedPhpFunction($this->yystack[$this->yyidx + -3]->minor, $this->compiler)) {\r
- 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)) {\r
- $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". $this->yystack[$this->yyidx + -1]->minor .")";\r
- } else {\r
- $this->compiler->trigger_template_error ("unknown function \"" . $this->yystack[$this->yyidx + -3]->minor . "\"");\r
- }\r
- } }\r
-#line 2379 "smarty_internal_templateparser.php"\r
-#line 451 "smarty_internal_templateparser.y"\r
- function yy_r144(){ $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". $this->yystack[$this->yyidx + -1]->minor .")"; }\r
-#line 2382 "smarty_internal_templateparser.php"\r
-#line 455 "smarty_internal_templateparser.y"\r
- function yy_r145(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.",".$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2385 "smarty_internal_templateparser.php"\r
-#line 459 "smarty_internal_templateparser.y"\r
- function yy_r147(){ return; }\r
-#line 2388 "smarty_internal_templateparser.php"\r
-#line 464 "smarty_internal_templateparser.y"\r
- function yy_r148(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2391 "smarty_internal_templateparser.php"\r
-#line 477 "smarty_internal_templateparser.y"\r
- function yy_r150(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2394 "smarty_internal_templateparser.php"\r
-#line 481 "smarty_internal_templateparser.y"\r
- function yy_r152(){$this->_retvalue = ','.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2397 "smarty_internal_templateparser.php"\r
-#line 482 "smarty_internal_templateparser.y"\r
- function yy_r153(){$this->_retvalue = ',\''.$this->yystack[$this->yyidx + 0]->minor.'\''; }\r
-#line 2400 "smarty_internal_templateparser.php"\r
-#line 489 "smarty_internal_templateparser.y"\r
- function yy_r155(){$this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2403 "smarty_internal_templateparser.php"\r
-#line 494 "smarty_internal_templateparser.y"\r
- function yy_r157(){$this->_retvalue =$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2406 "smarty_internal_templateparser.php"\r
-#line 495 "smarty_internal_templateparser.y"\r
- function yy_r158(){$this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2409 "smarty_internal_templateparser.php"\r
-#line 496 "smarty_internal_templateparser.y"\r
- function yy_r159(){$this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor.')'; }\r
-#line 2412 "smarty_internal_templateparser.php"\r
-#line 497 "smarty_internal_templateparser.y"\r
- function yy_r160(){$this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.',(array)'.$this->yystack[$this->yyidx + 0]->minor.')'; }\r
-#line 2415 "smarty_internal_templateparser.php"\r
-#line 499 "smarty_internal_templateparser.y"\r
- function yy_r162(){$this->_retvalue = '!('.$this->yystack[$this->yyidx + -2]->minor.' % '.$this->yystack[$this->yyidx + 0]->minor.')'; }\r
-#line 2418 "smarty_internal_templateparser.php"\r
-#line 500 "smarty_internal_templateparser.y"\r
- function yy_r163(){$this->_retvalue = '('.$this->yystack[$this->yyidx + -2]->minor.' % '.$this->yystack[$this->yyidx + 0]->minor.')'; }\r
-#line 2421 "smarty_internal_templateparser.php"\r
-#line 501 "smarty_internal_templateparser.y"\r
- function yy_r164(){$this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; }\r
-#line 2424 "smarty_internal_templateparser.php"\r
-#line 502 "smarty_internal_templateparser.y"\r
- function yy_r165(){$this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; }\r
-#line 2427 "smarty_internal_templateparser.php"\r
-#line 503 "smarty_internal_templateparser.y"\r
- function yy_r166(){$this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')'; }\r
-#line 2430 "smarty_internal_templateparser.php"\r
-#line 504 "smarty_internal_templateparser.y"\r
- function yy_r167(){$this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')'; }\r
-#line 2433 "smarty_internal_templateparser.php"\r
-#line 510 "smarty_internal_templateparser.y"\r
- function yy_r173(){$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; }\r
-#line 2436 "smarty_internal_templateparser.php"\r
-#line 512 "smarty_internal_templateparser.y"\r
- function yy_r174(){$this->_retvalue = '=='; }\r
-#line 2439 "smarty_internal_templateparser.php"\r
-#line 513 "smarty_internal_templateparser.y"\r
- function yy_r175(){$this->_retvalue = '!='; }\r
-#line 2442 "smarty_internal_templateparser.php"\r
-#line 514 "smarty_internal_templateparser.y"\r
- function yy_r176(){$this->_retvalue = '>'; }\r
-#line 2445 "smarty_internal_templateparser.php"\r
-#line 515 "smarty_internal_templateparser.y"\r
- function yy_r177(){$this->_retvalue = '<'; }\r
-#line 2448 "smarty_internal_templateparser.php"\r
-#line 516 "smarty_internal_templateparser.y"\r
- function yy_r178(){$this->_retvalue = '>='; }\r
-#line 2451 "smarty_internal_templateparser.php"\r
-#line 517 "smarty_internal_templateparser.y"\r
- function yy_r179(){$this->_retvalue = '<='; }\r
-#line 2454 "smarty_internal_templateparser.php"\r
-#line 518 "smarty_internal_templateparser.y"\r
- function yy_r180(){$this->_retvalue = '==='; }\r
-#line 2457 "smarty_internal_templateparser.php"\r
-#line 519 "smarty_internal_templateparser.y"\r
- function yy_r181(){$this->_retvalue = '!=='; }\r
-#line 2460 "smarty_internal_templateparser.php"\r
-#line 520 "smarty_internal_templateparser.y"\r
- function yy_r182(){$this->_retvalue = '%'; }\r
-#line 2463 "smarty_internal_templateparser.php"\r
-#line 522 "smarty_internal_templateparser.y"\r
- function yy_r183(){$this->_retvalue = '&&'; }\r
-#line 2466 "smarty_internal_templateparser.php"\r
-#line 523 "smarty_internal_templateparser.y"\r
- function yy_r184(){$this->_retvalue = '||'; }\r
-#line 2469 "smarty_internal_templateparser.php"\r
-#line 524 "smarty_internal_templateparser.y"\r
- function yy_r185(){$this->_retvalue = ' XOR '; }\r
-#line 2472 "smarty_internal_templateparser.php"\r
-#line 529 "smarty_internal_templateparser.y"\r
- function yy_r186(){ $this->_retvalue = 'array('.$this->yystack[$this->yyidx + -1]->minor.')'; }\r
-#line 2475 "smarty_internal_templateparser.php"\r
-#line 531 "smarty_internal_templateparser.y"\r
- function yy_r188(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2478 "smarty_internal_templateparser.php"\r
-#line 532 "smarty_internal_templateparser.y"\r
- function yy_r189(){ return; }\r
-#line 2481 "smarty_internal_templateparser.php"\r
-#line 533 "smarty_internal_templateparser.y"\r
- function yy_r190(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2484 "smarty_internal_templateparser.php"\r
-#line 534 "smarty_internal_templateparser.y"\r
- function yy_r191(){ $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor; }\r
-#line 2487 "smarty_internal_templateparser.php"\r
-#line 543 "smarty_internal_templateparser.y"\r
- function yy_r195(){if (substr($this->yystack[$this->yyidx + -1]->minor,0,1) == '\'' || substr($this->yystack[$this->yyidx + -1]->minor,0,1) == '@') {\r
- $this->_retvalue = '".'.$this->yystack[$this->yyidx + -1]->minor.'."'; $this->compiler->has_variable_string = true;\r
- } else {\r
- $this->_retvalue = '{'.$this->yystack[$this->yyidx + -1]->minor.'}'; $this->compiler->has_variable_string = true;\r
- }\r
- }\r
-#line 2495 "smarty_internal_templateparser.php"\r
-#line 549 "smarty_internal_templateparser.y"\r
- function yy_r196(){$this->_retvalue = '{'.$this->yystack[$this->yyidx + -1]->minor.'}'; $this->compiler->has_variable_string = true; }\r
-#line 2498 "smarty_internal_templateparser.php"\r
-#line 550 "smarty_internal_templateparser.y"\r
- function yy_r197(){$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,"'"), null, true, false)->nocache; $this->compiler->has_variable_string = true; }\r
-#line 2501 "smarty_internal_templateparser.php"\r
-#line 557 "smarty_internal_templateparser.y"\r
- function yy_r199(){ $this->_retvalue = '".('.$this->yystack[$this->yyidx + -1]->minor.')."'; $this->compiler->has_variable_string = true; }\r
-#line 2504 "smarty_internal_templateparser.php"\r
-#line 558 "smarty_internal_templateparser.y"\r
- function yy_r200(){ $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; }\r
-#line 2507 "smarty_internal_templateparser.php"\r
-\r
- private $_retvalue;\r
-\r
- function yy_reduce($yyruleno)\r
- {\r
- $yymsp = $this->yystack[$this->yyidx];\r
- if (self::$yyTraceFILE && $yyruleno >= 0 \r
- && $yyruleno < count(self::$yyRuleName)) {\r
- fprintf(self::$yyTraceFILE, "%sReduce (%d) [%s].\n",\r
- self::$yyTracePrompt, $yyruleno,\r
- self::$yyRuleName[$yyruleno]);\r
- }\r
-\r
- $this->_retvalue = $yy_lefthand_side = null;\r
- if (array_key_exists($yyruleno, self::$yyReduceMap)) {\r
- // call the action\r
- $this->_retvalue = null;\r
- $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}();\r
- $yy_lefthand_side = $this->_retvalue;\r
- }\r
- $yygoto = self::$yyRuleInfo[$yyruleno]['lhs'];\r
- $yysize = self::$yyRuleInfo[$yyruleno]['rhs'];\r
- $this->yyidx -= $yysize;\r
- for($i = $yysize; $i; $i--) {\r
- // pop all of the right-hand side parameters\r
- array_pop($this->yystack);\r
- }\r
- $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto);\r
- if ($yyact < self::YYNSTATE) {\r
- if (!self::$yyTraceFILE && $yysize) {\r
- $this->yyidx++;\r
- $x = new TP_yyStackEntry;\r
- $x->stateno = $yyact;\r
- $x->major = $yygoto;\r
- $x->minor = $yy_lefthand_side;\r
- $this->yystack[$this->yyidx] = $x;\r
- } else {\r
- $this->yy_shift($yyact, $yygoto, $yy_lefthand_side);\r
- }\r
- } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) {\r
- $this->yy_accept();\r
- }\r
- }\r
-\r
- function yy_parse_failed()\r
- {\r
- if (self::$yyTraceFILE) {\r
- fprintf(self::$yyTraceFILE, "%sFail!\n", self::$yyTracePrompt);\r
- }\r
- while ($this->yyidx >= 0) {\r
- $this->yy_pop_parser_stack();\r
- }\r
- }\r
-\r
- function yy_syntax_error($yymajor, $TOKEN)\r
- {\r
-#line 71 "smarty_internal_templateparser.y"\r
-\r
- $this->internalError = true;\r
- $this->yymajor = $yymajor;\r
- $this->compiler->trigger_template_error();\r
-#line 2570 "smarty_internal_templateparser.php"\r
- }\r
-\r
- function yy_accept()\r
- {\r
- if (self::$yyTraceFILE) {\r
- fprintf(self::$yyTraceFILE, "%sAccept!\n", self::$yyTracePrompt);\r
- }\r
- while ($this->yyidx >= 0) {\r
- $stack = $this->yy_pop_parser_stack();\r
- }\r
-#line 63 "smarty_internal_templateparser.y"\r
-\r
- $this->successful = !$this->internalError;\r
- $this->internalError = false;\r
- $this->retvalue = $this->_retvalue;\r
- //echo $this->retvalue."\n\n";\r
-#line 2588 "smarty_internal_templateparser.php"\r
- }\r
-\r
- function doParse($yymajor, $yytokenvalue)\r
- {\r
- $yyerrorhit = 0; /* True if yymajor has invoked an error */\r
- \r
- if ($this->yyidx === null || $this->yyidx < 0) {\r
- $this->yyidx = 0;\r
- $this->yyerrcnt = -1;\r
- $x = new TP_yyStackEntry;\r
- $x->stateno = 0;\r
- $x->major = 0;\r
- $this->yystack = array();\r
- array_push($this->yystack, $x);\r
- }\r
- $yyendofinput = ($yymajor==0);\r
- \r
- if (self::$yyTraceFILE) {\r
- fprintf(self::$yyTraceFILE, "%sInput %s\n",\r
- self::$yyTracePrompt, $this->yyTokenName[$yymajor]);\r
- }\r
- \r
- do {\r
- $yyact = $this->yy_find_shift_action($yymajor);\r
- if ($yymajor < self::YYERRORSYMBOL &&\r
- !$this->yy_is_expected_token($yymajor)) {\r
- // force a syntax error\r
- $yyact = self::YY_ERROR_ACTION;\r
- }\r
- if ($yyact < self::YYNSTATE) {\r
- $this->yy_shift($yyact, $yymajor, $yytokenvalue);\r
- $this->yyerrcnt--;\r
- if ($yyendofinput && $this->yyidx >= 0) {\r
- $yymajor = 0;\r
- } else {\r
- $yymajor = self::YYNOCODE;\r
- }\r
- } elseif ($yyact < self::YYNSTATE + self::YYNRULE) {\r
- $this->yy_reduce($yyact - self::YYNSTATE);\r
- } elseif ($yyact == self::YY_ERROR_ACTION) {\r
- if (self::$yyTraceFILE) {\r
- fprintf(self::$yyTraceFILE, "%sSyntax Error!\n",\r
- self::$yyTracePrompt);\r
- }\r
- if (self::YYERRORSYMBOL) {\r
- if ($this->yyerrcnt < 0) {\r
- $this->yy_syntax_error($yymajor, $yytokenvalue);\r
- }\r
- $yymx = $this->yystack[$this->yyidx]->major;\r
- if ($yymx == self::YYERRORSYMBOL || $yyerrorhit ){\r
- if (self::$yyTraceFILE) {\r
- fprintf(self::$yyTraceFILE, "%sDiscard input token %s\n",\r
- self::$yyTracePrompt, $this->yyTokenName[$yymajor]);\r
- }\r
- $this->yy_destructor($yymajor, $yytokenvalue);\r
- $yymajor = self::YYNOCODE;\r
- } else {\r
- while ($this->yyidx >= 0 &&\r
- $yymx != self::YYERRORSYMBOL &&\r
- ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE\r
- ){\r
- $this->yy_pop_parser_stack();\r
- }\r
- if ($this->yyidx < 0 || $yymajor==0) {\r
- $this->yy_destructor($yymajor, $yytokenvalue);\r
- $this->yy_parse_failed();\r
- $yymajor = self::YYNOCODE;\r
- } elseif ($yymx != self::YYERRORSYMBOL) {\r
- $u2 = 0;\r
- $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2);\r
- }\r
- }\r
- $this->yyerrcnt = 3;\r
- $yyerrorhit = 1;\r
- } else {\r
- if ($this->yyerrcnt <= 0) {\r
- $this->yy_syntax_error($yymajor, $yytokenvalue);\r
- }\r
- $this->yyerrcnt = 3;\r
- $this->yy_destructor($yymajor, $yytokenvalue);\r
- if ($yyendofinput) {\r
- $this->yy_parse_failed();\r
- }\r
- $yymajor = self::YYNOCODE;\r
- }\r
- } else {\r
- $this->yy_accept();\r
- $yymajor = self::YYNOCODE;\r
- } \r
- } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0);\r
- }\r
-}\r
-?>\r
+<?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
+*/
+
+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]);
+ }
+}
+
+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 */
+};
+
+
+#line 12 "smarty_internal_templateparser.y"
+class Smarty_Internal_Templateparser#line 79 "smarty_internal_templateparser.php"
+{
+#line 14 "smarty_internal_templateparser.y"
+
+ const Err1 = "Security error: Call to private object member not allowed";
+ const Err2 = "Security error: Call to dynamic object member not allowed";
+ // states whether the parse was successful or not
+ public $successful = true;
+ public $retvalue = 0;
+ private $lex;
+ private $internalError = false;
+
+ function __construct($lex, $compiler) {
+ $this->lex = $lex;
+ $this->compiler = $compiler;
+ $this->smarty = $this->compiler->smarty;
+ $this->template = $this->compiler->template;
+ $this->compiler->has_variable_string = false;
+ $this->compiler->prefix_code = array();
+ $this->prefix_number = 0;
+ $this->block_nesting_level = 0;
+ if ($this->security = isset($this->smarty->security_policy)) {
+ $this->php_handling = $this->smarty->security_policy->php_handling;
+ } else {
+ $this->php_handling = $this->smarty->php_handling;
+ }
+ $this->is_xml = false;
+ $this->asp_tags = (ini_get('asp_tags') != '0');
+ $this->current_buffer = $this->root_buffer = new _smarty_template_buffer($this);
+ }
+
+ public static function escape_start_tag($tag_text) {
+ $tag = preg_replace('/\A<\?(.*)\z/', '<<?php ?>?\1', $tag_text, -1 , $count); //Escape tag
+ return $tag;
+ }
+
+ public static function escape_end_tag($tag_text) {
+ return '?<?php ?>>';
+ }
+
+
+#line 121 "smarty_internal_templateparser.php"
+
+ const TP_VERT = 1;
+ const TP_COLON = 2;
+ const TP_COMMENT = 3;
+ const TP_PHPSTARTTAG = 4;
+ const TP_PHPENDTAG = 5;
+ const TP_ASPSTARTTAG = 6;
+ const TP_ASPENDTAG = 7;
+ const TP_FAKEPHPSTARTTAG = 8;
+ const TP_XMLTAG = 9;
+ const TP_OTHER = 10;
+ const TP_LINEBREAK = 11;
+ const TP_LITERALSTART = 12;
+ const TP_LITERALEND = 13;
+ const TP_LITERAL = 14;
+ const TP_LDEL = 15;
+ const TP_RDEL = 16;
+ const TP_DOLLAR = 17;
+ const TP_ID = 18;
+ const TP_EQUAL = 19;
+ const TP_PTR = 20;
+ const TP_LDELIF = 21;
+ const TP_LDELFOR = 22;
+ const TP_SEMICOLON = 23;
+ const TP_INCDEC = 24;
+ const TP_TO = 25;
+ const TP_STEP = 26;
+ const TP_LDELFOREACH = 27;
+ const TP_SPACE = 28;
+ const TP_AS = 29;
+ const TP_APTR = 30;
+ const TP_SMARTYBLOCKCHILD = 31;
+ const TP_LDELSLASH = 32;
+ const TP_INTEGER = 33;
+ const TP_COMMA = 34;
+ const TP_OPENP = 35;
+ const TP_CLOSEP = 36;
+ const TP_MATH = 37;
+ const TP_UNIMATH = 38;
+ const TP_ANDSYM = 39;
+ const TP_ISIN = 40;
+ const TP_ISDIVBY = 41;
+ const TP_ISNOTDIVBY = 42;
+ const TP_ISEVEN = 43;
+ const TP_ISNOTEVEN = 44;
+ const TP_ISEVENBY = 45;
+ const TP_ISNOTEVENBY = 46;
+ const TP_ISODD = 47;
+ const TP_ISNOTODD = 48;
+ const TP_ISODDBY = 49;
+ const TP_ISNOTODDBY = 50;
+ const TP_INSTANCEOF = 51;
+ const TP_QMARK = 52;
+ const TP_NOT = 53;
+ const TP_TYPECAST = 54;
+ const TP_HEX = 55;
+ const TP_DOT = 56;
+ const TP_SINGLEQUOTESTRING = 57;
+ const TP_DOUBLECOLON = 58;
+ const TP_AT = 59;
+ const TP_HATCH = 60;
+ const TP_OPENB = 61;
+ const TP_CLOSEB = 62;
+ const TP_EQUALS = 63;
+ const TP_NOTEQUALS = 64;
+ const TP_GREATERTHAN = 65;
+ const TP_LESSTHAN = 66;
+ const TP_GREATEREQUAL = 67;
+ const TP_LESSEQUAL = 68;
+ const TP_IDENTITY = 69;
+ const TP_NONEIDENTITY = 70;
+ const TP_MOD = 71;
+ const TP_LAND = 72;
+ const TP_LOR = 73;
+ const TP_LXOR = 74;
+ const TP_QUOTE = 75;
+ const TP_BACKTICK = 76;
+ const TP_DOLLARID = 77;
+ const YY_NO_ACTION = 590;
+ const YY_ACCEPT_ACTION = 589;
+ const YY_ERROR_ACTION = 588;
+
+ const YY_SZ_ACTTAB = 2637;
+static public $yy_action = array(
+ /* 0 */ 223, 300, 294, 293, 288, 287, 286, 290, 291, 301,
+ /* 10 */ 197, 13, 211, 40, 283, 373, 284, 8, 13, 7,
+ /* 20 */ 107, 283, 41, 203, 16, 147, 234, 16, 16, 276,
+ /* 30 */ 245, 589, 97, 296, 297, 299, 50, 46, 48, 45,
+ /* 40 */ 14, 28, 330, 352, 38, 32, 353, 371, 36, 34,
+ /* 50 */ 223, 311, 306, 307, 285, 303, 295, 297, 299, 197,
+ /* 60 */ 312, 316, 379, 359, 358, 357, 366, 319, 274, 270,
+ /* 70 */ 267, 255, 256, 258, 362, 35, 21, 16, 141, 169,
+ /* 80 */ 223, 199, 17, 3, 146, 337, 50, 46, 48, 45,
+ /* 90 */ 14, 28, 330, 352, 38, 32, 353, 371, 36, 34,
+ /* 100 */ 341, 109, 180, 25, 242, 161, 137, 206, 3, 26,
+ /* 110 */ 360, 259, 379, 359, 358, 357, 366, 319, 274, 270,
+ /* 120 */ 267, 255, 256, 258, 223, 304, 347, 206, 172, 142,
+ /* 130 */ 47, 137, 244, 75, 127, 454, 262, 259, 19, 356,
+ /* 140 */ 13, 329, 266, 283, 41, 343, 321, 454, 310, 104,
+ /* 150 */ 163, 16, 383, 203, 3, 217, 236, 237, 220, 259,
+ /* 160 */ 50, 46, 48, 45, 14, 28, 330, 352, 38, 32,
+ /* 170 */ 353, 371, 36, 34, 191, 206, 13, 137, 4, 283,
+ /* 180 */ 24, 200, 332, 259, 227, 263, 379, 359, 358, 357,
+ /* 190 */ 366, 319, 274, 270, 267, 255, 256, 258, 223, 304,
+ /* 200 */ 110, 162, 223, 142, 192, 332, 244, 75, 127, 451,
+ /* 210 */ 259, 13, 223, 260, 283, 329, 266, 384, 161, 343,
+ /* 220 */ 321, 451, 310, 108, 183, 16, 206, 268, 3, 216,
+ /* 230 */ 27, 246, 174, 259, 50, 46, 48, 45, 14, 28,
+ /* 240 */ 330, 352, 38, 32, 353, 371, 36, 34, 173, 206,
+ /* 250 */ 5, 137, 47, 13, 211, 227, 283, 259, 381, 8,
+ /* 260 */ 379, 359, 358, 357, 366, 319, 274, 270, 267, 255,
+ /* 270 */ 256, 258, 223, 304, 170, 181, 324, 142, 196, 332,
+ /* 280 */ 244, 66, 118, 238, 259, 13, 335, 204, 283, 329,
+ /* 290 */ 266, 39, 161, 343, 321, 281, 310, 243, 16, 232,
+ /* 300 */ 239, 3, 23, 23, 386, 365, 251, 231, 50, 46,
+ /* 310 */ 48, 45, 14, 28, 330, 352, 38, 32, 353, 371,
+ /* 320 */ 36, 34, 111, 326, 137, 23, 13, 376, 223, 283,
+ /* 330 */ 136, 198, 42, 161, 379, 359, 358, 357, 366, 319,
+ /* 340 */ 274, 270, 267, 255, 256, 258, 223, 304, 166, 188,
+ /* 350 */ 178, 142, 281, 298, 244, 75, 127, 259, 259, 13,
+ /* 360 */ 223, 368, 283, 329, 266, 16, 278, 343, 321, 281,
+ /* 370 */ 310, 136, 16, 203, 2, 272, 13, 215, 16, 252,
+ /* 380 */ 138, 247, 50, 46, 48, 45, 14, 28, 330, 352,
+ /* 390 */ 38, 32, 353, 371, 36, 34, 223, 177, 317, 223,
+ /* 400 */ 314, 190, 327, 236, 238, 248, 259, 148, 379, 359,
+ /* 410 */ 358, 357, 366, 319, 274, 270, 267, 255, 256, 258,
+ /* 420 */ 195, 310, 203, 106, 236, 261, 13, 206, 184, 218,
+ /* 430 */ 103, 250, 50, 46, 48, 45, 14, 28, 330, 352,
+ /* 440 */ 38, 32, 353, 371, 36, 34, 223, 22, 176, 47,
+ /* 450 */ 235, 362, 132, 13, 206, 320, 226, 259, 379, 359,
+ /* 460 */ 358, 357, 366, 319, 274, 270, 267, 255, 256, 258,
+ /* 470 */ 133, 322, 185, 203, 13, 223, 345, 230, 149, 241,
+ /* 480 */ 145, 259, 50, 46, 48, 45, 14, 28, 330, 352,
+ /* 490 */ 38, 32, 353, 371, 36, 34, 223, 203, 175, 134,
+ /* 500 */ 281, 354, 16, 121, 131, 37, 202, 119, 379, 359,
+ /* 510 */ 358, 357, 366, 319, 274, 270, 267, 255, 256, 258,
+ /* 520 */ 338, 171, 377, 96, 382, 385, 305, 31, 328, 149,
+ /* 530 */ 259, 367, 50, 46, 48, 45, 14, 28, 330, 352,
+ /* 540 */ 38, 32, 353, 371, 36, 34, 223, 224, 9, 374,
+ /* 550 */ 228, 140, 5, 129, 42, 139, 372, 370, 379, 359,
+ /* 560 */ 358, 357, 366, 319, 274, 270, 267, 255, 256, 258,
+ /* 570 */ 193, 309, 168, 279, 324, 12, 281, 20, 16, 44,
+ /* 580 */ 378, 135, 50, 46, 48, 45, 14, 28, 330, 352,
+ /* 590 */ 38, 32, 353, 371, 36, 34, 223, 112, 313, 323,
+ /* 600 */ 323, 323, 323, 323, 323, 323, 323, 99, 379, 359,
+ /* 610 */ 358, 357, 366, 319, 274, 270, 267, 255, 256, 258,
+ /* 620 */ 338, 348, 323, 16, 323, 323, 323, 323, 323, 323,
+ /* 630 */ 323, 323, 50, 46, 48, 45, 14, 28, 330, 352,
+ /* 640 */ 38, 32, 353, 371, 36, 34, 323, 323, 323, 323,
+ /* 650 */ 323, 323, 323, 323, 323, 323, 323, 323, 379, 359,
+ /* 660 */ 358, 357, 366, 319, 274, 270, 267, 255, 256, 258,
+ /* 670 */ 223, 223, 323, 304, 101, 165, 223, 142, 228, 323,
+ /* 680 */ 244, 53, 118, 126, 259, 11, 456, 29, 15, 329,
+ /* 690 */ 266, 456, 201, 343, 321, 30, 310, 323, 456, 233,
+ /* 700 */ 206, 323, 323, 456, 323, 223, 50, 46, 48, 45,
+ /* 710 */ 14, 28, 330, 352, 38, 32, 353, 371, 36, 34,
+ /* 720 */ 269, 47, 224, 323, 323, 323, 47, 323, 323, 323,
+ /* 730 */ 323, 323, 379, 359, 358, 357, 366, 319, 274, 270,
+ /* 740 */ 267, 255, 256, 258, 223, 323, 323, 323, 194, 186,
+ /* 750 */ 323, 257, 363, 289, 323, 325, 264, 254, 259, 205,
+ /* 760 */ 43, 29, 15, 16, 16, 16, 7, 107, 16, 16,
+ /* 770 */ 323, 323, 147, 323, 206, 323, 276, 245, 323, 323,
+ /* 780 */ 50, 46, 48, 45, 14, 28, 330, 352, 38, 32,
+ /* 790 */ 353, 371, 36, 34, 223, 323, 323, 323, 323, 323,
+ /* 800 */ 323, 323, 323, 323, 323, 124, 379, 359, 358, 357,
+ /* 810 */ 366, 319, 274, 270, 267, 255, 256, 258, 338, 323,
+ /* 820 */ 344, 18, 336, 323, 323, 323, 323, 323, 323, 323,
+ /* 830 */ 50, 46, 48, 45, 14, 28, 330, 352, 38, 32,
+ /* 840 */ 353, 371, 36, 34, 323, 323, 323, 323, 323, 323,
+ /* 850 */ 323, 323, 323, 323, 323, 369, 379, 359, 358, 357,
+ /* 860 */ 366, 319, 274, 270, 267, 255, 256, 258, 223, 304,
+ /* 870 */ 323, 164, 361, 142, 323, 339, 244, 80, 127, 167,
+ /* 880 */ 259, 342, 375, 275, 16, 329, 266, 16, 259, 343,
+ /* 890 */ 321, 281, 310, 16, 16, 323, 323, 323, 323, 281,
+ /* 900 */ 323, 323, 323, 323, 50, 46, 48, 45, 14, 28,
+ /* 910 */ 330, 352, 38, 32, 353, 371, 36, 34, 223, 323,
+ /* 920 */ 323, 323, 323, 323, 323, 323, 323, 323, 323, 117,
+ /* 930 */ 379, 359, 358, 357, 366, 319, 274, 270, 267, 255,
+ /* 940 */ 256, 258, 338, 323, 323, 323, 240, 323, 323, 323,
+ /* 950 */ 323, 323, 323, 323, 50, 46, 48, 45, 14, 28,
+ /* 960 */ 330, 352, 38, 32, 353, 371, 36, 34, 223, 323,
+ /* 970 */ 323, 323, 323, 323, 323, 323, 323, 323, 323, 102,
+ /* 980 */ 379, 359, 358, 357, 366, 319, 274, 270, 267, 255,
+ /* 990 */ 256, 258, 338, 323, 323, 323, 323, 323, 323, 323,
+ /* 1000 */ 323, 323, 323, 323, 50, 46, 48, 45, 14, 28,
+ /* 1010 */ 330, 352, 38, 32, 353, 371, 36, 34, 323, 335,
+ /* 1020 */ 323, 323, 323, 323, 323, 323, 161, 323, 323, 323,
+ /* 1030 */ 379, 359, 358, 357, 366, 319, 274, 270, 267, 255,
+ /* 1040 */ 256, 258, 50, 46, 48, 45, 14, 28, 330, 352,
+ /* 1050 */ 38, 32, 353, 371, 36, 34, 351, 323, 323, 323,
+ /* 1060 */ 323, 323, 323, 323, 136, 323, 223, 323, 379, 359,
+ /* 1070 */ 358, 357, 366, 319, 274, 270, 267, 255, 256, 258,
+ /* 1080 */ 150, 271, 160, 323, 40, 323, 143, 210, 323, 323,
+ /* 1090 */ 7, 107, 281, 302, 253, 338, 147, 323, 325, 323,
+ /* 1100 */ 276, 245, 229, 43, 33, 16, 16, 51, 323, 7,
+ /* 1110 */ 107, 323, 323, 323, 323, 147, 323, 323, 323, 276,
+ /* 1120 */ 245, 194, 52, 49, 380, 225, 349, 105, 323, 106,
+ /* 1130 */ 1, 355, 323, 223, 29, 15, 323, 280, 315, 40,
+ /* 1140 */ 338, 143, 214, 223, 98, 7, 107, 206, 453, 16,
+ /* 1150 */ 16, 147, 323, 323, 323, 276, 245, 229, 450, 33,
+ /* 1160 */ 453, 265, 51, 350, 18, 336, 362, 304, 323, 115,
+ /* 1170 */ 16, 152, 323, 16, 244, 323, 127, 52, 49, 380,
+ /* 1180 */ 225, 349, 338, 47, 106, 1, 323, 343, 321, 223,
+ /* 1190 */ 310, 318, 323, 323, 40, 323, 138, 214, 304, 98,
+ /* 1200 */ 7, 107, 159, 16, 346, 244, 147, 127, 249, 323,
+ /* 1210 */ 276, 245, 229, 340, 10, 273, 16, 51, 343, 321,
+ /* 1220 */ 323, 310, 304, 3, 323, 16, 153, 323, 323, 244,
+ /* 1230 */ 323, 127, 52, 49, 380, 225, 349, 323, 331, 106,
+ /* 1240 */ 1, 323, 343, 321, 223, 310, 137, 223, 277, 40,
+ /* 1250 */ 16, 128, 92, 223, 98, 7, 107, 323, 323, 450,
+ /* 1260 */ 16, 147, 282, 323, 292, 276, 245, 229, 308, 33,
+ /* 1270 */ 362, 16, 51, 323, 16, 16, 16, 304, 323, 144,
+ /* 1280 */ 16, 157, 323, 323, 244, 323, 127, 52, 49, 380,
+ /* 1290 */ 225, 349, 338, 323, 106, 1, 323, 343, 321, 100,
+ /* 1300 */ 310, 323, 323, 47, 40, 323, 143, 212, 323, 98,
+ /* 1310 */ 7, 107, 338, 323, 323, 323, 147, 323, 323, 323,
+ /* 1320 */ 276, 245, 229, 323, 33, 323, 323, 51, 323, 323,
+ /* 1330 */ 323, 323, 304, 323, 323, 323, 151, 323, 323, 244,
+ /* 1340 */ 323, 127, 52, 49, 380, 225, 349, 323, 323, 106,
+ /* 1350 */ 1, 323, 343, 321, 323, 310, 323, 323, 323, 40,
+ /* 1360 */ 323, 125, 214, 323, 98, 7, 107, 323, 323, 323,
+ /* 1370 */ 323, 147, 323, 323, 323, 276, 245, 229, 323, 33,
+ /* 1380 */ 323, 323, 51, 323, 323, 323, 323, 304, 323, 323,
+ /* 1390 */ 323, 155, 323, 323, 244, 323, 127, 52, 49, 380,
+ /* 1400 */ 225, 349, 323, 323, 106, 1, 323, 343, 321, 323,
+ /* 1410 */ 310, 323, 323, 323, 40, 323, 130, 214, 323, 98,
+ /* 1420 */ 7, 107, 323, 323, 323, 323, 147, 323, 323, 323,
+ /* 1430 */ 276, 245, 229, 323, 6, 323, 323, 51, 323, 323,
+ /* 1440 */ 323, 323, 304, 323, 323, 323, 154, 323, 323, 244,
+ /* 1450 */ 323, 127, 52, 49, 380, 225, 349, 323, 323, 106,
+ /* 1460 */ 1, 323, 343, 321, 323, 310, 323, 323, 323, 40,
+ /* 1470 */ 323, 143, 209, 323, 98, 7, 107, 323, 323, 323,
+ /* 1480 */ 323, 147, 323, 323, 323, 276, 245, 229, 323, 33,
+ /* 1490 */ 323, 323, 51, 323, 323, 323, 323, 304, 323, 323,
+ /* 1500 */ 323, 158, 323, 323, 244, 323, 127, 52, 49, 380,
+ /* 1510 */ 225, 349, 323, 323, 106, 1, 323, 343, 321, 323,
+ /* 1520 */ 310, 323, 323, 323, 40, 323, 143, 208, 323, 98,
+ /* 1530 */ 7, 107, 323, 323, 323, 323, 147, 323, 323, 323,
+ /* 1540 */ 276, 245, 222, 323, 33, 323, 323, 51, 323, 323,
+ /* 1550 */ 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
+ /* 1560 */ 323, 323, 52, 49, 380, 225, 349, 323, 323, 106,
+ /* 1570 */ 1, 323, 323, 323, 323, 323, 323, 323, 323, 40,
+ /* 1580 */ 323, 143, 207, 323, 98, 7, 107, 323, 323, 323,
+ /* 1590 */ 323, 147, 323, 323, 323, 276, 245, 229, 323, 33,
+ /* 1600 */ 323, 323, 51, 323, 323, 323, 323, 323, 323, 323,
+ /* 1610 */ 323, 323, 323, 323, 323, 323, 323, 52, 49, 380,
+ /* 1620 */ 225, 349, 323, 323, 106, 1, 323, 323, 323, 323,
+ /* 1630 */ 323, 323, 323, 323, 40, 323, 138, 214, 323, 98,
+ /* 1640 */ 7, 107, 323, 323, 323, 323, 147, 323, 323, 323,
+ /* 1650 */ 276, 245, 229, 323, 10, 323, 323, 51, 323, 323,
+ /* 1660 */ 323, 323, 323, 323, 323, 323, 323, 194, 182, 323,
+ /* 1670 */ 323, 323, 52, 49, 380, 225, 349, 259, 323, 106,
+ /* 1680 */ 29, 15, 323, 323, 323, 323, 323, 323, 323, 40,
+ /* 1690 */ 323, 138, 213, 206, 98, 7, 107, 323, 323, 323,
+ /* 1700 */ 323, 147, 323, 323, 323, 276, 245, 229, 323, 10,
+ /* 1710 */ 323, 323, 51, 323, 323, 323, 323, 323, 323, 323,
+ /* 1720 */ 323, 323, 323, 323, 323, 323, 499, 52, 49, 380,
+ /* 1730 */ 225, 349, 323, 499, 106, 499, 499, 323, 499, 499,
+ /* 1740 */ 323, 323, 323, 323, 499, 3, 499, 323, 323, 98,
+ /* 1750 */ 323, 323, 323, 323, 323, 323, 323, 323, 304, 323,
+ /* 1760 */ 323, 499, 120, 323, 323, 244, 73, 127, 137, 323,
+ /* 1770 */ 323, 323, 499, 323, 329, 266, 323, 323, 343, 321,
+ /* 1780 */ 323, 310, 323, 323, 323, 323, 499, 323, 323, 323,
+ /* 1790 */ 304, 323, 219, 334, 120, 323, 323, 244, 73, 127,
+ /* 1800 */ 323, 323, 323, 323, 323, 323, 329, 266, 323, 323,
+ /* 1810 */ 343, 321, 304, 310, 323, 323, 114, 323, 323, 244,
+ /* 1820 */ 77, 127, 323, 323, 323, 333, 194, 187, 329, 266,
+ /* 1830 */ 323, 323, 343, 321, 323, 310, 259, 323, 323, 29,
+ /* 1840 */ 15, 304, 323, 323, 323, 142, 323, 323, 221, 68,
+ /* 1850 */ 127, 323, 206, 194, 179, 323, 323, 329, 266, 323,
+ /* 1860 */ 323, 343, 321, 259, 310, 323, 29, 15, 323, 304,
+ /* 1870 */ 323, 323, 323, 142, 323, 323, 244, 64, 127, 206,
+ /* 1880 */ 323, 194, 189, 323, 323, 329, 266, 323, 323, 343,
+ /* 1890 */ 321, 259, 310, 304, 29, 15, 323, 113, 323, 323,
+ /* 1900 */ 244, 62, 127, 323, 323, 323, 323, 206, 323, 329,
+ /* 1910 */ 266, 304, 323, 343, 321, 142, 310, 323, 244, 69,
+ /* 1920 */ 127, 323, 323, 323, 323, 323, 323, 329, 266, 323,
+ /* 1930 */ 323, 343, 321, 304, 310, 323, 323, 142, 323, 323,
+ /* 1940 */ 244, 88, 127, 323, 323, 323, 323, 323, 323, 329,
+ /* 1950 */ 266, 323, 323, 343, 321, 323, 310, 323, 323, 304,
+ /* 1960 */ 323, 323, 323, 142, 323, 323, 244, 90, 127, 323,
+ /* 1970 */ 323, 323, 323, 323, 323, 329, 266, 323, 323, 343,
+ /* 1980 */ 321, 323, 310, 304, 323, 323, 323, 116, 323, 323,
+ /* 1990 */ 244, 82, 127, 323, 323, 323, 323, 323, 323, 329,
+ /* 2000 */ 266, 304, 323, 343, 321, 142, 310, 323, 244, 72,
+ /* 2010 */ 127, 323, 323, 323, 323, 323, 323, 329, 266, 323,
+ /* 2020 */ 323, 343, 321, 304, 310, 323, 323, 142, 323, 323,
+ /* 2030 */ 244, 63, 127, 323, 323, 323, 323, 323, 323, 329,
+ /* 2040 */ 266, 323, 323, 343, 321, 323, 310, 323, 323, 304,
+ /* 2050 */ 323, 323, 323, 142, 323, 323, 244, 91, 127, 323,
+ /* 2060 */ 323, 323, 323, 323, 323, 329, 266, 323, 323, 343,
+ /* 2070 */ 321, 323, 310, 304, 323, 323, 323, 142, 323, 323,
+ /* 2080 */ 244, 60, 127, 323, 323, 323, 323, 323, 323, 329,
+ /* 2090 */ 266, 304, 323, 343, 321, 142, 310, 323, 244, 89,
+ /* 2100 */ 127, 323, 323, 323, 323, 323, 323, 329, 266, 323,
+ /* 2110 */ 323, 343, 321, 304, 310, 323, 323, 142, 323, 323,
+ /* 2120 */ 244, 70, 127, 323, 323, 323, 323, 323, 323, 329,
+ /* 2130 */ 266, 323, 323, 343, 321, 323, 310, 323, 323, 304,
+ /* 2140 */ 323, 323, 323, 142, 323, 323, 244, 78, 127, 323,
+ /* 2150 */ 323, 323, 323, 323, 323, 329, 266, 323, 323, 343,
+ /* 2160 */ 321, 323, 310, 304, 323, 323, 323, 142, 323, 323,
+ /* 2170 */ 244, 61, 127, 323, 323, 323, 323, 323, 323, 329,
+ /* 2180 */ 266, 304, 323, 343, 321, 142, 310, 323, 244, 76,
+ /* 2190 */ 127, 323, 323, 323, 323, 323, 323, 329, 266, 323,
+ /* 2200 */ 323, 343, 321, 304, 310, 323, 323, 142, 323, 323,
+ /* 2210 */ 244, 74, 127, 323, 323, 323, 323, 323, 323, 329,
+ /* 2220 */ 266, 323, 323, 343, 321, 323, 310, 323, 323, 304,
+ /* 2230 */ 323, 323, 323, 142, 323, 323, 244, 87, 127, 323,
+ /* 2240 */ 323, 323, 323, 323, 323, 329, 266, 323, 323, 343,
+ /* 2250 */ 321, 323, 310, 304, 323, 323, 323, 142, 323, 323,
+ /* 2260 */ 244, 67, 127, 323, 323, 323, 323, 323, 323, 329,
+ /* 2270 */ 266, 304, 323, 343, 321, 142, 310, 323, 244, 83,
+ /* 2280 */ 127, 323, 323, 323, 323, 323, 323, 329, 266, 323,
+ /* 2290 */ 323, 343, 321, 304, 310, 323, 323, 142, 323, 323,
+ /* 2300 */ 244, 58, 127, 323, 323, 323, 323, 323, 323, 329,
+ /* 2310 */ 266, 323, 323, 343, 321, 323, 310, 323, 323, 304,
+ /* 2320 */ 323, 323, 323, 94, 323, 323, 93, 59, 123, 323,
+ /* 2330 */ 323, 323, 323, 323, 323, 329, 266, 323, 323, 343,
+ /* 2340 */ 321, 323, 310, 304, 323, 323, 323, 142, 323, 323,
+ /* 2350 */ 244, 86, 127, 323, 323, 323, 323, 323, 323, 329,
+ /* 2360 */ 266, 304, 323, 343, 321, 142, 310, 323, 244, 85,
+ /* 2370 */ 127, 323, 323, 323, 323, 323, 323, 329, 266, 323,
+ /* 2380 */ 323, 343, 321, 304, 310, 323, 323, 142, 323, 323,
+ /* 2390 */ 244, 57, 127, 323, 323, 323, 323, 323, 323, 329,
+ /* 2400 */ 266, 323, 323, 343, 321, 323, 310, 323, 323, 304,
+ /* 2410 */ 323, 323, 323, 142, 323, 323, 244, 66, 127, 323,
+ /* 2420 */ 323, 323, 323, 323, 323, 329, 266, 323, 323, 343,
+ /* 2430 */ 321, 323, 310, 304, 323, 323, 323, 142, 323, 323,
+ /* 2440 */ 244, 79, 127, 323, 323, 323, 323, 323, 323, 329,
+ /* 2450 */ 266, 304, 323, 343, 321, 142, 310, 323, 244, 65,
+ /* 2460 */ 127, 323, 323, 323, 323, 323, 323, 329, 266, 323,
+ /* 2470 */ 323, 343, 321, 304, 310, 323, 323, 142, 323, 323,
+ /* 2480 */ 244, 81, 127, 323, 323, 323, 323, 323, 323, 329,
+ /* 2490 */ 266, 323, 323, 343, 321, 323, 310, 323, 323, 304,
+ /* 2500 */ 323, 323, 323, 94, 323, 323, 95, 56, 123, 323,
+ /* 2510 */ 323, 323, 323, 323, 323, 329, 266, 323, 323, 343,
+ /* 2520 */ 321, 323, 310, 304, 323, 323, 323, 142, 323, 323,
+ /* 2530 */ 244, 71, 127, 323, 323, 323, 323, 323, 323, 329,
+ /* 2540 */ 266, 304, 323, 343, 321, 142, 310, 323, 244, 54,
+ /* 2550 */ 127, 323, 323, 323, 323, 323, 323, 329, 266, 323,
+ /* 2560 */ 323, 343, 321, 304, 310, 323, 323, 122, 323, 323,
+ /* 2570 */ 244, 55, 127, 323, 323, 323, 323, 323, 323, 329,
+ /* 2580 */ 266, 323, 323, 343, 321, 323, 310, 323, 323, 304,
+ /* 2590 */ 323, 323, 323, 142, 323, 323, 244, 84, 127, 323,
+ /* 2600 */ 323, 323, 323, 323, 323, 329, 266, 323, 323, 343,
+ /* 2610 */ 321, 323, 310, 304, 323, 323, 323, 156, 323, 323,
+ /* 2620 */ 244, 323, 127, 323, 323, 323, 323, 323, 323, 323,
+ /* 2630 */ 364, 323, 323, 343, 321, 323, 310,
+ );
+ static public $yy_lookahead = array(
+ /* 0 */ 1, 3, 4, 5, 6, 7, 8, 9, 10, 11,
+ /* 10 */ 12, 15, 56, 15, 18, 16, 16, 61, 15, 21,
+ /* 20 */ 22, 18, 19, 113, 28, 27, 30, 28, 28, 31,
+ /* 30 */ 32, 79, 80, 81, 82, 83, 37, 38, 39, 40,
+ /* 40 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ /* 50 */ 1, 4, 5, 6, 7, 8, 81, 82, 83, 12,
+ /* 60 */ 13, 14, 63, 64, 65, 66, 67, 68, 69, 70,
+ /* 70 */ 71, 72, 73, 74, 24, 26, 15, 28, 17, 18,
+ /* 80 */ 1, 87, 15, 35, 17, 18, 37, 38, 39, 40,
+ /* 90 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ /* 100 */ 33, 87, 88, 30, 56, 20, 58, 113, 35, 30,
+ /* 110 */ 62, 97, 63, 64, 65, 66, 67, 68, 69, 70,
+ /* 120 */ 71, 72, 73, 74, 1, 82, 76, 113, 88, 86,
+ /* 130 */ 51, 58, 89, 90, 91, 16, 28, 97, 19, 16,
+ /* 140 */ 15, 98, 99, 18, 19, 102, 103, 28, 105, 87,
+ /* 150 */ 88, 28, 110, 113, 35, 112, 91, 92, 93, 97,
+ /* 160 */ 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+ /* 170 */ 47, 48, 49, 50, 88, 113, 15, 58, 35, 18,
+ /* 180 */ 19, 109, 110, 97, 59, 24, 63, 64, 65, 66,
+ /* 190 */ 67, 68, 69, 70, 71, 72, 73, 74, 1, 82,
+ /* 200 */ 87, 88, 1, 86, 109, 110, 89, 90, 91, 16,
+ /* 210 */ 97, 15, 1, 16, 18, 98, 99, 16, 20, 102,
+ /* 220 */ 103, 28, 105, 87, 88, 28, 113, 16, 35, 112,
+ /* 230 */ 15, 20, 106, 97, 37, 38, 39, 40, 41, 42,
+ /* 240 */ 43, 44, 45, 46, 47, 48, 49, 50, 88, 113,
+ /* 250 */ 35, 58, 51, 15, 56, 59, 18, 97, 18, 61,
+ /* 260 */ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
+ /* 270 */ 73, 74, 1, 82, 106, 88, 107, 86, 109, 110,
+ /* 280 */ 89, 90, 91, 92, 97, 15, 82, 16, 18, 98,
+ /* 290 */ 99, 19, 20, 102, 103, 108, 105, 59, 28, 59,
+ /* 300 */ 30, 35, 34, 34, 36, 36, 17, 18, 37, 38,
+ /* 310 */ 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
+ /* 320 */ 49, 50, 118, 119, 58, 34, 15, 36, 1, 18,
+ /* 330 */ 58, 114, 19, 20, 63, 64, 65, 66, 67, 68,
+ /* 340 */ 69, 70, 71, 72, 73, 74, 1, 82, 88, 88,
+ /* 350 */ 106, 86, 108, 16, 89, 90, 91, 97, 97, 15,
+ /* 360 */ 1, 16, 18, 98, 99, 28, 16, 102, 103, 108,
+ /* 370 */ 105, 58, 28, 113, 34, 16, 15, 112, 28, 18,
+ /* 380 */ 17, 18, 37, 38, 39, 40, 41, 42, 43, 44,
+ /* 390 */ 45, 46, 47, 48, 49, 50, 1, 88, 83, 1,
+ /* 400 */ 85, 87, 62, 91, 92, 89, 97, 91, 63, 64,
+ /* 410 */ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ /* 420 */ 114, 105, 113, 60, 91, 92, 15, 113, 87, 18,
+ /* 430 */ 106, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ /* 440 */ 45, 46, 47, 48, 49, 50, 1, 2, 88, 51,
+ /* 450 */ 94, 24, 17, 15, 113, 18, 18, 97, 63, 64,
+ /* 460 */ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ /* 470 */ 35, 104, 88, 113, 15, 1, 18, 18, 111, 18,
+ /* 480 */ 17, 97, 37, 38, 39, 40, 41, 42, 43, 44,
+ /* 490 */ 45, 46, 47, 48, 49, 50, 1, 113, 106, 17,
+ /* 500 */ 108, 62, 28, 18, 18, 52, 18, 95, 63, 64,
+ /* 510 */ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ /* 520 */ 108, 88, 104, 18, 60, 60, 36, 25, 18, 111,
+ /* 530 */ 97, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ /* 540 */ 45, 46, 47, 48, 49, 50, 1, 56, 2, 33,
+ /* 550 */ 2, 17, 35, 17, 19, 17, 33, 18, 63, 64,
+ /* 560 */ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ /* 570 */ 23, 115, 106, 97, 107, 94, 108, 28, 28, 2,
+ /* 580 */ 111, 34, 37, 38, 39, 40, 41, 42, 43, 44,
+ /* 590 */ 45, 46, 47, 48, 49, 50, 1, 84, 13, 120,
+ /* 600 */ 120, 120, 120, 120, 120, 120, 120, 95, 63, 64,
+ /* 610 */ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ /* 620 */ 108, 76, 120, 28, 120, 120, 120, 120, 120, 120,
+ /* 630 */ 120, 120, 37, 38, 39, 40, 41, 42, 43, 44,
+ /* 640 */ 45, 46, 47, 48, 49, 50, 120, 120, 120, 120,
+ /* 650 */ 120, 120, 120, 120, 120, 120, 120, 120, 63, 64,
+ /* 660 */ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ /* 670 */ 1, 1, 120, 82, 87, 88, 1, 86, 2, 120,
+ /* 680 */ 89, 90, 91, 92, 97, 19, 16, 100, 101, 98,
+ /* 690 */ 99, 16, 23, 102, 103, 19, 105, 120, 28, 29,
+ /* 700 */ 113, 120, 120, 28, 120, 1, 37, 38, 39, 40,
+ /* 710 */ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ /* 720 */ 16, 51, 56, 120, 120, 120, 51, 120, 120, 120,
+ /* 730 */ 120, 120, 63, 64, 65, 66, 67, 68, 69, 70,
+ /* 740 */ 71, 72, 73, 74, 1, 120, 120, 120, 87, 88,
+ /* 750 */ 120, 16, 16, 16, 120, 10, 16, 16, 97, 16,
+ /* 760 */ 15, 100, 101, 28, 28, 28, 21, 22, 28, 28,
+ /* 770 */ 120, 120, 27, 120, 113, 120, 31, 32, 120, 120,
+ /* 780 */ 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+ /* 790 */ 47, 48, 49, 50, 1, 120, 120, 120, 120, 120,
+ /* 800 */ 120, 120, 120, 120, 120, 95, 63, 64, 65, 66,
+ /* 810 */ 67, 68, 69, 70, 71, 72, 73, 74, 108, 120,
+ /* 820 */ 75, 76, 77, 120, 120, 120, 120, 120, 120, 120,
+ /* 830 */ 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+ /* 840 */ 47, 48, 49, 50, 120, 120, 120, 120, 120, 120,
+ /* 850 */ 120, 120, 120, 120, 120, 62, 63, 64, 65, 66,
+ /* 860 */ 67, 68, 69, 70, 71, 72, 73, 74, 1, 82,
+ /* 870 */ 120, 88, 16, 86, 120, 16, 89, 90, 91, 88,
+ /* 880 */ 97, 16, 16, 16, 28, 98, 99, 28, 97, 102,
+ /* 890 */ 103, 108, 105, 28, 28, 120, 120, 120, 120, 108,
+ /* 900 */ 120, 120, 120, 120, 37, 38, 39, 40, 41, 42,
+ /* 910 */ 43, 44, 45, 46, 47, 48, 49, 50, 1, 120,
+ /* 920 */ 120, 120, 120, 120, 120, 120, 120, 120, 120, 95,
+ /* 930 */ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
+ /* 940 */ 73, 74, 108, 120, 120, 120, 29, 120, 120, 120,
+ /* 950 */ 120, 120, 120, 120, 37, 38, 39, 40, 41, 42,
+ /* 960 */ 43, 44, 45, 46, 47, 48, 49, 50, 1, 120,
+ /* 970 */ 120, 120, 120, 120, 120, 120, 120, 120, 120, 95,
+ /* 980 */ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
+ /* 990 */ 73, 74, 108, 120, 120, 120, 120, 120, 120, 120,
+ /* 1000 */ 120, 120, 120, 120, 37, 38, 39, 40, 41, 42,
+ /* 1010 */ 43, 44, 45, 46, 47, 48, 49, 50, 120, 82,
+ /* 1020 */ 120, 120, 120, 120, 120, 120, 20, 120, 120, 120,
+ /* 1030 */ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
+ /* 1040 */ 73, 74, 37, 38, 39, 40, 41, 42, 43, 44,
+ /* 1050 */ 45, 46, 47, 48, 49, 50, 119, 120, 120, 120,
+ /* 1060 */ 120, 120, 120, 120, 58, 120, 1, 120, 63, 64,
+ /* 1070 */ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ /* 1080 */ 96, 16, 95, 120, 15, 120, 17, 18, 120, 120,
+ /* 1090 */ 21, 22, 108, 16, 16, 108, 27, 120, 10, 120,
+ /* 1100 */ 31, 32, 33, 15, 35, 28, 28, 38, 120, 21,
+ /* 1110 */ 22, 120, 120, 120, 120, 27, 120, 120, 120, 31,
+ /* 1120 */ 32, 87, 53, 54, 55, 56, 57, 95, 120, 60,
+ /* 1130 */ 61, 62, 120, 1, 100, 101, 120, 16, 16, 15,
+ /* 1140 */ 108, 17, 18, 1, 75, 21, 22, 113, 16, 28,
+ /* 1150 */ 28, 27, 120, 120, 120, 31, 32, 33, 16, 35,
+ /* 1160 */ 28, 16, 38, 75, 76, 77, 24, 82, 120, 95,
+ /* 1170 */ 28, 86, 120, 28, 89, 120, 91, 53, 54, 55,
+ /* 1180 */ 56, 57, 108, 51, 60, 61, 120, 102, 103, 1,
+ /* 1190 */ 105, 16, 120, 120, 15, 120, 17, 18, 82, 75,
+ /* 1200 */ 21, 22, 86, 28, 16, 89, 27, 91, 20, 120,
+ /* 1210 */ 31, 32, 33, 16, 35, 99, 28, 38, 102, 103,
+ /* 1220 */ 120, 105, 82, 35, 120, 28, 86, 120, 120, 89,
+ /* 1230 */ 120, 91, 53, 54, 55, 56, 57, 120, 16, 60,
+ /* 1240 */ 61, 120, 102, 103, 1, 105, 58, 1, 16, 15,
+ /* 1250 */ 28, 17, 18, 1, 75, 21, 22, 120, 120, 16,
+ /* 1260 */ 28, 27, 16, 16, 16, 31, 32, 33, 16, 35,
+ /* 1270 */ 24, 28, 38, 120, 28, 28, 28, 82, 120, 95,
+ /* 1280 */ 28, 86, 120, 120, 89, 120, 91, 53, 54, 55,
+ /* 1290 */ 56, 57, 108, 120, 60, 61, 120, 102, 103, 95,
+ /* 1300 */ 105, 120, 120, 51, 15, 120, 17, 18, 120, 75,
+ /* 1310 */ 21, 22, 108, 120, 120, 120, 27, 120, 120, 120,
+ /* 1320 */ 31, 32, 33, 120, 35, 120, 120, 38, 120, 120,
+ /* 1330 */ 120, 120, 82, 120, 120, 120, 86, 120, 120, 89,
+ /* 1340 */ 120, 91, 53, 54, 55, 56, 57, 120, 120, 60,
+ /* 1350 */ 61, 120, 102, 103, 120, 105, 120, 120, 120, 15,
+ /* 1360 */ 120, 17, 18, 120, 75, 21, 22, 120, 120, 120,
+ /* 1370 */ 120, 27, 120, 120, 120, 31, 32, 33, 120, 35,
+ /* 1380 */ 120, 120, 38, 120, 120, 120, 120, 82, 120, 120,
+ /* 1390 */ 120, 86, 120, 120, 89, 120, 91, 53, 54, 55,
+ /* 1400 */ 56, 57, 120, 120, 60, 61, 120, 102, 103, 120,
+ /* 1410 */ 105, 120, 120, 120, 15, 120, 17, 18, 120, 75,
+ /* 1420 */ 21, 22, 120, 120, 120, 120, 27, 120, 120, 120,
+ /* 1430 */ 31, 32, 33, 120, 35, 120, 120, 38, 120, 120,
+ /* 1440 */ 120, 120, 82, 120, 120, 120, 86, 120, 120, 89,
+ /* 1450 */ 120, 91, 53, 54, 55, 56, 57, 120, 120, 60,
+ /* 1460 */ 61, 120, 102, 103, 120, 105, 120, 120, 120, 15,
+ /* 1470 */ 120, 17, 18, 120, 75, 21, 22, 120, 120, 120,
+ /* 1480 */ 120, 27, 120, 120, 120, 31, 32, 33, 120, 35,
+ /* 1490 */ 120, 120, 38, 120, 120, 120, 120, 82, 120, 120,
+ /* 1500 */ 120, 86, 120, 120, 89, 120, 91, 53, 54, 55,
+ /* 1510 */ 56, 57, 120, 120, 60, 61, 120, 102, 103, 120,
+ /* 1520 */ 105, 120, 120, 120, 15, 120, 17, 18, 120, 75,
+ /* 1530 */ 21, 22, 120, 120, 120, 120, 27, 120, 120, 120,
+ /* 1540 */ 31, 32, 33, 120, 35, 120, 120, 38, 120, 120,
+ /* 1550 */ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ /* 1560 */ 120, 120, 53, 54, 55, 56, 57, 120, 120, 60,
+ /* 1570 */ 61, 120, 120, 120, 120, 120, 120, 120, 120, 15,
+ /* 1580 */ 120, 17, 18, 120, 75, 21, 22, 120, 120, 120,
+ /* 1590 */ 120, 27, 120, 120, 120, 31, 32, 33, 120, 35,
+ /* 1600 */ 120, 120, 38, 120, 120, 120, 120, 120, 120, 120,
+ /* 1610 */ 120, 120, 120, 120, 120, 120, 120, 53, 54, 55,
+ /* 1620 */ 56, 57, 120, 120, 60, 61, 120, 120, 120, 120,
+ /* 1630 */ 120, 120, 120, 120, 15, 120, 17, 18, 120, 75,
+ /* 1640 */ 21, 22, 120, 120, 120, 120, 27, 120, 120, 120,
+ /* 1650 */ 31, 32, 33, 120, 35, 120, 120, 38, 120, 120,
+ /* 1660 */ 120, 120, 120, 120, 120, 120, 120, 87, 88, 120,
+ /* 1670 */ 120, 120, 53, 54, 55, 56, 57, 97, 120, 60,
+ /* 1680 */ 100, 101, 120, 120, 120, 120, 120, 120, 120, 15,
+ /* 1690 */ 120, 17, 18, 113, 75, 21, 22, 120, 120, 120,
+ /* 1700 */ 120, 27, 120, 120, 120, 31, 32, 33, 120, 35,
+ /* 1710 */ 120, 120, 38, 120, 120, 120, 120, 120, 120, 120,
+ /* 1720 */ 120, 120, 120, 120, 120, 120, 16, 53, 54, 55,
+ /* 1730 */ 56, 57, 120, 23, 60, 25, 26, 120, 28, 29,
+ /* 1740 */ 120, 120, 120, 120, 34, 35, 36, 120, 120, 75,
+ /* 1750 */ 120, 120, 120, 120, 120, 120, 120, 120, 82, 120,
+ /* 1760 */ 120, 51, 86, 120, 120, 89, 90, 91, 58, 120,
+ /* 1770 */ 120, 120, 62, 120, 98, 99, 120, 120, 102, 103,
+ /* 1780 */ 120, 105, 120, 120, 120, 120, 76, 120, 120, 120,
+ /* 1790 */ 82, 120, 116, 117, 86, 120, 120, 89, 90, 91,
+ /* 1800 */ 120, 120, 120, 120, 120, 120, 98, 99, 120, 120,
+ /* 1810 */ 102, 103, 82, 105, 120, 120, 86, 120, 120, 89,
+ /* 1820 */ 90, 91, 120, 120, 120, 117, 87, 88, 98, 99,
+ /* 1830 */ 120, 120, 102, 103, 120, 105, 97, 120, 120, 100,
+ /* 1840 */ 101, 82, 120, 120, 120, 86, 120, 120, 89, 90,
+ /* 1850 */ 91, 120, 113, 87, 88, 120, 120, 98, 99, 120,
+ /* 1860 */ 120, 102, 103, 97, 105, 120, 100, 101, 120, 82,
+ /* 1870 */ 120, 120, 120, 86, 120, 120, 89, 90, 91, 113,
+ /* 1880 */ 120, 87, 88, 120, 120, 98, 99, 120, 120, 102,
+ /* 1890 */ 103, 97, 105, 82, 100, 101, 120, 86, 120, 120,
+ /* 1900 */ 89, 90, 91, 120, 120, 120, 120, 113, 120, 98,
+ /* 1910 */ 99, 82, 120, 102, 103, 86, 105, 120, 89, 90,
+ /* 1920 */ 91, 120, 120, 120, 120, 120, 120, 98, 99, 120,
+ /* 1930 */ 120, 102, 103, 82, 105, 120, 120, 86, 120, 120,
+ /* 1940 */ 89, 90, 91, 120, 120, 120, 120, 120, 120, 98,
+ /* 1950 */ 99, 120, 120, 102, 103, 120, 105, 120, 120, 82,
+ /* 1960 */ 120, 120, 120, 86, 120, 120, 89, 90, 91, 120,
+ /* 1970 */ 120, 120, 120, 120, 120, 98, 99, 120, 120, 102,
+ /* 1980 */ 103, 120, 105, 82, 120, 120, 120, 86, 120, 120,
+ /* 1990 */ 89, 90, 91, 120, 120, 120, 120, 120, 120, 98,
+ /* 2000 */ 99, 82, 120, 102, 103, 86, 105, 120, 89, 90,
+ /* 2010 */ 91, 120, 120, 120, 120, 120, 120, 98, 99, 120,
+ /* 2020 */ 120, 102, 103, 82, 105, 120, 120, 86, 120, 120,
+ /* 2030 */ 89, 90, 91, 120, 120, 120, 120, 120, 120, 98,
+ /* 2040 */ 99, 120, 120, 102, 103, 120, 105, 120, 120, 82,
+ /* 2050 */ 120, 120, 120, 86, 120, 120, 89, 90, 91, 120,
+ /* 2060 */ 120, 120, 120, 120, 120, 98, 99, 120, 120, 102,
+ /* 2070 */ 103, 120, 105, 82, 120, 120, 120, 86, 120, 120,
+ /* 2080 */ 89, 90, 91, 120, 120, 120, 120, 120, 120, 98,
+ /* 2090 */ 99, 82, 120, 102, 103, 86, 105, 120, 89, 90,
+ /* 2100 */ 91, 120, 120, 120, 120, 120, 120, 98, 99, 120,
+ /* 2110 */ 120, 102, 103, 82, 105, 120, 120, 86, 120, 120,
+ /* 2120 */ 89, 90, 91, 120, 120, 120, 120, 120, 120, 98,
+ /* 2130 */ 99, 120, 120, 102, 103, 120, 105, 120, 120, 82,
+ /* 2140 */ 120, 120, 120, 86, 120, 120, 89, 90, 91, 120,
+ /* 2150 */ 120, 120, 120, 120, 120, 98, 99, 120, 120, 102,
+ /* 2160 */ 103, 120, 105, 82, 120, 120, 120, 86, 120, 120,
+ /* 2170 */ 89, 90, 91, 120, 120, 120, 120, 120, 120, 98,
+ /* 2180 */ 99, 82, 120, 102, 103, 86, 105, 120, 89, 90,
+ /* 2190 */ 91, 120, 120, 120, 120, 120, 120, 98, 99, 120,
+ /* 2200 */ 120, 102, 103, 82, 105, 120, 120, 86, 120, 120,
+ /* 2210 */ 89, 90, 91, 120, 120, 120, 120, 120, 120, 98,
+ /* 2220 */ 99, 120, 120, 102, 103, 120, 105, 120, 120, 82,
+ /* 2230 */ 120, 120, 120, 86, 120, 120, 89, 90, 91, 120,
+ /* 2240 */ 120, 120, 120, 120, 120, 98, 99, 120, 120, 102,
+ /* 2250 */ 103, 120, 105, 82, 120, 120, 120, 86, 120, 120,
+ /* 2260 */ 89, 90, 91, 120, 120, 120, 120, 120, 120, 98,
+ /* 2270 */ 99, 82, 120, 102, 103, 86, 105, 120, 89, 90,
+ /* 2280 */ 91, 120, 120, 120, 120, 120, 120, 98, 99, 120,
+ /* 2290 */ 120, 102, 103, 82, 105, 120, 120, 86, 120, 120,
+ /* 2300 */ 89, 90, 91, 120, 120, 120, 120, 120, 120, 98,
+ /* 2310 */ 99, 120, 120, 102, 103, 120, 105, 120, 120, 82,
+ /* 2320 */ 120, 120, 120, 86, 120, 120, 89, 90, 91, 120,
+ /* 2330 */ 120, 120, 120, 120, 120, 98, 99, 120, 120, 102,
+ /* 2340 */ 103, 120, 105, 82, 120, 120, 120, 86, 120, 120,
+ /* 2350 */ 89, 90, 91, 120, 120, 120, 120, 120, 120, 98,
+ /* 2360 */ 99, 82, 120, 102, 103, 86, 105, 120, 89, 90,
+ /* 2370 */ 91, 120, 120, 120, 120, 120, 120, 98, 99, 120,
+ /* 2380 */ 120, 102, 103, 82, 105, 120, 120, 86, 120, 120,
+ /* 2390 */ 89, 90, 91, 120, 120, 120, 120, 120, 120, 98,
+ /* 2400 */ 99, 120, 120, 102, 103, 120, 105, 120, 120, 82,
+ /* 2410 */ 120, 120, 120, 86, 120, 120, 89, 90, 91, 120,
+ /* 2420 */ 120, 120, 120, 120, 120, 98, 99, 120, 120, 102,
+ /* 2430 */ 103, 120, 105, 82, 120, 120, 120, 86, 120, 120,
+ /* 2440 */ 89, 90, 91, 120, 120, 120, 120, 120, 120, 98,
+ /* 2450 */ 99, 82, 120, 102, 103, 86, 105, 120, 89, 90,
+ /* 2460 */ 91, 120, 120, 120, 120, 120, 120, 98, 99, 120,
+ /* 2470 */ 120, 102, 103, 82, 105, 120, 120, 86, 120, 120,
+ /* 2480 */ 89, 90, 91, 120, 120, 120, 120, 120, 120, 98,
+ /* 2490 */ 99, 120, 120, 102, 103, 120, 105, 120, 120, 82,
+ /* 2500 */ 120, 120, 120, 86, 120, 120, 89, 90, 91, 120,
+ /* 2510 */ 120, 120, 120, 120, 120, 98, 99, 120, 120, 102,
+ /* 2520 */ 103, 120, 105, 82, 120, 120, 120, 86, 120, 120,
+ /* 2530 */ 89, 90, 91, 120, 120, 120, 120, 120, 120, 98,
+ /* 2540 */ 99, 82, 120, 102, 103, 86, 105, 120, 89, 90,
+ /* 2550 */ 91, 120, 120, 120, 120, 120, 120, 98, 99, 120,
+ /* 2560 */ 120, 102, 103, 82, 105, 120, 120, 86, 120, 120,
+ /* 2570 */ 89, 90, 91, 120, 120, 120, 120, 120, 120, 98,
+ /* 2580 */ 99, 120, 120, 102, 103, 120, 105, 120, 120, 82,
+ /* 2590 */ 120, 120, 120, 86, 120, 120, 89, 90, 91, 120,
+ /* 2600 */ 120, 120, 120, 120, 120, 98, 99, 120, 120, 102,
+ /* 2610 */ 103, 120, 105, 82, 120, 120, 120, 86, 120, 120,
+ /* 2620 */ 89, 120, 91, 120, 120, 120, 120, 120, 120, 120,
+ /* 2630 */ 99, 120, 120, 102, 103, 120, 105,
+);
+ const YY_SHIFT_USE_DFLT = -45;
+ const YY_SHIFT_MAX = 252;
+ static public $yy_shift_ofst = array(
+ /* 0 */ -2, 1289, 1289, 1124, 1124, 1124, 1399, 1399, 1069, 1564,
+ /* 10 */ 1124, 1124, 1124, 1124, 1124, 1124, 1509, 1124, 1124, 1454,
+ /* 20 */ 1509, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124,
+ /* 30 */ 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1344, 1124, 1124,
+ /* 40 */ 1234, 1124, 1124, 1234, 1179, 1179, 1619, 1674, 1619, 1619,
+ /* 50 */ 1619, 1619, 1619, 197, 49, -1, 123, 595, 595, 595,
+ /* 60 */ 793, 867, 917, 495, 345, 271, 395, 445, 545, 743,
+ /* 70 */ 669, 967, 967, 967, 967, 967, 967, 967, 967, 967,
+ /* 80 */ 967, 967, 967, 967, 967, 967, 967, 967, 967, 967,
+ /* 90 */ 1005, 1005, 1188, 1142, 1252, 1246, 474, -2, 745, 270,
+ /* 100 */ -4, 1243, 344, 198, 1243, 344, 363, 435, 474, 474,
+ /* 110 */ 474, 1088, 47, 670, 1132, 161, 675, 125, 313, 3,
+ /* 120 */ 79, 211, 201, 272, 196, 361, 1248, 1006, 411, 311,
+ /* 130 */ 438, 1065, 311, 435, 311, 435, 289, 289, 311, 311,
+ /* 140 */ 311, 459, 398, 438, 311, 311, 311, 549, 85, 85,
+ /* 150 */ 550, 327, 327, 327, 327, 327, 327, 327, 327, -45,
+ /* 160 */ 238, 61, 350, 337, 0, 856, 736, 741, -44, 215,
+ /* 170 */ -44, 737, 740, 735, -44, -44, 1197, 1175, -44, 1222,
+ /* 180 */ 1247, 1232, 1145, 865, 359, 859, 866, 1122, 1121, 1077,
+ /* 190 */ 704, 1078, 85, 108, 327, 577, 85, 585, 577, 327,
+ /* 200 */ 85, 108, 143, -45, -45, -45, -45, 1710, 119, 193,
+ /* 210 */ 48, 67, 73, 266, 266, 268, 269, 291, 676, 340,
+ /* 220 */ 547, 50, 666, 240, 523, 516, 548, 437, 510, 491,
+ /* 230 */ 143, 517, 539, 538, 536, 534, 535, 502, 490, 463,
+ /* 240 */ 482, 439, 461, 458, 427, 485, 486, 465, 464, 505,
+ /* 250 */ 453, 488, 546,
+);
+ const YY_REDUCE_USE_DFLT = -91;
+ const YY_REDUCE_MAX = 206;
+ static public $yy_reduce_ofst = array(
+ /* 0 */ -48, 1676, 1708, 117, 43, 265, 191, 591, 1991, 1967,
+ /* 10 */ 1941, 2009, 2031, 2081, 2057, 1919, 1901, 1787, 1759, 1730,
+ /* 20 */ 1811, 1829, 1877, 1851, 2099, 2121, 2391, 2369, 2351, 2441,
+ /* 30 */ 2481, 2459, 2507, 2327, 787, 2301, 2189, 2171, 2147, 2211,
+ /* 40 */ 2237, 2279, 2261, 2417, 1116, 2531, 1250, 1305, 1085, 1195,
+ /* 50 */ 1140, 1360, 1415, 1580, 1739, 661, 587, 1794, 1766, 587,
+ /* 60 */ 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034,
+ /* 70 */ 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034,
+ /* 80 */ 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034,
+ /* 90 */ 1034, 1034, 14, 113, 62, 113, 136, -25, 204, 187,
+ /* 100 */ 783, 260, 261, 169, 309, 791, 316, 65, 360, 384,
+ /* 110 */ 40, 937, 315, -6, -6, 984, -6, 244, 95, 244,
+ /* 120 */ -6, 341, -6, 95, 244, 710, 433, 95, 710, 884,
+ /* 130 */ 834, 314, 412, 312, 512, 333, 367, 418, 710, 1204,
+ /* 140 */ 1074, 1184, -6, 710, 392, 1032, 987, 160, 95, 72,
+ /* 150 */ 86, -6, -6, -6, -6, -6, -6, -6, -6, -6,
+ /* 160 */ 468, 469, 476, 476, 476, 476, 476, 476, 467, 466,
+ /* 170 */ 467, 476, 476, 476, 467, 467, 476, 476, 467, 476,
+ /* 180 */ 476, 476, 476, 476, -90, 476, 476, 476, 476, 476,
+ /* 190 */ -90, 476, 42, 481, -90, 456, 42, 513, 456, -90,
+ /* 200 */ 42, 356, 324, 217, 126, 168, 306,
+);
+ static public $yyExpectedTokens = array(
+ /* 0 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 21, 22, 27, 31, 32, ),
+ /* 1 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 2 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 3 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 4 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 5 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 6 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 7 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 8 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 62, 75, ),
+ /* 9 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 10 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 11 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 12 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 13 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 14 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 15 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 16 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 17 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 18 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 19 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 20 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 21 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 22 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 23 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 24 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 25 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 26 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 27 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 28 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 29 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 30 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 31 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 32 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 33 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 34 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 35 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 36 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 37 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 38 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 39 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 40 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 41 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 42 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 43 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 44 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 45 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 61, 75, ),
+ /* 46 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 75, ),
+ /* 47 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 75, ),
+ /* 48 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 75, ),
+ /* 49 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 75, ),
+ /* 50 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 75, ),
+ /* 51 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 75, ),
+ /* 52 */ array(15, 17, 18, 21, 22, 27, 31, 32, 33, 35, 38, 53, 54, 55, 56, 57, 60, 75, ),
+ /* 53 */ array(1, 16, 28, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 54 */ array(1, 26, 28, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 55 */ array(1, 16, 28, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 56 */ array(1, 16, 28, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 57 */ array(1, 28, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 58 */ array(1, 28, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 59 */ array(1, 28, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 60 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 61 */ array(1, 16, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 62 */ array(1, 29, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 63 */ array(1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 64 */ array(1, 16, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 65 */ array(1, 16, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 66 */ array(1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 67 */ array(1, 2, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 68 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 76, ),
+ /* 69 */ array(1, 16, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 70 */ array(1, 23, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 71 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 72 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 73 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 74 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 75 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 76 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 77 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 78 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 79 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 80 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 81 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 82 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 83 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 84 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 85 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 86 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 87 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 88 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 89 */ array(1, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 90 */ array(37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 91 */ array(37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, ),
+ /* 92 */ array(1, 16, 20, 28, 35, 58, ),
+ /* 93 */ array(1, 16, 24, 28, ),
+ /* 94 */ array(1, 16, 28, 51, ),
+ /* 95 */ array(1, 16, 24, 28, ),
+ /* 96 */ array(1, 28, ),
+ /* 97 */ array(3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 15, 21, 22, 27, 31, 32, ),
+ /* 98 */ array(10, 15, 21, 22, 27, 31, 32, 75, 76, 77, ),
+ /* 99 */ array(15, 18, 28, 30, ),
+ /* 100 */ array(15, 18, 28, 30, ),
+ /* 101 */ array(1, 16, 28, ),
+ /* 102 */ array(15, 18, 28, ),
+ /* 103 */ array(20, 56, 61, ),
+ /* 104 */ array(1, 16, 28, ),
+ /* 105 */ array(15, 18, 28, ),
+ /* 106 */ array(17, 18, 60, ),
+ /* 107 */ array(17, 35, ),
+ /* 108 */ array(1, 28, ),
+ /* 109 */ array(1, 28, ),
+ /* 110 */ array(1, 28, ),
+ /* 111 */ array(10, 15, 21, 22, 27, 31, 32, 75, 76, 77, ),
+ /* 112 */ array(4, 5, 6, 7, 8, 12, 13, 14, ),
+ /* 113 */ array(1, 16, 28, 29, 51, ),
+ /* 114 */ array(1, 16, 28, 51, ),
+ /* 115 */ array(15, 18, 19, 24, ),
+ /* 116 */ array(1, 16, 28, 51, ),
+ /* 117 */ array(15, 18, 19, 59, ),
+ /* 118 */ array(19, 20, 58, ),
+ /* 119 */ array(15, 18, 19, ),
+ /* 120 */ array(1, 30, 51, ),
+ /* 121 */ array(1, 16, 20, ),
+ /* 122 */ array(1, 16, 51, ),
+ /* 123 */ array(19, 20, 58, ),
+ /* 124 */ array(15, 18, 59, ),
+ /* 125 */ array(15, 18, ),
+ /* 126 */ array(16, 28, ),
+ /* 127 */ array(20, 58, ),
+ /* 128 */ array(15, 18, ),
+ /* 129 */ array(15, 18, ),
+ /* 130 */ array(15, 18, ),
+ /* 131 */ array(1, 16, ),
+ /* 132 */ array(15, 18, ),
+ /* 133 */ array(17, 35, ),
+ /* 134 */ array(15, 18, ),
+ /* 135 */ array(17, 35, ),
+ /* 136 */ array(17, 18, ),
+ /* 137 */ array(17, 18, ),
+ /* 138 */ array(15, 18, ),
+ /* 139 */ array(15, 18, ),
+ /* 140 */ array(15, 18, ),
+ /* 141 */ array(15, 18, ),
+ /* 142 */ array(1, 51, ),
+ /* 143 */ array(15, 18, ),
+ /* 144 */ array(15, 18, ),
+ /* 145 */ array(15, 18, ),
+ /* 146 */ array(15, 18, ),
+ /* 147 */ array(28, ),
+ /* 148 */ array(20, ),
+ /* 149 */ array(20, ),
+ /* 150 */ array(28, ),
+ /* 151 */ array(1, ),
+ /* 152 */ array(1, ),
+ /* 153 */ array(1, ),
+ /* 154 */ array(1, ),
+ /* 155 */ array(1, ),
+ /* 156 */ array(1, ),
+ /* 157 */ array(1, ),
+ /* 158 */ array(1, ),
+ /* 159 */ array(),
+ /* 160 */ array(15, 18, 59, ),
+ /* 161 */ array(15, 17, 18, ),
+ /* 162 */ array(16, 28, ),
+ /* 163 */ array(16, 28, ),
+ /* 164 */ array(16, 28, ),
+ /* 165 */ array(16, 28, ),
+ /* 166 */ array(16, 28, ),
+ /* 167 */ array(16, 28, ),
+ /* 168 */ array(56, 61, ),
+ /* 169 */ array(15, 35, ),
+ /* 170 */ array(56, 61, ),
+ /* 171 */ array(16, 28, ),
+ /* 172 */ array(16, 28, ),
+ /* 173 */ array(16, 28, ),
+ /* 174 */ array(56, 61, ),
+ /* 175 */ array(56, 61, ),
+ /* 176 */ array(16, 28, ),
+ /* 177 */ array(16, 28, ),
+ /* 178 */ array(56, 61, ),
+ /* 179 */ array(16, 28, ),
+ /* 180 */ array(16, 28, ),
+ /* 181 */ array(16, 28, ),
+ /* 182 */ array(16, 28, ),
+ /* 183 */ array(16, 28, ),
+ /* 184 */ array(1, 16, ),
+ /* 185 */ array(16, 28, ),
+ /* 186 */ array(16, 28, ),
+ /* 187 */ array(16, 28, ),
+ /* 188 */ array(16, 28, ),
+ /* 189 */ array(16, 28, ),
+ /* 190 */ array(1, 16, ),
+ /* 191 */ array(16, 28, ),
+ /* 192 */ array(20, ),
+ /* 193 */ array(28, ),
+ /* 194 */ array(1, ),
+ /* 195 */ array(2, ),
+ /* 196 */ array(20, ),
+ /* 197 */ array(13, ),
+ /* 198 */ array(2, ),
+ /* 199 */ array(1, ),
+ /* 200 */ array(20, ),
+ /* 201 */ array(28, ),
+ /* 202 */ array(35, ),
+ /* 203 */ array(),
+ /* 204 */ array(),
+ /* 205 */ array(),
+ /* 206 */ array(),
+ /* 207 */ array(16, 23, 25, 26, 28, 29, 34, 35, 36, 51, 58, 62, 76, ),
+ /* 208 */ array(16, 19, 28, 35, 58, ),
+ /* 209 */ array(16, 28, 35, 58, ),
+ /* 210 */ array(35, 56, 58, 62, ),
+ /* 211 */ array(15, 17, 18, 33, ),
+ /* 212 */ array(30, 35, 58, ),
+ /* 213 */ array(35, 58, ),
+ /* 214 */ array(35, 58, ),
+ /* 215 */ array(34, 36, ),
+ /* 216 */ array(34, 36, ),
+ /* 217 */ array(34, 36, ),
+ /* 218 */ array(2, 19, ),
+ /* 219 */ array(34, 62, ),
+ /* 220 */ array(23, 34, ),
+ /* 221 */ array(24, 76, ),
+ /* 222 */ array(19, 56, ),
+ /* 223 */ array(18, 59, ),
+ /* 224 */ array(33, ),
+ /* 225 */ array(33, ),
+ /* 226 */ array(2, ),
+ /* 227 */ array(18, ),
+ /* 228 */ array(18, ),
+ /* 229 */ array(56, ),
+ /* 230 */ array(35, ),
+ /* 231 */ array(35, ),
+ /* 232 */ array(18, ),
+ /* 233 */ array(17, ),
+ /* 234 */ array(17, ),
+ /* 235 */ array(17, ),
+ /* 236 */ array(19, ),
+ /* 237 */ array(25, ),
+ /* 238 */ array(36, ),
+ /* 239 */ array(17, ),
+ /* 240 */ array(17, ),
+ /* 241 */ array(62, ),
+ /* 242 */ array(18, ),
+ /* 243 */ array(18, ),
+ /* 244 */ array(24, ),
+ /* 245 */ array(18, ),
+ /* 246 */ array(18, ),
+ /* 247 */ array(60, ),
+ /* 248 */ array(60, ),
+ /* 249 */ array(18, ),
+ /* 250 */ array(52, ),
+ /* 251 */ array(18, ),
+ /* 252 */ array(2, ),
+ /* 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(),
+ /* 324 */ array(),
+ /* 325 */ array(),
+ /* 326 */ array(),
+ /* 327 */ array(),
+ /* 328 */ array(),
+ /* 329 */ array(),
+ /* 330 */ array(),
+ /* 331 */ array(),
+ /* 332 */ array(),
+ /* 333 */ array(),
+ /* 334 */ array(),
+ /* 335 */ array(),
+ /* 336 */ array(),
+ /* 337 */ array(),
+ /* 338 */ array(),
+ /* 339 */ array(),
+ /* 340 */ array(),
+ /* 341 */ array(),
+ /* 342 */ array(),
+ /* 343 */ array(),
+ /* 344 */ array(),
+ /* 345 */ array(),
+ /* 346 */ array(),
+ /* 347 */ array(),
+ /* 348 */ array(),
+ /* 349 */ array(),
+ /* 350 */ array(),
+ /* 351 */ array(),
+ /* 352 */ array(),
+ /* 353 */ array(),
+ /* 354 */ array(),
+ /* 355 */ array(),
+ /* 356 */ array(),
+ /* 357 */ array(),
+ /* 358 */ array(),
+ /* 359 */ array(),
+ /* 360 */ array(),
+ /* 361 */ array(),
+ /* 362 */ array(),
+ /* 363 */ array(),
+ /* 364 */ array(),
+ /* 365 */ array(),
+ /* 366 */ array(),
+ /* 367 */ array(),
+ /* 368 */ array(),
+ /* 369 */ array(),
+ /* 370 */ array(),
+ /* 371 */ array(),
+ /* 372 */ array(),
+ /* 373 */ array(),
+ /* 374 */ array(),
+ /* 375 */ array(),
+ /* 376 */ array(),
+ /* 377 */ array(),
+ /* 378 */ array(),
+ /* 379 */ array(),
+ /* 380 */ array(),
+ /* 381 */ array(),
+ /* 382 */ array(),
+ /* 383 */ array(),
+ /* 384 */ array(),
+ /* 385 */ array(),
+ /* 386 */ array(),
+);
+ static public $yy_default = array(
+ /* 0 */ 390, 571, 588, 542, 542, 542, 588, 588, 588, 588,
+ /* 10 */ 588, 588, 588, 588, 588, 588, 588, 588, 588, 588,
+ /* 20 */ 588, 588, 588, 588, 588, 588, 588, 588, 588, 588,
+ /* 30 */ 588, 588, 588, 588, 588, 588, 588, 588, 588, 588,
+ /* 40 */ 588, 588, 588, 588, 588, 588, 588, 588, 588, 588,
+ /* 50 */ 588, 588, 588, 588, 450, 588, 588, 450, 450, 450,
+ /* 60 */ 588, 588, 455, 588, 588, 588, 588, 588, 588, 588,
+ /* 70 */ 588, 471, 474, 574, 573, 541, 434, 452, 475, 476,
+ /* 80 */ 484, 572, 455, 483, 480, 460, 461, 479, 540, 457,
+ /* 90 */ 488, 487, 499, 489, 463, 489, 450, 387, 588, 450,
+ /* 100 */ 450, 470, 450, 554, 507, 450, 588, 588, 450, 450,
+ /* 110 */ 450, 588, 588, 463, 463, 588, 463, 515, 508, 515,
+ /* 120 */ 463, 588, 463, 508, 515, 588, 588, 508, 588, 588,
+ /* 130 */ 588, 588, 588, 588, 588, 588, 588, 588, 588, 588,
+ /* 140 */ 588, 588, 463, 588, 515, 588, 588, 450, 508, 551,
+ /* 150 */ 450, 467, 468, 466, 490, 486, 473, 492, 491, 549,
+ /* 160 */ 516, 588, 588, 588, 588, 588, 588, 588, 532, 515,
+ /* 170 */ 534, 588, 588, 588, 535, 533, 588, 588, 513, 588,
+ /* 180 */ 588, 588, 588, 588, 588, 588, 588, 588, 588, 588,
+ /* 190 */ 588, 588, 529, 587, 470, 544, 555, 405, 543, 507,
+ /* 200 */ 552, 587, 515, 548, 515, 515, 548, 465, 499, 499,
+ /* 210 */ 499, 588, 499, 485, 499, 588, 588, 588, 527, 588,
+ /* 220 */ 588, 489, 495, 588, 497, 588, 527, 588, 588, 495,
+ /* 230 */ 527, 553, 588, 588, 588, 588, 588, 458, 588, 588,
+ /* 240 */ 588, 588, 588, 588, 489, 588, 588, 588, 588, 588,
+ /* 250 */ 501, 588, 527, 433, 442, 565, 566, 438, 567, 449,
+ /* 260 */ 429, 459, 586, 435, 416, 430, 469, 564, 444, 447,
+ /* 270 */ 563, 446, 445, 550, 562, 528, 443, 441, 417, 448,
+ /* 280 */ 440, 526, 582, 527, 439, 412, 398, 397, 396, 432,
+ /* 290 */ 399, 400, 431, 395, 394, 389, 388, 391, 415, 393,
+ /* 300 */ 392, 401, 437, 409, 506, 462, 410, 411, 413, 547,
+ /* 310 */ 510, 408, 403, 402, 404, 436, 407, 406, 414, 561,
+ /* 320 */ 509, 503, 505, 424, 514, 585, 578, 568, 465, 464,
+ /* 330 */ 477, 423, 530, 570, 569, 584, 581, 518, 525, 427,
+ /* 340 */ 428, 519, 426, 500, 575, 517, 425, 579, 580, 502,
+ /* 350 */ 576, 577, 478, 481, 522, 524, 583, 559, 558, 557,
+ /* 360 */ 521, 419, 493, 418, 472, 537, 560, 501, 520, 523,
+ /* 370 */ 545, 482, 496, 421, 498, 422, 539, 504, 536, 556,
+ /* 380 */ 494, 546, 512, 531, 420, 511, 538,
+);
+ const YYNOCODE = 121;
+ const YYSTACKDEPTH = 100;
+ const YYNSTATE = 387;
+ const YYNRULE = 201;
+ const YYERRORSYMBOL = 78;
+ const YYERRSYMDT = 'yy0';
+ const YYFALLBACK = 0;
+ static public $yyFallback = array(
+ );
+ static function Trace($TraceFILE, $zTracePrompt)
+ {
+ if (!$TraceFILE) {
+ $zTracePrompt = 0;
+ } elseif (!$zTracePrompt) {
+ $TraceFILE = 0;
+ }
+ self::$yyTraceFILE = $TraceFILE;
+ self::$yyTracePrompt = $zTracePrompt;
+ }
+
+ static function PrintTrace()
+ {
+ self::$yyTraceFILE = fopen('php://output', 'w');
+ self::$yyTracePrompt = '<br>';
+ }
+
+ static public $yyTraceFILE;
+ static public $yyTracePrompt;
+ public $yyidx; /* Index of top element in stack */
+ public $yyerrcnt; /* Shifts left before out of the error */
+ public $yystack = array(); /* The parser's stack */
+
+ public $yyTokenName = array(
+ '$', 'VERT', 'COLON', 'COMMENT',
+ 'PHPSTARTTAG', 'PHPENDTAG', 'ASPSTARTTAG', 'ASPENDTAG',
+ 'FAKEPHPSTARTTAG', 'XMLTAG', 'OTHER', 'LINEBREAK',
+ 'LITERALSTART', 'LITERALEND', 'LITERAL', 'LDEL',
+ 'RDEL', 'DOLLAR', 'ID', 'EQUAL',
+ 'PTR', 'LDELIF', 'LDELFOR', 'SEMICOLON',
+ 'INCDEC', 'TO', 'STEP', 'LDELFOREACH',
+ 'SPACE', 'AS', 'APTR', 'SMARTYBLOCKCHILD',
+ 'LDELSLASH', 'INTEGER', 'COMMA', 'OPENP',
+ 'CLOSEP', 'MATH', 'UNIMATH', 'ANDSYM',
+ 'ISIN', 'ISDIVBY', 'ISNOTDIVBY', 'ISEVEN',
+ 'ISNOTEVEN', 'ISEVENBY', 'ISNOTEVENBY', 'ISODD',
+ 'ISNOTODD', 'ISODDBY', 'ISNOTODDBY', 'INSTANCEOF',
+ 'QMARK', 'NOT', 'TYPECAST', 'HEX',
+ 'DOT', 'SINGLEQUOTESTRING', 'DOUBLECOLON', 'AT',
+ 'HATCH', 'OPENB', 'CLOSEB', 'EQUALS',
+ 'NOTEQUALS', 'GREATERTHAN', 'LESSTHAN', 'GREATEREQUAL',
+ 'LESSEQUAL', 'IDENTITY', 'NONEIDENTITY', 'MOD',
+ 'LAND', 'LOR', 'LXOR', 'QUOTE',
+ 'BACKTICK', 'DOLLARID', 'error', 'start',
+ 'template', 'template_element', 'smartytag', 'literal',
+ 'literal_elements', 'literal_element', 'value', 'modifierlist',
+ 'attributes', 'variable', 'expr', 'varindexed',
+ 'statement', 'statements', 'optspace', 'varvar',
+ 'foraction', 'attribute', 'ternary', 'array',
+ 'ifcond', 'lop', 'function', 'doublequoted_with_quotes',
+ 'static_class_access', 'object', 'arrayindex', 'indexdef',
+ 'varvarele', 'objectchain', 'objectelement', 'method',
+ 'params', 'modifier', 'modparameters', 'modparameter',
+ 'arrayelements', 'arrayelement', 'doublequoted', 'doublequotedcontent',
+ );
+
+ static public $yyRuleName = array(
+ /* 0 */ "start ::= template",
+ /* 1 */ "template ::= template_element",
+ /* 2 */ "template ::= template template_element",
+ /* 3 */ "template ::=",
+ /* 4 */ "template_element ::= smartytag",
+ /* 5 */ "template_element ::= COMMENT",
+ /* 6 */ "template_element ::= literal",
+ /* 7 */ "template_element ::= PHPSTARTTAG",
+ /* 8 */ "template_element ::= PHPENDTAG",
+ /* 9 */ "template_element ::= ASPSTARTTAG",
+ /* 10 */ "template_element ::= ASPENDTAG",
+ /* 11 */ "template_element ::= FAKEPHPSTARTTAG",
+ /* 12 */ "template_element ::= XMLTAG",
+ /* 13 */ "template_element ::= OTHER",
+ /* 14 */ "template_element ::= LINEBREAK",
+ /* 15 */ "literal ::= LITERALSTART LITERALEND",
+ /* 16 */ "literal ::= LITERALSTART literal_elements LITERALEND",
+ /* 17 */ "literal_elements ::= literal_elements literal_element",
+ /* 18 */ "literal_elements ::=",
+ /* 19 */ "literal_element ::= literal",
+ /* 20 */ "literal_element ::= LITERAL",
+ /* 21 */ "literal_element ::= PHPSTARTTAG",
+ /* 22 */ "literal_element ::= FAKEPHPSTARTTAG",
+ /* 23 */ "literal_element ::= PHPENDTAG",
+ /* 24 */ "literal_element ::= ASPSTARTTAG",
+ /* 25 */ "literal_element ::= ASPENDTAG",
+ /* 26 */ "smartytag ::= LDEL value RDEL",
+ /* 27 */ "smartytag ::= LDEL value modifierlist attributes RDEL",
+ /* 28 */ "smartytag ::= LDEL value attributes RDEL",
+ /* 29 */ "smartytag ::= LDEL variable modifierlist attributes RDEL",
+ /* 30 */ "smartytag ::= LDEL variable attributes RDEL",
+ /* 31 */ "smartytag ::= LDEL expr modifierlist attributes RDEL",
+ /* 32 */ "smartytag ::= LDEL expr attributes RDEL",
+ /* 33 */ "smartytag ::= LDEL DOLLAR ID EQUAL value RDEL",
+ /* 34 */ "smartytag ::= LDEL DOLLAR ID EQUAL expr RDEL",
+ /* 35 */ "smartytag ::= LDEL DOLLAR ID EQUAL expr attributes RDEL",
+ /* 36 */ "smartytag ::= LDEL varindexed EQUAL expr attributes RDEL",
+ /* 37 */ "smartytag ::= LDEL ID attributes RDEL",
+ /* 38 */ "smartytag ::= LDEL ID RDEL",
+ /* 39 */ "smartytag ::= LDEL ID PTR ID attributes RDEL",
+ /* 40 */ "smartytag ::= LDEL ID modifierlist attributes RDEL",
+ /* 41 */ "smartytag ::= LDEL ID PTR ID modifierlist attributes RDEL",
+ /* 42 */ "smartytag ::= LDELIF expr RDEL",
+ /* 43 */ "smartytag ::= LDELIF expr attributes RDEL",
+ /* 44 */ "smartytag ::= LDELIF statement RDEL",
+ /* 45 */ "smartytag ::= LDELIF statement attributes RDEL",
+ /* 46 */ "smartytag ::= LDELFOR statements SEMICOLON optspace expr SEMICOLON optspace DOLLAR varvar foraction attributes RDEL",
+ /* 47 */ "foraction ::= EQUAL expr",
+ /* 48 */ "foraction ::= INCDEC",
+ /* 49 */ "smartytag ::= LDELFOR statement TO expr attributes RDEL",
+ /* 50 */ "smartytag ::= LDELFOR statement TO expr STEP expr attributes RDEL",
+ /* 51 */ "smartytag ::= LDELFOREACH attributes RDEL",
+ /* 52 */ "smartytag ::= LDELFOREACH SPACE value AS DOLLAR varvar attributes RDEL",
+ /* 53 */ "smartytag ::= LDELFOREACH SPACE value AS DOLLAR varvar APTR DOLLAR varvar attributes RDEL",
+ /* 54 */ "smartytag ::= LDELFOREACH SPACE expr AS DOLLAR varvar attributes RDEL",
+ /* 55 */ "smartytag ::= LDELFOREACH SPACE expr AS DOLLAR varvar APTR DOLLAR varvar attributes RDEL",
+ /* 56 */ "smartytag ::= SMARTYBLOCKCHILD",
+ /* 57 */ "smartytag ::= LDELSLASH ID RDEL",
+ /* 58 */ "smartytag ::= LDELSLASH ID modifierlist RDEL",
+ /* 59 */ "smartytag ::= LDELSLASH ID PTR ID RDEL",
+ /* 60 */ "smartytag ::= LDELSLASH ID PTR ID modifierlist RDEL",
+ /* 61 */ "attributes ::= attributes attribute",
+ /* 62 */ "attributes ::= attribute",
+ /* 63 */ "attributes ::=",
+ /* 64 */ "attribute ::= SPACE ID EQUAL ID",
+ /* 65 */ "attribute ::= SPACE ID EQUAL expr",
+ /* 66 */ "attribute ::= SPACE ID EQUAL value",
+ /* 67 */ "attribute ::= SPACE ID",
+ /* 68 */ "attribute ::= SPACE expr",
+ /* 69 */ "attribute ::= SPACE value",
+ /* 70 */ "attribute ::= SPACE INTEGER EQUAL expr",
+ /* 71 */ "statements ::= statement",
+ /* 72 */ "statements ::= statements COMMA statement",
+ /* 73 */ "statement ::= DOLLAR varvar EQUAL expr",
+ /* 74 */ "statement ::= varindexed EQUAL expr",
+ /* 75 */ "statement ::= OPENP statement CLOSEP",
+ /* 76 */ "expr ::= value",
+ /* 77 */ "expr ::= ternary",
+ /* 78 */ "expr ::= DOLLAR ID COLON ID",
+ /* 79 */ "expr ::= expr MATH value",
+ /* 80 */ "expr ::= expr UNIMATH value",
+ /* 81 */ "expr ::= expr ANDSYM value",
+ /* 82 */ "expr ::= array",
+ /* 83 */ "expr ::= expr modifierlist",
+ /* 84 */ "expr ::= expr ifcond expr",
+ /* 85 */ "expr ::= expr ISIN array",
+ /* 86 */ "expr ::= expr ISIN value",
+ /* 87 */ "expr ::= expr lop expr",
+ /* 88 */ "expr ::= expr ISDIVBY expr",
+ /* 89 */ "expr ::= expr ISNOTDIVBY expr",
+ /* 90 */ "expr ::= expr ISEVEN",
+ /* 91 */ "expr ::= expr ISNOTEVEN",
+ /* 92 */ "expr ::= expr ISEVENBY expr",
+ /* 93 */ "expr ::= expr ISNOTEVENBY expr",
+ /* 94 */ "expr ::= expr ISODD",
+ /* 95 */ "expr ::= expr ISNOTODD",
+ /* 96 */ "expr ::= expr ISODDBY expr",
+ /* 97 */ "expr ::= expr ISNOTODDBY expr",
+ /* 98 */ "expr ::= value INSTANCEOF ID",
+ /* 99 */ "expr ::= value INSTANCEOF value",
+ /* 100 */ "ternary ::= OPENP expr CLOSEP QMARK DOLLAR ID COLON expr",
+ /* 101 */ "ternary ::= OPENP expr CLOSEP QMARK expr COLON expr",
+ /* 102 */ "value ::= variable",
+ /* 103 */ "value ::= UNIMATH value",
+ /* 104 */ "value ::= NOT value",
+ /* 105 */ "value ::= TYPECAST value",
+ /* 106 */ "value ::= variable INCDEC",
+ /* 107 */ "value ::= HEX",
+ /* 108 */ "value ::= INTEGER",
+ /* 109 */ "value ::= INTEGER DOT INTEGER",
+ /* 110 */ "value ::= INTEGER DOT",
+ /* 111 */ "value ::= DOT INTEGER",
+ /* 112 */ "value ::= ID",
+ /* 113 */ "value ::= function",
+ /* 114 */ "value ::= OPENP expr CLOSEP",
+ /* 115 */ "value ::= SINGLEQUOTESTRING",
+ /* 116 */ "value ::= doublequoted_with_quotes",
+ /* 117 */ "value ::= ID DOUBLECOLON static_class_access",
+ /* 118 */ "value ::= varindexed DOUBLECOLON static_class_access",
+ /* 119 */ "value ::= smartytag",
+ /* 120 */ "value ::= value modifierlist",
+ /* 121 */ "variable ::= varindexed",
+ /* 122 */ "variable ::= DOLLAR varvar AT ID",
+ /* 123 */ "variable ::= object",
+ /* 124 */ "variable ::= HATCH ID HATCH",
+ /* 125 */ "variable ::= HATCH variable HATCH",
+ /* 126 */ "varindexed ::= DOLLAR varvar arrayindex",
+ /* 127 */ "arrayindex ::= arrayindex indexdef",
+ /* 128 */ "arrayindex ::=",
+ /* 129 */ "indexdef ::= DOT DOLLAR varvar",
+ /* 130 */ "indexdef ::= DOT DOLLAR varvar AT ID",
+ /* 131 */ "indexdef ::= DOT ID",
+ /* 132 */ "indexdef ::= DOT INTEGER",
+ /* 133 */ "indexdef ::= DOT LDEL expr RDEL",
+ /* 134 */ "indexdef ::= OPENB ID CLOSEB",
+ /* 135 */ "indexdef ::= OPENB ID DOT ID CLOSEB",
+ /* 136 */ "indexdef ::= OPENB expr CLOSEB",
+ /* 137 */ "indexdef ::= OPENB CLOSEB",
+ /* 138 */ "varvar ::= varvarele",
+ /* 139 */ "varvar ::= varvar varvarele",
+ /* 140 */ "varvarele ::= ID",
+ /* 141 */ "varvarele ::= LDEL expr RDEL",
+ /* 142 */ "object ::= varindexed objectchain",
+ /* 143 */ "objectchain ::= objectelement",
+ /* 144 */ "objectchain ::= objectchain objectelement",
+ /* 145 */ "objectelement ::= PTR ID arrayindex",
+ /* 146 */ "objectelement ::= PTR DOLLAR varvar arrayindex",
+ /* 147 */ "objectelement ::= PTR LDEL expr RDEL arrayindex",
+ /* 148 */ "objectelement ::= PTR ID LDEL expr RDEL arrayindex",
+ /* 149 */ "objectelement ::= PTR method",
+ /* 150 */ "function ::= ID OPENP params CLOSEP",
+ /* 151 */ "method ::= ID OPENP params CLOSEP",
+ /* 152 */ "method ::= DOLLAR ID OPENP params CLOSEP",
+ /* 153 */ "params ::= params COMMA expr",
+ /* 154 */ "params ::= expr",
+ /* 155 */ "params ::=",
+ /* 156 */ "modifierlist ::= modifierlist modifier modparameters",
+ /* 157 */ "modifierlist ::= modifier modparameters",
+ /* 158 */ "modifier ::= VERT AT ID",
+ /* 159 */ "modifier ::= VERT ID",
+ /* 160 */ "modparameters ::= modparameters modparameter",
+ /* 161 */ "modparameters ::=",
+ /* 162 */ "modparameter ::= COLON value",
+ /* 163 */ "modparameter ::= COLON array",
+ /* 164 */ "static_class_access ::= method",
+ /* 165 */ "static_class_access ::= method objectchain",
+ /* 166 */ "static_class_access ::= ID",
+ /* 167 */ "static_class_access ::= DOLLAR ID arrayindex",
+ /* 168 */ "static_class_access ::= DOLLAR ID arrayindex objectchain",
+ /* 169 */ "ifcond ::= EQUALS",
+ /* 170 */ "ifcond ::= NOTEQUALS",
+ /* 171 */ "ifcond ::= GREATERTHAN",
+ /* 172 */ "ifcond ::= LESSTHAN",
+ /* 173 */ "ifcond ::= GREATEREQUAL",
+ /* 174 */ "ifcond ::= LESSEQUAL",
+ /* 175 */ "ifcond ::= IDENTITY",
+ /* 176 */ "ifcond ::= NONEIDENTITY",
+ /* 177 */ "ifcond ::= MOD",
+ /* 178 */ "lop ::= LAND",
+ /* 179 */ "lop ::= LOR",
+ /* 180 */ "lop ::= LXOR",
+ /* 181 */ "array ::= OPENB arrayelements CLOSEB",
+ /* 182 */ "arrayelements ::= arrayelement",
+ /* 183 */ "arrayelements ::= arrayelements COMMA arrayelement",
+ /* 184 */ "arrayelements ::=",
+ /* 185 */ "arrayelement ::= value APTR expr",
+ /* 186 */ "arrayelement ::= ID APTR expr",
+ /* 187 */ "arrayelement ::= expr",
+ /* 188 */ "doublequoted_with_quotes ::= QUOTE QUOTE",
+ /* 189 */ "doublequoted_with_quotes ::= QUOTE doublequoted QUOTE",
+ /* 190 */ "doublequoted ::= doublequoted doublequotedcontent",
+ /* 191 */ "doublequoted ::= doublequotedcontent",
+ /* 192 */ "doublequotedcontent ::= BACKTICK variable BACKTICK",
+ /* 193 */ "doublequotedcontent ::= BACKTICK expr BACKTICK",
+ /* 194 */ "doublequotedcontent ::= DOLLARID",
+ /* 195 */ "doublequotedcontent ::= LDEL variable RDEL",
+ /* 196 */ "doublequotedcontent ::= LDEL expr RDEL",
+ /* 197 */ "doublequotedcontent ::= smartytag",
+ /* 198 */ "doublequotedcontent ::= OTHER",
+ /* 199 */ "optspace ::= SPACE",
+ /* 200 */ "optspace ::=",
+ );
+
+ function tokenName($tokenType)
+ {
+ if ($tokenType === 0) {
+ return 'End of Input';
+ }
+ if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) {
+ return $this->yyTokenName[$tokenType];
+ } else {
+ return "Unknown";
+ }
+ }
+
+ static function yy_destructor($yymajor, $yypminor)
+ {
+ switch ($yymajor) {
+ default: break; /* If no destructor action specified: do nothing */
+ }
+ }
+
+ 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;
+ }
+
+ function __destruct()
+ {
+ while ($this->yystack !== Array()) {
+ $this->yy_pop_parser_stack();
+ }
+ if (is_resource(self::$yyTraceFILE)) {
+ fclose(self::$yyTraceFILE);
+ }
+ }
+
+ 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 = array_merge($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);
+ $this->yyidx = $yyidx;
+ $this->yystack = $stack;
+ return array_unique($expected);
+ }
+
+ 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;
+ }
+
+ 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];
+ }
+ }
+
+ 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];
+ }
+ }
+
+ 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();
+ }
+#line 73 "smarty_internal_templateparser.y"
+
+ $this->internalError = true;
+ $this->compiler->trigger_template_error("Stack overflow in template parser");
+#line 1751 "smarty_internal_templateparser.php"
+ 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");
+ }
+ }
+
+ static public $yyRuleInfo = array(
+ array( 'lhs' => 79, 'rhs' => 1 ),
+ array( 'lhs' => 80, 'rhs' => 1 ),
+ array( 'lhs' => 80, 'rhs' => 2 ),
+ array( 'lhs' => 80, 'rhs' => 0 ),
+ array( 'lhs' => 81, 'rhs' => 1 ),
+ array( 'lhs' => 81, 'rhs' => 1 ),
+ array( 'lhs' => 81, 'rhs' => 1 ),
+ array( 'lhs' => 81, 'rhs' => 1 ),
+ array( 'lhs' => 81, 'rhs' => 1 ),
+ array( 'lhs' => 81, 'rhs' => 1 ),
+ array( 'lhs' => 81, 'rhs' => 1 ),
+ array( 'lhs' => 81, 'rhs' => 1 ),
+ array( 'lhs' => 81, 'rhs' => 1 ),
+ array( 'lhs' => 81, 'rhs' => 1 ),
+ array( 'lhs' => 81, 'rhs' => 1 ),
+ array( 'lhs' => 83, 'rhs' => 2 ),
+ array( 'lhs' => 83, 'rhs' => 3 ),
+ array( 'lhs' => 84, 'rhs' => 2 ),
+ array( 'lhs' => 84, 'rhs' => 0 ),
+ array( 'lhs' => 85, 'rhs' => 1 ),
+ array( 'lhs' => 85, 'rhs' => 1 ),
+ array( 'lhs' => 85, 'rhs' => 1 ),
+ array( 'lhs' => 85, 'rhs' => 1 ),
+ array( 'lhs' => 85, 'rhs' => 1 ),
+ array( 'lhs' => 85, 'rhs' => 1 ),
+ array( 'lhs' => 85, 'rhs' => 1 ),
+ array( 'lhs' => 82, 'rhs' => 3 ),
+ array( 'lhs' => 82, 'rhs' => 5 ),
+ array( 'lhs' => 82, 'rhs' => 4 ),
+ array( 'lhs' => 82, 'rhs' => 5 ),
+ array( 'lhs' => 82, 'rhs' => 4 ),
+ array( 'lhs' => 82, 'rhs' => 5 ),
+ array( 'lhs' => 82, 'rhs' => 4 ),
+ array( 'lhs' => 82, 'rhs' => 6 ),
+ array( 'lhs' => 82, 'rhs' => 6 ),
+ array( 'lhs' => 82, 'rhs' => 7 ),
+ array( 'lhs' => 82, 'rhs' => 6 ),
+ array( 'lhs' => 82, 'rhs' => 4 ),
+ array( 'lhs' => 82, 'rhs' => 3 ),
+ array( 'lhs' => 82, 'rhs' => 6 ),
+ array( 'lhs' => 82, 'rhs' => 5 ),
+ array( 'lhs' => 82, 'rhs' => 7 ),
+ array( 'lhs' => 82, 'rhs' => 3 ),
+ array( 'lhs' => 82, 'rhs' => 4 ),
+ array( 'lhs' => 82, 'rhs' => 3 ),
+ array( 'lhs' => 82, 'rhs' => 4 ),
+ array( 'lhs' => 82, 'rhs' => 12 ),
+ array( 'lhs' => 96, 'rhs' => 2 ),
+ array( 'lhs' => 96, 'rhs' => 1 ),
+ array( 'lhs' => 82, 'rhs' => 6 ),
+ array( 'lhs' => 82, 'rhs' => 8 ),
+ array( 'lhs' => 82, 'rhs' => 3 ),
+ array( 'lhs' => 82, 'rhs' => 8 ),
+ array( 'lhs' => 82, 'rhs' => 11 ),
+ array( 'lhs' => 82, 'rhs' => 8 ),
+ array( 'lhs' => 82, 'rhs' => 11 ),
+ array( 'lhs' => 82, 'rhs' => 1 ),
+ array( 'lhs' => 82, 'rhs' => 3 ),
+ array( 'lhs' => 82, 'rhs' => 4 ),
+ array( 'lhs' => 82, 'rhs' => 5 ),
+ array( 'lhs' => 82, 'rhs' => 6 ),
+ array( 'lhs' => 88, 'rhs' => 2 ),
+ array( 'lhs' => 88, 'rhs' => 1 ),
+ array( 'lhs' => 88, 'rhs' => 0 ),
+ array( 'lhs' => 97, 'rhs' => 4 ),
+ array( 'lhs' => 97, 'rhs' => 4 ),
+ array( 'lhs' => 97, 'rhs' => 4 ),
+ array( 'lhs' => 97, 'rhs' => 2 ),
+ array( 'lhs' => 97, 'rhs' => 2 ),
+ array( 'lhs' => 97, 'rhs' => 2 ),
+ array( 'lhs' => 97, 'rhs' => 4 ),
+ array( 'lhs' => 93, 'rhs' => 1 ),
+ array( 'lhs' => 93, 'rhs' => 3 ),
+ array( 'lhs' => 92, 'rhs' => 4 ),
+ array( 'lhs' => 92, 'rhs' => 3 ),
+ array( 'lhs' => 92, 'rhs' => 3 ),
+ array( 'lhs' => 90, 'rhs' => 1 ),
+ array( 'lhs' => 90, 'rhs' => 1 ),
+ array( 'lhs' => 90, 'rhs' => 4 ),
+ array( 'lhs' => 90, 'rhs' => 3 ),
+ array( 'lhs' => 90, 'rhs' => 3 ),
+ array( 'lhs' => 90, 'rhs' => 3 ),
+ array( 'lhs' => 90, 'rhs' => 1 ),
+ array( 'lhs' => 90, 'rhs' => 2 ),
+ array( 'lhs' => 90, 'rhs' => 3 ),
+ array( 'lhs' => 90, 'rhs' => 3 ),
+ array( 'lhs' => 90, 'rhs' => 3 ),
+ array( 'lhs' => 90, 'rhs' => 3 ),
+ array( 'lhs' => 90, 'rhs' => 3 ),
+ array( 'lhs' => 90, 'rhs' => 3 ),
+ array( 'lhs' => 90, 'rhs' => 2 ),
+ array( 'lhs' => 90, 'rhs' => 2 ),
+ array( 'lhs' => 90, 'rhs' => 3 ),
+ array( 'lhs' => 90, 'rhs' => 3 ),
+ array( 'lhs' => 90, 'rhs' => 2 ),
+ array( 'lhs' => 90, 'rhs' => 2 ),
+ array( 'lhs' => 90, 'rhs' => 3 ),
+ array( 'lhs' => 90, 'rhs' => 3 ),
+ array( 'lhs' => 90, 'rhs' => 3 ),
+ array( 'lhs' => 90, 'rhs' => 3 ),
+ array( 'lhs' => 98, 'rhs' => 8 ),
+ array( 'lhs' => 98, 'rhs' => 7 ),
+ array( 'lhs' => 86, 'rhs' => 1 ),
+ array( 'lhs' => 86, 'rhs' => 2 ),
+ array( 'lhs' => 86, 'rhs' => 2 ),
+ array( 'lhs' => 86, 'rhs' => 2 ),
+ array( 'lhs' => 86, 'rhs' => 2 ),
+ array( 'lhs' => 86, 'rhs' => 1 ),
+ array( 'lhs' => 86, 'rhs' => 1 ),
+ array( 'lhs' => 86, 'rhs' => 3 ),
+ array( 'lhs' => 86, 'rhs' => 2 ),
+ array( 'lhs' => 86, 'rhs' => 2 ),
+ array( 'lhs' => 86, 'rhs' => 1 ),
+ array( 'lhs' => 86, 'rhs' => 1 ),
+ array( 'lhs' => 86, 'rhs' => 3 ),
+ array( 'lhs' => 86, 'rhs' => 1 ),
+ array( 'lhs' => 86, 'rhs' => 1 ),
+ array( 'lhs' => 86, 'rhs' => 3 ),
+ array( 'lhs' => 86, 'rhs' => 3 ),
+ array( 'lhs' => 86, 'rhs' => 1 ),
+ array( 'lhs' => 86, 'rhs' => 2 ),
+ array( 'lhs' => 89, 'rhs' => 1 ),
+ array( 'lhs' => 89, 'rhs' => 4 ),
+ array( 'lhs' => 89, 'rhs' => 1 ),
+ array( 'lhs' => 89, 'rhs' => 3 ),
+ array( 'lhs' => 89, 'rhs' => 3 ),
+ array( 'lhs' => 91, 'rhs' => 3 ),
+ array( 'lhs' => 106, 'rhs' => 2 ),
+ array( 'lhs' => 106, 'rhs' => 0 ),
+ array( 'lhs' => 107, 'rhs' => 3 ),
+ array( 'lhs' => 107, 'rhs' => 5 ),
+ array( 'lhs' => 107, 'rhs' => 2 ),
+ array( 'lhs' => 107, 'rhs' => 2 ),
+ array( 'lhs' => 107, 'rhs' => 4 ),
+ array( 'lhs' => 107, 'rhs' => 3 ),
+ array( 'lhs' => 107, 'rhs' => 5 ),
+ array( 'lhs' => 107, 'rhs' => 3 ),
+ array( 'lhs' => 107, 'rhs' => 2 ),
+ array( 'lhs' => 95, 'rhs' => 1 ),
+ array( 'lhs' => 95, 'rhs' => 2 ),
+ array( 'lhs' => 108, 'rhs' => 1 ),
+ array( 'lhs' => 108, 'rhs' => 3 ),
+ array( 'lhs' => 105, 'rhs' => 2 ),
+ array( 'lhs' => 109, 'rhs' => 1 ),
+ array( 'lhs' => 109, 'rhs' => 2 ),
+ array( 'lhs' => 110, 'rhs' => 3 ),
+ array( 'lhs' => 110, 'rhs' => 4 ),
+ array( 'lhs' => 110, 'rhs' => 5 ),
+ array( 'lhs' => 110, 'rhs' => 6 ),
+ array( 'lhs' => 110, 'rhs' => 2 ),
+ array( 'lhs' => 102, 'rhs' => 4 ),
+ array( 'lhs' => 111, 'rhs' => 4 ),
+ array( 'lhs' => 111, 'rhs' => 5 ),
+ array( 'lhs' => 112, 'rhs' => 3 ),
+ array( 'lhs' => 112, 'rhs' => 1 ),
+ array( 'lhs' => 112, 'rhs' => 0 ),
+ array( 'lhs' => 87, 'rhs' => 3 ),
+ array( 'lhs' => 87, 'rhs' => 2 ),
+ array( 'lhs' => 113, 'rhs' => 3 ),
+ array( 'lhs' => 113, 'rhs' => 2 ),
+ array( 'lhs' => 114, 'rhs' => 2 ),
+ array( 'lhs' => 114, 'rhs' => 0 ),
+ array( 'lhs' => 115, 'rhs' => 2 ),
+ array( 'lhs' => 115, 'rhs' => 2 ),
+ array( 'lhs' => 104, 'rhs' => 1 ),
+ array( 'lhs' => 104, 'rhs' => 2 ),
+ array( 'lhs' => 104, 'rhs' => 1 ),
+ array( 'lhs' => 104, 'rhs' => 3 ),
+ array( 'lhs' => 104, 'rhs' => 4 ),
+ array( 'lhs' => 100, 'rhs' => 1 ),
+ array( 'lhs' => 100, 'rhs' => 1 ),
+ array( 'lhs' => 100, 'rhs' => 1 ),
+ array( 'lhs' => 100, 'rhs' => 1 ),
+ array( 'lhs' => 100, 'rhs' => 1 ),
+ array( 'lhs' => 100, 'rhs' => 1 ),
+ array( 'lhs' => 100, 'rhs' => 1 ),
+ array( 'lhs' => 100, 'rhs' => 1 ),
+ array( 'lhs' => 100, 'rhs' => 1 ),
+ array( 'lhs' => 101, 'rhs' => 1 ),
+ array( 'lhs' => 101, 'rhs' => 1 ),
+ array( 'lhs' => 101, 'rhs' => 1 ),
+ array( 'lhs' => 99, 'rhs' => 3 ),
+ array( 'lhs' => 116, 'rhs' => 1 ),
+ array( 'lhs' => 116, 'rhs' => 3 ),
+ array( 'lhs' => 116, 'rhs' => 0 ),
+ array( 'lhs' => 117, 'rhs' => 3 ),
+ array( 'lhs' => 117, 'rhs' => 3 ),
+ array( 'lhs' => 117, 'rhs' => 1 ),
+ array( 'lhs' => 103, 'rhs' => 2 ),
+ array( 'lhs' => 103, 'rhs' => 3 ),
+ array( 'lhs' => 118, 'rhs' => 2 ),
+ array( 'lhs' => 118, 'rhs' => 1 ),
+ array( 'lhs' => 119, 'rhs' => 3 ),
+ array( 'lhs' => 119, 'rhs' => 3 ),
+ array( 'lhs' => 119, 'rhs' => 1 ),
+ array( 'lhs' => 119, 'rhs' => 3 ),
+ array( 'lhs' => 119, 'rhs' => 3 ),
+ array( 'lhs' => 119, 'rhs' => 1 ),
+ array( 'lhs' => 119, 'rhs' => 1 ),
+ array( 'lhs' => 94, 'rhs' => 1 ),
+ array( 'lhs' => 94, 'rhs' => 0 ),
+ );
+
+ static public $yyReduceMap = array(
+ 0 => 0,
+ 1 => 1,
+ 2 => 1,
+ 4 => 4,
+ 5 => 5,
+ 6 => 6,
+ 7 => 7,
+ 8 => 8,
+ 9 => 9,
+ 10 => 10,
+ 11 => 11,
+ 12 => 12,
+ 13 => 13,
+ 14 => 14,
+ 15 => 15,
+ 18 => 15,
+ 16 => 16,
+ 17 => 17,
+ 103 => 17,
+ 105 => 17,
+ 106 => 17,
+ 165 => 17,
+ 19 => 19,
+ 20 => 19,
+ 76 => 19,
+ 77 => 19,
+ 102 => 19,
+ 107 => 19,
+ 108 => 19,
+ 113 => 19,
+ 115 => 19,
+ 116 => 19,
+ 123 => 19,
+ 164 => 19,
+ 182 => 19,
+ 21 => 21,
+ 22 => 21,
+ 23 => 23,
+ 24 => 24,
+ 25 => 25,
+ 26 => 26,
+ 27 => 27,
+ 29 => 27,
+ 28 => 28,
+ 30 => 28,
+ 32 => 28,
+ 31 => 31,
+ 33 => 33,
+ 34 => 33,
+ 35 => 35,
+ 36 => 36,
+ 37 => 37,
+ 38 => 38,
+ 39 => 39,
+ 40 => 40,
+ 41 => 41,
+ 42 => 42,
+ 44 => 42,
+ 43 => 43,
+ 45 => 43,
+ 46 => 46,
+ 47 => 47,
+ 48 => 48,
+ 68 => 48,
+ 69 => 48,
+ 166 => 48,
+ 187 => 48,
+ 49 => 49,
+ 50 => 50,
+ 51 => 51,
+ 52 => 52,
+ 53 => 53,
+ 54 => 54,
+ 55 => 55,
+ 56 => 56,
+ 57 => 57,
+ 58 => 58,
+ 59 => 59,
+ 60 => 60,
+ 61 => 61,
+ 62 => 62,
+ 71 => 62,
+ 154 => 62,
+ 158 => 62,
+ 63 => 63,
+ 155 => 63,
+ 64 => 64,
+ 65 => 65,
+ 66 => 65,
+ 67 => 67,
+ 70 => 70,
+ 72 => 72,
+ 73 => 73,
+ 74 => 73,
+ 75 => 75,
+ 78 => 78,
+ 79 => 79,
+ 80 => 79,
+ 81 => 79,
+ 82 => 82,
+ 138 => 82,
+ 199 => 82,
+ 83 => 83,
+ 120 => 83,
+ 84 => 84,
+ 87 => 84,
+ 98 => 84,
+ 85 => 85,
+ 86 => 86,
+ 88 => 88,
+ 89 => 89,
+ 90 => 90,
+ 95 => 90,
+ 91 => 91,
+ 94 => 91,
+ 92 => 92,
+ 97 => 92,
+ 93 => 93,
+ 96 => 93,
+ 99 => 99,
+ 100 => 100,
+ 101 => 101,
+ 104 => 104,
+ 109 => 109,
+ 110 => 110,
+ 111 => 111,
+ 112 => 112,
+ 114 => 114,
+ 117 => 117,
+ 118 => 118,
+ 119 => 119,
+ 121 => 121,
+ 122 => 122,
+ 124 => 124,
+ 125 => 125,
+ 126 => 126,
+ 127 => 127,
+ 128 => 128,
+ 129 => 129,
+ 130 => 130,
+ 131 => 131,
+ 132 => 132,
+ 133 => 133,
+ 136 => 133,
+ 134 => 134,
+ 135 => 135,
+ 137 => 137,
+ 139 => 139,
+ 140 => 140,
+ 141 => 141,
+ 142 => 142,
+ 143 => 143,
+ 144 => 144,
+ 145 => 145,
+ 146 => 146,
+ 147 => 147,
+ 148 => 148,
+ 149 => 149,
+ 150 => 150,
+ 151 => 151,
+ 152 => 152,
+ 153 => 153,
+ 156 => 156,
+ 157 => 157,
+ 159 => 159,
+ 160 => 160,
+ 161 => 161,
+ 162 => 162,
+ 163 => 162,
+ 167 => 167,
+ 168 => 168,
+ 169 => 169,
+ 170 => 170,
+ 171 => 171,
+ 172 => 172,
+ 173 => 173,
+ 174 => 174,
+ 175 => 175,
+ 176 => 176,
+ 177 => 177,
+ 178 => 178,
+ 179 => 179,
+ 180 => 180,
+ 181 => 181,
+ 183 => 183,
+ 184 => 184,
+ 185 => 185,
+ 186 => 186,
+ 188 => 188,
+ 189 => 189,
+ 190 => 190,
+ 191 => 191,
+ 192 => 192,
+ 193 => 192,
+ 195 => 192,
+ 194 => 194,
+ 196 => 196,
+ 197 => 197,
+ 198 => 198,
+ 200 => 200,
+ );
+#line 84 "smarty_internal_templateparser.y"
+ function yy_r0(){ $this->_retvalue = $this->root_buffer->to_smarty_php(); }
+#line 2179 "smarty_internal_templateparser.php"
+#line 90 "smarty_internal_templateparser.y"
+ function yy_r1(){ $this->current_buffer->append_subtree($this->yystack[$this->yyidx + 0]->minor); }
+#line 2182 "smarty_internal_templateparser.php"
+#line 102 "smarty_internal_templateparser.y"
+ function yy_r4(){
+ if ($this->compiler->has_code) {
+ $tmp =''; foreach ($this->compiler->prefix_code as $code) {$tmp.=$code;} $this->compiler->prefix_code=array();
+ $this->_retvalue = new _smarty_tag($this, $this->compiler->processNocacheCode($tmp.$this->yystack[$this->yyidx + 0]->minor,true));
+ } else {
+ $this->_retvalue = new _smarty_tag($this, $this->yystack[$this->yyidx + 0]->minor);
+ }
+ $this->compiler->has_variable_string = false;
+ $this->block_nesting_level = count($this->compiler->_tag_stack);
+ }
+#line 2194 "smarty_internal_templateparser.php"
+#line 114 "smarty_internal_templateparser.y"
+ function yy_r5(){ $this->_retvalue = new _smarty_tag($this, ''); }
+#line 2197 "smarty_internal_templateparser.php"
+#line 117 "smarty_internal_templateparser.y"
+ function yy_r6(){ $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); }
+#line 2200 "smarty_internal_templateparser.php"
+#line 120 "smarty_internal_templateparser.y"
+ function yy_r7(){
+ if ($this->php_handling == Smarty::PHP_PASSTHRU) {
+ $this->_retvalue = new _smarty_text($this, self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor));
+ } elseif ($this->php_handling == Smarty::PHP_QUOTE) {
+ $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES));
+ }elseif ($this->php_handling == Smarty::PHP_ALLOW) {
+ $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('<?php', true));
+ }elseif ($this->php_handling == Smarty::PHP_REMOVE) {
+ $this->_retvalue = new _smarty_text($this, '');
+ }
+ }
+#line 2213 "smarty_internal_templateparser.php"
+#line 132 "smarty_internal_templateparser.y"
+ function yy_r8(){if ($this->is_xml) {
+ $this->compiler->tag_nocache = true;
+ $this->is_xml = false;
+ $save = $this->template->has_nocache_code;
+ $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode("<?php echo '?>';?>", $this->compiler, true));
+ $this->template->has_nocache_code = $save;
+ }elseif ($this->php_handling == Smarty::PHP_PASSTHRU) {
+ $this->_retvalue = new _smarty_text($this, '?<?php ?>>');
+ } elseif ($this->php_handling == Smarty::PHP_QUOTE) {
+ $this->_retvalue = new _smarty_text($this, htmlspecialchars('?>', ENT_QUOTES));
+ }elseif ($this->php_handling == Smarty::PHP_ALLOW) {
+ $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('?>', true));
+ }elseif ($this->php_handling == Smarty::PHP_REMOVE) {
+ $this->_retvalue = new _smarty_text($this, '');
+ }
+ }
+#line 2231 "smarty_internal_templateparser.php"
+#line 150 "smarty_internal_templateparser.y"
+ function yy_r9(){
+ if ($this->php_handling == Smarty::PHP_PASSTHRU) {
+ $this->_retvalue = new _smarty_text($this, '<<?php ?>%');
+ } elseif ($this->php_handling == Smarty::PHP_QUOTE) {
+ $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES));
+ }elseif ($this->php_handling == Smarty::PHP_ALLOW) {
+ if ($this->asp_tags) {
+ $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('<%', true));
+ } else {
+ $this->_retvalue = new _smarty_text($this, '<<?php ?>%');
+ }
+ }elseif ($this->php_handling == Smarty::PHP_REMOVE) {
+ if ($this->asp_tags) {
+ $this->_retvalue = new _smarty_text($this, '');
+ } else {
+ $this->_retvalue = new _smarty_text($this, '<<?php ?>%');
+ }
+ }
+ }
+#line 2252 "smarty_internal_templateparser.php"
+#line 171 "smarty_internal_templateparser.y"
+ function yy_r10(){
+ if ($this->php_handling == Smarty::PHP_PASSTHRU) {
+ $this->_retvalue = new _smarty_text($this, '%<?php ?>>');
+ } elseif ($this->php_handling == Smarty::PHP_QUOTE) {
+ $this->_retvalue = new _smarty_text($this, htmlspecialchars('%>', ENT_QUOTES));
+ }elseif ($this->php_handling == Smarty::PHP_ALLOW) {
+ if ($this->asp_tags) {
+ $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode('%>', true));
+ } else {
+ $this->_retvalue = new _smarty_text($this, '%<?php ?>>');
+ }
+ }elseif ($this->php_handling == Smarty::PHP_REMOVE) {
+ if ($this->asp_tags) {
+ $this->_retvalue = new _smarty_text($this, '');
+ } else {
+ $this->_retvalue = new _smarty_text($this, '%<?php ?>>');
+ }
+ }
+ }
+#line 2273 "smarty_internal_templateparser.php"
+#line 191 "smarty_internal_templateparser.y"
+ function yy_r11(){if ($this->lex->strip) {
+ $this->_retvalue = new _smarty_text($this, preg_replace('![\$this->yystack[$this->yyidx + 0]->minor ]*[\r\n]+[\$this->yystack[$this->yyidx + 0]->minor ]*!', '', self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor)));
+ } else {
+ $this->_retvalue = new _smarty_text($this, self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor));
+ }
+ }
+#line 2281 "smarty_internal_templateparser.php"
+#line 199 "smarty_internal_templateparser.y"
+ function yy_r12(){ $this->compiler->tag_nocache = true;
+ $this->is_xml = true;
+ $save = $this->template->has_nocache_code;
+ $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode("<?php echo '<?xml';?>", $this->compiler, true));
+ $this->template->has_nocache_code = $save;
+ }
+#line 2289 "smarty_internal_templateparser.php"
+#line 207 "smarty_internal_templateparser.y"
+ function yy_r13(){if ($this->lex->strip) {
+ $this->_retvalue = new _smarty_text($this, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor));
+ } else {
+ $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor);
+ }
+ }
+#line 2297 "smarty_internal_templateparser.php"
+#line 213 "smarty_internal_templateparser.y"
+ function yy_r14(){
+ $this->_retvalue = new _smarty_linebreak($this, $this->yystack[$this->yyidx + 0]->minor);
+ }
+#line 2302 "smarty_internal_templateparser.php"
+#line 218 "smarty_internal_templateparser.y"
+ function yy_r15(){ $this->_retvalue = ''; }
+#line 2305 "smarty_internal_templateparser.php"
+#line 219 "smarty_internal_templateparser.y"
+ function yy_r16(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; }
+#line 2308 "smarty_internal_templateparser.php"
+#line 221 "smarty_internal_templateparser.y"
+ function yy_r17(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
+#line 2311 "smarty_internal_templateparser.php"
+#line 224 "smarty_internal_templateparser.y"
+ function yy_r19(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }
+#line 2314 "smarty_internal_templateparser.php"
+#line 226 "smarty_internal_templateparser.y"
+ function yy_r21(){ $this->_retvalue = self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor); }
+#line 2317 "smarty_internal_templateparser.php"
+#line 228 "smarty_internal_templateparser.y"
+ function yy_r23(){ $this->_retvalue = self::escape_end_tag($this->yystack[$this->yyidx + 0]->minor); }
+#line 2320 "smarty_internal_templateparser.php"
+#line 229 "smarty_internal_templateparser.y"
+ function yy_r24(){ $this->_retvalue = '<<?php ?>%'; }
+#line 2323 "smarty_internal_templateparser.php"
+#line 230 "smarty_internal_templateparser.y"
+ function yy_r25(){ $this->_retvalue = '%<?php ?>>'; }
+#line 2326 "smarty_internal_templateparser.php"
+#line 238 "smarty_internal_templateparser.y"
+ function yy_r26(){ $this->_retvalue = $this->compiler->compileTag('private_print_expression',array(),array('value'=>$this->yystack[$this->yyidx + -1]->minor)); }
+#line 2329 "smarty_internal_templateparser.php"
+#line 239 "smarty_internal_templateparser.y"
+ function yy_r27(){ $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + -1]->minor,array('value'=>$this->yystack[$this->yyidx + -3]->minor, 'modifierlist'=>$this->yystack[$this->yyidx + -2]->minor)); }
+#line 2332 "smarty_internal_templateparser.php"
+#line 240 "smarty_internal_templateparser.y"
+ function yy_r28(){ $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + -1]->minor,array('value'=>$this->yystack[$this->yyidx + -2]->minor)); }
+#line 2335 "smarty_internal_templateparser.php"
+#line 243 "smarty_internal_templateparser.y"
+ function yy_r31(){ $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + -1]->minor,array('value'=>$this->yystack[$this->yyidx + -3]->minor,'modifierlist'=>$this->yystack[$this->yyidx + -2]->minor)); }
+#line 2338 "smarty_internal_templateparser.php"
+#line 251 "smarty_internal_templateparser.y"
+ function yy_r33(){ $this->_retvalue = $this->compiler->compileTag('assign',array(array('value'=>$this->yystack[$this->yyidx + -1]->minor),array('var'=>"'".$this->yystack[$this->yyidx + -3]->minor."'"))); }
+#line 2341 "smarty_internal_templateparser.php"
+#line 253 "smarty_internal_templateparser.y"
+ function yy_r35(){ $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + -2]->minor),array('var'=>"'".$this->yystack[$this->yyidx + -4]->minor."'")),$this->yystack[$this->yyidx + -1]->minor)); }
+#line 2344 "smarty_internal_templateparser.php"
+#line 254 "smarty_internal_templateparser.y"
+ function yy_r36(){ $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + -2]->minor),array('var'=>$this->yystack[$this->yyidx + -4]->minor['var'])),$this->yystack[$this->yyidx + -1]->minor),array('smarty_internal_index'=>$this->yystack[$this->yyidx + -4]->minor['smarty_internal_index'])); }
+#line 2347 "smarty_internal_templateparser.php"
+#line 256 "smarty_internal_templateparser.y"
+ function yy_r37(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor,$this->yystack[$this->yyidx + -1]->minor); }
+#line 2350 "smarty_internal_templateparser.php"
+#line 257 "smarty_internal_templateparser.y"
+ function yy_r38(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor,array()); }
+#line 2353 "smarty_internal_templateparser.php"
+#line 259 "smarty_internal_templateparser.y"
+ function yy_r39(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor,$this->yystack[$this->yyidx + -1]->minor,array('object_methode'=>$this->yystack[$this->yyidx + -2]->minor)); }
+#line 2356 "smarty_internal_templateparser.php"
+#line 261 "smarty_internal_templateparser.y"
+ function yy_r40(){ $this->_retvalue = '<?php ob_start();?>'.$this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor,$this->yystack[$this->yyidx + -1]->minor).'<?php echo ';
+ $this->_retvalue .= $this->compiler->compileTag('private_modifier',array(),array('modifierlist'=>$this->yystack[$this->yyidx + -2]->minor,'value'=>'ob_get_clean()')).'?>';
+ }
+#line 2361 "smarty_internal_templateparser.php"
+#line 265 "smarty_internal_templateparser.y"
+ function yy_r41(){ $this->_retvalue = '<?php ob_start();?>'.$this->compiler->compileTag($this->yystack[$this->yyidx + -5]->minor,$this->yystack[$this->yyidx + -1]->minor,array('object_methode'=>$this->yystack[$this->yyidx + -3]->minor)).'<?php echo ';
+ $this->_retvalue .= $this->compiler->compileTag('private_modifier',array(),array('modifierlist'=>$this->yystack[$this->yyidx + -2]->minor,'value'=>'ob_get_clean()')).'?>';
+ }
+#line 2366 "smarty_internal_templateparser.php"
+#line 269 "smarty_internal_templateparser.y"
+ function yy_r42(){ $tag = trim(substr($this->yystack[$this->yyidx + -2]->minor,$this->lex->ldel_length)); $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + -1]->minor)); }
+#line 2369 "smarty_internal_templateparser.php"
+#line 270 "smarty_internal_templateparser.y"
+ function yy_r43(){ $tag = trim(substr($this->yystack[$this->yyidx + -3]->minor,$this->lex->ldel_length)); $this->_retvalue = $this->compiler->compileTag(($tag == 'else if')? 'elseif' : $tag,$this->yystack[$this->yyidx + -1]->minor,array('if condition'=>$this->yystack[$this->yyidx + -2]->minor)); }
+#line 2372 "smarty_internal_templateparser.php"
+#line 274 "smarty_internal_templateparser.y"
+ function yy_r46(){
+ $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('start'=>$this->yystack[$this->yyidx + -10]->minor),array('ifexp'=>$this->yystack[$this->yyidx + -7]->minor),array('var'=>$this->yystack[$this->yyidx + -3]->minor),array('step'=>$this->yystack[$this->yyidx + -2]->minor))),1); }
+#line 2376 "smarty_internal_templateparser.php"
+#line 277 "smarty_internal_templateparser.y"
+ function yy_r47(){ $this->_retvalue = '='.$this->yystack[$this->yyidx + 0]->minor; }
+#line 2379 "smarty_internal_templateparser.php"
+#line 278 "smarty_internal_templateparser.y"
+ function yy_r48(){ $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }
+#line 2382 "smarty_internal_templateparser.php"
+#line 279 "smarty_internal_templateparser.y"
+ function yy_r49(){ $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('start'=>$this->yystack[$this->yyidx + -4]->minor),array('to'=>$this->yystack[$this->yyidx + -2]->minor))),0); }
+#line 2385 "smarty_internal_templateparser.php"
+#line 280 "smarty_internal_templateparser.y"
+ function yy_r50(){ $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('start'=>$this->yystack[$this->yyidx + -6]->minor),array('to'=>$this->yystack[$this->yyidx + -4]->minor),array('step'=>$this->yystack[$this->yyidx + -2]->minor))),0); }
+#line 2388 "smarty_internal_templateparser.php"
+#line 282 "smarty_internal_templateparser.y"
+ function yy_r51(){ $this->_retvalue = $this->compiler->compileTag('foreach',$this->yystack[$this->yyidx + -1]->minor); }
+#line 2391 "smarty_internal_templateparser.php"
+#line 284 "smarty_internal_templateparser.y"
+ function yy_r52(){
+ $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -5]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor)))); }
+#line 2395 "smarty_internal_templateparser.php"
+#line 286 "smarty_internal_templateparser.y"
+ function yy_r53(){
+ $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -8]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor),array('key'=>$this->yystack[$this->yyidx + -5]->minor)))); }
+#line 2399 "smarty_internal_templateparser.php"
+#line 288 "smarty_internal_templateparser.y"
+ function yy_r54(){
+ $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -5]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor)))); }
+#line 2403 "smarty_internal_templateparser.php"
+#line 290 "smarty_internal_templateparser.y"
+ function yy_r55(){
+ $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + -1]->minor,array(array('from'=>$this->yystack[$this->yyidx + -8]->minor),array('item'=>$this->yystack[$this->yyidx + -2]->minor),array('key'=>$this->yystack[$this->yyidx + -5]->minor)))); }
+#line 2407 "smarty_internal_templateparser.php"
+#line 294 "smarty_internal_templateparser.y"
+ function yy_r56(){ $this->_retvalue = SMARTY_INTERNAL_COMPILE_BLOCK::compileChildBlock($this->compiler); }
+#line 2410 "smarty_internal_templateparser.php"
+#line 298 "smarty_internal_templateparser.y"
+ function yy_r57(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor.'close',array()); }
+#line 2413 "smarty_internal_templateparser.php"
+#line 300 "smarty_internal_templateparser.y"
+ function yy_r58(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor.'close',array(),array('modifier_list'=>$this->yystack[$this->yyidx + -1]->minor));
+ }
+#line 2417 "smarty_internal_templateparser.php"
+#line 303 "smarty_internal_templateparser.y"
+ function yy_r59(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor.'close',array(),array('object_methode'=>$this->yystack[$this->yyidx + -1]->minor)); }
+#line 2420 "smarty_internal_templateparser.php"
+#line 304 "smarty_internal_templateparser.y"
+ function yy_r60(){ $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor.'close',array(),array('object_methode'=>$this->yystack[$this->yyidx + -2]->minor, 'modifier_list'=>$this->yystack[$this->yyidx + -1]->minor)); }
+#line 2423 "smarty_internal_templateparser.php"
+#line 310 "smarty_internal_templateparser.y"
+ function yy_r61(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; $this->_retvalue[] = $this->yystack[$this->yyidx + 0]->minor; }
+#line 2426 "smarty_internal_templateparser.php"
+#line 312 "smarty_internal_templateparser.y"
+ function yy_r62(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); }
+#line 2429 "smarty_internal_templateparser.php"
+#line 314 "smarty_internal_templateparser.y"
+ function yy_r63(){ $this->_retvalue = array(); }
+#line 2432 "smarty_internal_templateparser.php"
+#line 317 "smarty_internal_templateparser.y"
+ function yy_r64(){ if (preg_match('~^true$~i', $this->yystack[$this->yyidx + 0]->minor)) {
+ $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'true');
+ } elseif (preg_match('~^false$~i', $this->yystack[$this->yyidx + 0]->minor)) {
+ $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'false');
+ } elseif (preg_match('~^null$~i', $this->yystack[$this->yyidx + 0]->minor)) {
+ $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'null');
+ } else
+ $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>"'".$this->yystack[$this->yyidx + 0]->minor."'"); }
+#line 2442 "smarty_internal_templateparser.php"
+#line 325 "smarty_internal_templateparser.y"
+ function yy_r65(){ $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>$this->yystack[$this->yyidx + 0]->minor); }
+#line 2445 "smarty_internal_templateparser.php"
+#line 327 "smarty_internal_templateparser.y"
+ function yy_r67(){ $this->_retvalue = "'".$this->yystack[$this->yyidx + 0]->minor."'"; }
+#line 2448 "smarty_internal_templateparser.php"
+#line 330 "smarty_internal_templateparser.y"
+ function yy_r70(){$this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>$this->yystack[$this->yyidx + 0]->minor); }
+#line 2451 "smarty_internal_templateparser.php"
+#line 337 "smarty_internal_templateparser.y"
+ function yy_r72(){ $this->yystack[$this->yyidx + -2]->minor[]=$this->yystack[$this->yyidx + 0]->minor; $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor; }
+#line 2454 "smarty_internal_templateparser.php"
+#line 339 "smarty_internal_templateparser.y"
+ function yy_r73(){ $this->_retvalue = array('var' => $this->yystack[$this->yyidx + -2]->minor, 'value'=>$this->yystack[$this->yyidx + 0]->minor); }
+#line 2457 "smarty_internal_templateparser.php"
+#line 341 "smarty_internal_templateparser.y"
+ function yy_r75(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; }
+#line 2460 "smarty_internal_templateparser.php"
+#line 352 "smarty_internal_templateparser.y"
+ function yy_r78(){$this->_retvalue = '$_smarty_tpl->getStreamVariable(\''. $this->yystack[$this->yyidx + -2]->minor .'://'. $this->yystack[$this->yyidx + 0]->minor . '\')'; }
+#line 2463 "smarty_internal_templateparser.php"
+#line 354 "smarty_internal_templateparser.y"
+ function yy_r79(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor . trim($this->yystack[$this->yyidx + -1]->minor) . $this->yystack[$this->yyidx + 0]->minor; }
+#line 2466 "smarty_internal_templateparser.php"
+#line 360 "smarty_internal_templateparser.y"
+ function yy_r82(){$this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }
+#line 2469 "smarty_internal_templateparser.php"
+#line 363 "smarty_internal_templateparser.y"
+ function yy_r83(){ $this->_retvalue = $this->compiler->compileTag('private_modifier',array(),array('value'=>$this->yystack[$this->yyidx + -1]->minor,'modifierlist'=>$this->yystack[$this->yyidx + 0]->minor)); }
+#line 2472 "smarty_internal_templateparser.php"
+#line 367 "smarty_internal_templateparser.y"
+ function yy_r84(){$this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
+#line 2475 "smarty_internal_templateparser.php"
+#line 368 "smarty_internal_templateparser.y"
+ function yy_r85(){$this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor.')'; }
+#line 2478 "smarty_internal_templateparser.php"
+#line 369 "smarty_internal_templateparser.y"
+ function yy_r86(){$this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.',(array)'.$this->yystack[$this->yyidx + 0]->minor.')'; }
+#line 2481 "smarty_internal_templateparser.php"
+#line 371 "smarty_internal_templateparser.y"
+ function yy_r88(){$this->_retvalue = '!('.$this->yystack[$this->yyidx + -2]->minor.' % '.$this->yystack[$this->yyidx + 0]->minor.')'; }
+#line 2484 "smarty_internal_templateparser.php"
+#line 372 "smarty_internal_templateparser.y"
+ function yy_r89(){$this->_retvalue = '('.$this->yystack[$this->yyidx + -2]->minor.' % '.$this->yystack[$this->yyidx + 0]->minor.')'; }
+#line 2487 "smarty_internal_templateparser.php"
+#line 373 "smarty_internal_templateparser.y"
+ function yy_r90(){$this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; }
+#line 2490 "smarty_internal_templateparser.php"
+#line 374 "smarty_internal_templateparser.y"
+ function yy_r91(){$this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -1]->minor.')'; }
+#line 2493 "smarty_internal_templateparser.php"
+#line 375 "smarty_internal_templateparser.y"
+ function yy_r92(){$this->_retvalue = '!(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')'; }
+#line 2496 "smarty_internal_templateparser.php"
+#line 376 "smarty_internal_templateparser.y"
+ function yy_r93(){$this->_retvalue = '(1 & '.$this->yystack[$this->yyidx + -2]->minor.' / '.$this->yystack[$this->yyidx + 0]->minor.')'; }
+#line 2499 "smarty_internal_templateparser.php"
+#line 382 "smarty_internal_templateparser.y"
+ function yy_r99(){$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 2502 "smarty_internal_templateparser.php"
+#line 388 "smarty_internal_templateparser.y"
+ function yy_r100(){ $this->_retvalue = $this->yystack[$this->yyidx + -6]->minor.' ? $_smarty_tpl->getVariable(\''. $this->yystack[$this->yyidx + -2]->minor .'\')->value : '.$this->yystack[$this->yyidx + 0]->minor; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable('$this->yystack[$this->yyidx + -2]->minor', null, true, false)->nocache; }
+#line 2505 "smarty_internal_templateparser.php"
+#line 389 "smarty_internal_templateparser.y"
+ function yy_r101(){ $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; }
+#line 2508 "smarty_internal_templateparser.php"
+#line 396 "smarty_internal_templateparser.y"
+ function yy_r104(){ $this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; }
+#line 2511 "smarty_internal_templateparser.php"
+#line 402 "smarty_internal_templateparser.y"
+ function yy_r109(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; }
+#line 2514 "smarty_internal_templateparser.php"
+#line 403 "smarty_internal_templateparser.y"
+ function yy_r110(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'; }
+#line 2517 "smarty_internal_templateparser.php"
+#line 404 "smarty_internal_templateparser.y"
+ function yy_r111(){ $this->_retvalue = '.'.$this->yystack[$this->yyidx + 0]->minor; }
+#line 2520 "smarty_internal_templateparser.php"
+#line 406 "smarty_internal_templateparser.y"
+ function yy_r112(){ if (preg_match('~^true$~i', $this->yystack[$this->yyidx + 0]->minor)) {
+ $this->_retvalue = 'true';
+ } elseif (preg_match('~^false$~i', $this->yystack[$this->yyidx + 0]->minor)) {
+ $this->_retvalue = 'false';
+ } elseif (preg_match('~^null$~i', $this->yystack[$this->yyidx + 0]->minor)) {
+ $this->_retvalue = 'null';
+ } else
+ $this->_retvalue = "'".$this->yystack[$this->yyidx + 0]->minor."'"; }
+#line 2530 "smarty_internal_templateparser.php"
+#line 417 "smarty_internal_templateparser.y"
+ function yy_r114(){ $this->_retvalue = "(". $this->yystack[$this->yyidx + -1]->minor .")"; }
+#line 2533 "smarty_internal_templateparser.php"
+#line 423 "smarty_internal_templateparser.y"
+ function yy_r117(){if (!$this->security || isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor]) || $this->smarty->security_policy->isTrustedStaticClass($this->yystack[$this->yyidx + -2]->minor, $this->compiler)) {
+ if (isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor])) {
+ $this->_retvalue = $this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor].'::'.$this->yystack[$this->yyidx + 0]->minor;
+ } else {
+ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor;
+ }
+ } else {
+ $this->compiler->trigger_template_error ("static class '".$this->yystack[$this->yyidx + -2]->minor."' is undefined or not allowed by security setting");
+ }
+ }
+#line 2545 "smarty_internal_templateparser.php"
+#line 433 "smarty_internal_templateparser.y"
+ function yy_r118(){ if ($this->yystack[$this->yyidx + -2]->minor['var'] == '\'smarty\'') { $this->_retvalue = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + -2]->minor['smarty_internal_index']).'::'.$this->yystack[$this->yyidx + 0]->minor;} else {
+ $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -2]->minor['var'] .')->value'.$this->yystack[$this->yyidx + -2]->minor['smarty_internal_index'].'::'.$this->yystack[$this->yyidx + 0]->minor; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -2]->minor['var'],"'"), null, true, false)->nocache;} }
+#line 2549 "smarty_internal_templateparser.php"
+#line 436 "smarty_internal_templateparser.y"
+ function yy_r119(){ $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 2552 "smarty_internal_templateparser.php"
+#line 446 "smarty_internal_templateparser.y"
+ function yy_r121(){if ($this->yystack[$this->yyidx + 0]->minor['var'] == '\'smarty\'') {
+ $smarty_var = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']);
+ $this->_retvalue = $smarty_var;
+ } else {
+ // used for array reset,next,prev,end,current
+ $this->last_variable = $this->yystack[$this->yyidx + 0]->minor['var'];
+ $this->last_index = $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index'];
+ if (isset($this->compiler->local_var[$this->yystack[$this->yyidx + 0]->minor['var']])) {
+ $this->_retvalue = '$_smarty_tpl->tpl_vars['. $this->yystack[$this->yyidx + 0]->minor['var'] .']->value'.$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index'];
+ } else {
+ $this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + 0]->minor['var'] .')->value'.$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index'];
+ }
+ $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + 0]->minor['var'],"'"), null, true, false)->nocache;
+ }
+ }
+#line 2569 "smarty_internal_templateparser.php"
+#line 462 "smarty_internal_templateparser.y"
+ function yy_r122(){if (isset($this->compiler->local_var[$this->yystack[$this->yyidx + -2]->minor])) {
+ $this->_retvalue = '$_smarty_tpl->tpl_vars['. $this->yystack[$this->yyidx + -2]->minor .']->'.$this->yystack[$this->yyidx + 0]->minor;
+ } else {
+ $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,"'"), null, true, false)->nocache; }
+#line 2577 "smarty_internal_templateparser.php"
+#line 471 "smarty_internal_templateparser.y"
+ function yy_r124(){$this->_retvalue = '$_smarty_tpl->getConfigVariable(\''. $this->yystack[$this->yyidx + -1]->minor .'\')'; }
+#line 2580 "smarty_internal_templateparser.php"
+#line 472 "smarty_internal_templateparser.y"
+ function yy_r125(){$this->_retvalue = '$_smarty_tpl->getConfigVariable('. $this->yystack[$this->yyidx + -1]->minor .')'; }
+#line 2583 "smarty_internal_templateparser.php"
+#line 475 "smarty_internal_templateparser.y"
+ function yy_r126(){$this->_retvalue = array('var'=>$this->yystack[$this->yyidx + -1]->minor, 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); }
+#line 2586 "smarty_internal_templateparser.php"
+#line 481 "smarty_internal_templateparser.y"
+ function yy_r127(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
+#line 2589 "smarty_internal_templateparser.php"
+#line 483 "smarty_internal_templateparser.y"
+ function yy_r128(){return; }
+#line 2592 "smarty_internal_templateparser.php"
+#line 487 "smarty_internal_templateparser.y"
+ function yy_r129(){ $this->_retvalue = '[$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + 0]->minor .')->value]'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable('$this->yystack[$this->yyidx + 0]->minor', null, true, false)->nocache; }
+#line 2595 "smarty_internal_templateparser.php"
+#line 488 "smarty_internal_templateparser.y"
+ function yy_r130(){ $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,"'"), null, true, false)->nocache; }
+#line 2598 "smarty_internal_templateparser.php"
+#line 489 "smarty_internal_templateparser.y"
+ function yy_r131(){ $this->_retvalue = "['". $this->yystack[$this->yyidx + 0]->minor ."']"; }
+#line 2601 "smarty_internal_templateparser.php"
+#line 490 "smarty_internal_templateparser.y"
+ function yy_r132(){ $this->_retvalue = "[". $this->yystack[$this->yyidx + 0]->minor ."]"; }
+#line 2604 "smarty_internal_templateparser.php"
+#line 491 "smarty_internal_templateparser.y"
+ function yy_r133(){ $this->_retvalue = "[". $this->yystack[$this->yyidx + -1]->minor ."]"; }
+#line 2607 "smarty_internal_templateparser.php"
+#line 493 "smarty_internal_templateparser.y"
+ function yy_r134(){ $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\'][\'index\']').']'; }
+#line 2610 "smarty_internal_templateparser.php"
+#line 494 "smarty_internal_templateparser.y"
+ function yy_r135(){ $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -3]->minor.'\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\']').']'; }
+#line 2613 "smarty_internal_templateparser.php"
+#line 498 "smarty_internal_templateparser.y"
+ function yy_r137(){$this->_retvalue = '[]'; }
+#line 2616 "smarty_internal_templateparser.php"
+#line 506 "smarty_internal_templateparser.y"
+ function yy_r139(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; }
+#line 2619 "smarty_internal_templateparser.php"
+#line 508 "smarty_internal_templateparser.y"
+ function yy_r140(){$this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; }
+#line 2622 "smarty_internal_templateparser.php"
+#line 510 "smarty_internal_templateparser.y"
+ function yy_r141(){$this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')'; }
+#line 2625 "smarty_internal_templateparser.php"
+#line 515 "smarty_internal_templateparser.y"
+ function yy_r142(){ if ($this->yystack[$this->yyidx + -1]->minor['var'] == '\'smarty\'') { $this->_retvalue = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + -1]->minor['smarty_internal_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['smarty_internal_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'],"'"), null, true, false)->nocache;} }
+#line 2629 "smarty_internal_templateparser.php"
+#line 518 "smarty_internal_templateparser.y"
+ function yy_r143(){$this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }
+#line 2632 "smarty_internal_templateparser.php"
+#line 520 "smarty_internal_templateparser.y"
+ function yy_r144(){$this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
+#line 2635 "smarty_internal_templateparser.php"
+#line 522 "smarty_internal_templateparser.y"
+ function yy_r145(){if ($this->security && substr($this->yystack[$this->yyidx + -1]->minor,0,1) == '_') {
+ $this->compiler->trigger_template_error (self::Err1);
+ }
+ $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor;
+ }
+#line 2642 "smarty_internal_templateparser.php"
+#line 527 "smarty_internal_templateparser.y"
+ function yy_r146(){if ($this->security) {
+ $this->compiler->trigger_template_error (self::Err2);
+ }
+ $this->_retvalue = '->{$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -1]->minor .')->value'.$this->yystack[$this->yyidx + 0]->minor.'}'; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -1]->minor,"'"), null, true, false)->nocache;
+ }
+#line 2649 "smarty_internal_templateparser.php"
+#line 532 "smarty_internal_templateparser.y"
+ function yy_r147(){if ($this->security) {
+ $this->compiler->trigger_template_error (self::Err2);
+ }
+ $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}';
+ }
+#line 2656 "smarty_internal_templateparser.php"
+#line 537 "smarty_internal_templateparser.y"
+ function yy_r148(){if ($this->security) {
+ $this->compiler->trigger_template_error (self::Err2);
+ }
+ $this->_retvalue = '->{\''.$this->yystack[$this->yyidx + -4]->minor.'\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}';
+ }
+#line 2663 "smarty_internal_templateparser.php"
+#line 543 "smarty_internal_templateparser.y"
+ function yy_r149(){ $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; }
+#line 2666 "smarty_internal_templateparser.php"
+#line 549 "smarty_internal_templateparser.y"
+ function yy_r150(){if (!$this->security || $this->smarty->security_policy->isTrustedPhpFunction($this->yystack[$this->yyidx + -3]->minor, $this->compiler)) {
+ if (strcasecmp($this->yystack[$this->yyidx + -3]->minor,'isset') === 0 || strcasecmp($this->yystack[$this->yyidx + -3]->minor,'empty') === 0 || strcasecmp($this->yystack[$this->yyidx + -3]->minor,'array') === 0 || is_callable($this->yystack[$this->yyidx + -3]->minor)) {
+ $func_name = strtolower($this->yystack[$this->yyidx + -3]->minor);
+ if ($func_name == 'isset') {
+ if (count($this->yystack[$this->yyidx + -1]->minor) == 0) {
+ $this->compiler->trigger_template_error ('Illegal number of paramer in "isset()"');
+ }
+ $isset_par=str_replace("')->value","',null,true,false)->value",implode(',',$this->yystack[$this->yyidx + -1]->minor));
+ $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". $isset_par .")";
+ } elseif (in_array($func_name,array('empty','reset','current','end','prev','next'))){
+ if (count($this->yystack[$this->yyidx + -1]->minor) != 1) {
+ $this->compiler->trigger_template_error ('Illegal number of paramer in "empty()"');
+ }
+ if ($func_name == 'empty') {
+ $this->_retvalue = $func_name.'('.str_replace("')->value","',null,true,false)->value",$this->yystack[$this->yyidx + -1]->minor[0]).')';
+ } else {
+ $this->_retvalue = $func_name.'('.$this->yystack[$this->yyidx + -1]->minor[0].')';
+ }
+ } else {
+ $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". implode(',',$this->yystack[$this->yyidx + -1]->minor) .")";
+ }
+ } else {
+ $this->compiler->trigger_template_error ("unknown function \"" . $this->yystack[$this->yyidx + -3]->minor . "\"");
+ }
+ }
+ }
+#line 2694 "smarty_internal_templateparser.php"
+#line 579 "smarty_internal_templateparser.y"
+ function yy_r151(){if ($this->security && substr($this->yystack[$this->yyidx + -3]->minor,0,1) == '_') {
+ $this->compiler->trigger_template_error (self::Err1);
+ }
+ $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". implode(',',$this->yystack[$this->yyidx + -1]->minor) .")";
+ }
+#line 2701 "smarty_internal_templateparser.php"
+#line 584 "smarty_internal_templateparser.y"
+ function yy_r152(){if ($this->security) {
+ $this->compiler->trigger_template_error (self::Err2);
+ }
+ $this->prefix_number++; $this->compiler->prefix_code[] = '<?php $_tmp'.$this->prefix_number.'=$_smarty_tpl->getVariable(\''. $this->yystack[$this->yyidx + -3]->minor .'\')->value;?>'; $this->_retvalue = '$_tmp'.$this->prefix_number.'('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')';
+ }
+#line 2708 "smarty_internal_templateparser.php"
+#line 592 "smarty_internal_templateparser.y"
+ function yy_r153(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array($this->yystack[$this->yyidx + 0]->minor)); }
+#line 2711 "smarty_internal_templateparser.php"
+#line 601 "smarty_internal_templateparser.y"
+ function yy_r156(){$this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor))); }
+#line 2714 "smarty_internal_templateparser.php"
+#line 602 "smarty_internal_templateparser.y"
+ function yy_r157(){$this->_retvalue = array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor)); }
+#line 2717 "smarty_internal_templateparser.php"
+#line 605 "smarty_internal_templateparser.y"
+ function yy_r159(){ $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); }
+#line 2720 "smarty_internal_templateparser.php"
+#line 610 "smarty_internal_templateparser.y"
+ function yy_r160(){ $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); }
+#line 2723 "smarty_internal_templateparser.php"
+#line 612 "smarty_internal_templateparser.y"
+ function yy_r161(){$this->_retvalue = array(); }
+#line 2726 "smarty_internal_templateparser.php"
+#line 614 "smarty_internal_templateparser.y"
+ function yy_r162(){$this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); }
+#line 2729 "smarty_internal_templateparser.php"
+#line 624 "smarty_internal_templateparser.y"
+ function yy_r167(){ $this->_retvalue = '$'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
+#line 2732 "smarty_internal_templateparser.php"
+#line 626 "smarty_internal_templateparser.y"
+ function yy_r168(){ $this->_retvalue = '$'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; }
+#line 2735 "smarty_internal_templateparser.php"
+#line 635 "smarty_internal_templateparser.y"
+ function yy_r169(){$this->_retvalue = '=='; }
+#line 2738 "smarty_internal_templateparser.php"
+#line 636 "smarty_internal_templateparser.y"
+ function yy_r170(){$this->_retvalue = '!='; }
+#line 2741 "smarty_internal_templateparser.php"
+#line 637 "smarty_internal_templateparser.y"
+ function yy_r171(){$this->_retvalue = '>'; }
+#line 2744 "smarty_internal_templateparser.php"
+#line 638 "smarty_internal_templateparser.y"
+ function yy_r172(){$this->_retvalue = '<'; }
+#line 2747 "smarty_internal_templateparser.php"
+#line 639 "smarty_internal_templateparser.y"
+ function yy_r173(){$this->_retvalue = '>='; }
+#line 2750 "smarty_internal_templateparser.php"
+#line 640 "smarty_internal_templateparser.y"
+ function yy_r174(){$this->_retvalue = '<='; }
+#line 2753 "smarty_internal_templateparser.php"
+#line 641 "smarty_internal_templateparser.y"
+ function yy_r175(){$this->_retvalue = '==='; }
+#line 2756 "smarty_internal_templateparser.php"
+#line 642 "smarty_internal_templateparser.y"
+ function yy_r176(){$this->_retvalue = '!=='; }
+#line 2759 "smarty_internal_templateparser.php"
+#line 643 "smarty_internal_templateparser.y"
+ function yy_r177(){$this->_retvalue = '%'; }
+#line 2762 "smarty_internal_templateparser.php"
+#line 645 "smarty_internal_templateparser.y"
+ function yy_r178(){$this->_retvalue = '&&'; }
+#line 2765 "smarty_internal_templateparser.php"
+#line 646 "smarty_internal_templateparser.y"
+ function yy_r179(){$this->_retvalue = '||'; }
+#line 2768 "smarty_internal_templateparser.php"
+#line 647 "smarty_internal_templateparser.y"
+ function yy_r180(){$this->_retvalue = ' XOR '; }
+#line 2771 "smarty_internal_templateparser.php"
+#line 652 "smarty_internal_templateparser.y"
+ function yy_r181(){ $this->_retvalue = 'array('.$this->yystack[$this->yyidx + -1]->minor.')'; }
+#line 2774 "smarty_internal_templateparser.php"
+#line 654 "smarty_internal_templateparser.y"
+ function yy_r183(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor; }
+#line 2777 "smarty_internal_templateparser.php"
+#line 655 "smarty_internal_templateparser.y"
+ function yy_r184(){ return; }
+#line 2780 "smarty_internal_templateparser.php"
+#line 656 "smarty_internal_templateparser.y"
+ function yy_r185(){ $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor; }
+#line 2783 "smarty_internal_templateparser.php"
+#line 657 "smarty_internal_templateparser.y"
+ function yy_r186(){ $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor; }
+#line 2786 "smarty_internal_templateparser.php"
+#line 664 "smarty_internal_templateparser.y"
+ function yy_r188(){ $this->_retvalue = "''"; }
+#line 2789 "smarty_internal_templateparser.php"
+#line 665 "smarty_internal_templateparser.y"
+ function yy_r189(){ $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor->to_smarty_php(); }
+#line 2792 "smarty_internal_templateparser.php"
+#line 667 "smarty_internal_templateparser.y"
+ function yy_r190(){ $this->yystack[$this->yyidx + -1]->minor->append_subtree($this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; }
+#line 2795 "smarty_internal_templateparser.php"
+#line 668 "smarty_internal_templateparser.y"
+ function yy_r191(){ $this->_retvalue = new _smarty_doublequoted($this, $this->yystack[$this->yyidx + 0]->minor); }
+#line 2798 "smarty_internal_templateparser.php"
+#line 670 "smarty_internal_templateparser.y"
+ function yy_r192(){ $this->_retvalue = new _smarty_code($this, $this->yystack[$this->yyidx + -1]->minor); }
+#line 2801 "smarty_internal_templateparser.php"
+#line 672 "smarty_internal_templateparser.y"
+ function yy_r194(){if (isset($this->compiler->local_var["'".substr($this->yystack[$this->yyidx + 0]->minor,1)."'"])) {
+ $this->_retvalue = new _smarty_code($this, '$_smarty_tpl->tpl_vars[\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\']->value');
+ } else {
+ $this->_retvalue = new _smarty_code($this, '$_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,"'"), null, true, false)->nocache;
+ }
+#line 2810 "smarty_internal_templateparser.php"
+#line 680 "smarty_internal_templateparser.y"
+ function yy_r196(){ $this->_retvalue = new _smarty_code($this, '('.$this->yystack[$this->yyidx + -1]->minor.')'); }
+#line 2813 "smarty_internal_templateparser.php"
+#line 681 "smarty_internal_templateparser.y"
+ function yy_r197(){
+ $this->_retvalue = new _smarty_tag($this, $this->yystack[$this->yyidx + 0]->minor);
+ }
+#line 2818 "smarty_internal_templateparser.php"
+#line 684 "smarty_internal_templateparser.y"
+ function yy_r198(){ $this->_retvalue = new _smarty_dq_content($this, $this->yystack[$this->yyidx + 0]->minor); }
+#line 2821 "smarty_internal_templateparser.php"
+#line 691 "smarty_internal_templateparser.y"
+ function yy_r200(){$this->_retvalue = ''; }
+#line 2824 "smarty_internal_templateparser.php"
+
+ private $_retvalue;
+
+ function yy_reduce($yyruleno)
+ {
+ $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 (!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();
+ }
+ }
+
+ function yy_parse_failed()
+ {
+ if (self::$yyTraceFILE) {
+ fprintf(self::$yyTraceFILE, "%sFail!\n", self::$yyTracePrompt);
+ }
+ while ($this->yyidx >= 0) {
+ $this->yy_pop_parser_stack();
+ }
+ }
+
+ function yy_syntax_error($yymajor, $TOKEN)
+ {
+#line 66 "smarty_internal_templateparser.y"
+
+ $this->internalError = true;
+ $this->yymajor = $yymajor;
+ $this->compiler->trigger_template_error();
+#line 2887 "smarty_internal_templateparser.php"
+ }
+
+ function yy_accept()
+ {
+ if (self::$yyTraceFILE) {
+ fprintf(self::$yyTraceFILE, "%sAccept!\n", self::$yyTracePrompt);
+ }
+ while ($this->yyidx >= 0) {
+ $stack = $this->yy_pop_parser_stack();
+ }
+#line 58 "smarty_internal_templateparser.y"
+
+ $this->successful = !$this->internalError;
+ $this->internalError = false;
+ $this->retvalue = $this->_retvalue;
+ //echo $this->retvalue."\n\n";
+#line 2905 "smarty_internal_templateparser.php"
+ }
+
+ function doParse($yymajor, $yytokenvalue)
+ {
+ $yyerrorhit = 0; /* True if yymajor has invoked an error */
+
+ if ($this->yyidx === null || $this->yyidx < 0) {
+ $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) {
+ 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 {
+ 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);
+ }
+}
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_utility.php b/gosa-core/include/smarty/sysplugins/smarty_internal_utility.php
--- /dev/null
@@ -0,0 +1,300 @@
+<?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 $
+ */
+
+class Smarty_Internal_Utility {
+ protected $smarty;
+
+ function __construct($smarty)
+ {
+ $this->smarty = $smarty;
+ }
+
+ /**
+ * Compile all template files
+ *
+ * @param string $extension file extension
+ * @param bool $force_compile force all to recompile
+ * @param int $time_limit
+ * @param int $max_errors
+ * @return integer number of template files recompiled
+ */
+ function compileAllTemplates($extention = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null)
+ {
+ // switch off time limit
+ if (function_exists('set_time_limit')) {
+ @set_time_limit($time_limit);
+ }
+ $this->smarty->force_compile = $force_compile;
+ $_count = 0;
+ $_error_count = 0;
+ // loop over array of template directories
+ foreach((array)$this->smarty->template_dir as $_dir) {
+ if (strpos('/\\', substr($_dir, -1)) === false) {
+ $_dir .= DS;
+ }
+ $_compileDirs = new RecursiveDirectoryIterator($_dir);
+ $_compile = new RecursiveIteratorIterator($_compileDirs);
+ foreach ($_compile as $_fileinfo) {
+ if (substr($_fileinfo->getBasename(),0,1) == '.') 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 = $this->smarty->createTemplate($_template_file,null,null,null,false);
+ if ($_tpl->mustCompile()) {
+ $_tpl->compileTemplateSource();
+ 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
+ $this->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 file extension
+ * @param bool $force_compile force all to recompile
+ * @param int $time_limit
+ * @param int $max_errors
+ * @return integer number of template files recompiled
+ */
+ function compileAllConfig($extention = '.conf', $force_compile = false, $time_limit = 0, $max_errors = null)
+ {
+ // switch off time limit
+ if (function_exists('set_time_limit')) {
+ @set_time_limit($time_limit);
+ }
+ $this->smarty->force_compile = $force_compile;
+ $_count = 0;
+ $_error_count = 0;
+ // loop over array of template directories
+ foreach((array)$this->smarty->config_dir as $_dir) {
+ if (strpos('/\\', substr($_dir, -1)) === false) {
+ $_dir .= DS;
+ }
+ $_compileDirs = new RecursiveDirectoryIterator($_dir);
+ $_compile = new RecursiveIteratorIterator($_compileDirs);
+ foreach ($_compile as $_fileinfo) {
+ if (substr($_fileinfo->getBasename(),0,1) == '.') 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, $this->smarty);
+ if ($_config->mustCompile()) {
+ $_config->compileConfigSource();
+ 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
+ * @return integer number of template files deleted
+ */
+ function clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = 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_1 = $resource_name . '.php';
+ $_resource_part_2 = $resource_name . '.cache' . '.php';
+ } else {
+ $_resource_part = '';
+ }
+ $_dir = $this->smarty->compile_dir;
+ if ($this->smarty->use_sub_dirs && isset($_compile_id)) {
+ $_dir .= $_compile_id . $_dir_sep;
+ }
+ if (isset($_compile_id)) {
+ $_compile_id_part = $this->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 (substr($_file->getBasename(),0,1) == '.') continue;
+ if ($_file->isDir()) {
+ if (!$_compile->isDot()) {
+ // delete folder if empty
+ @rmdir($_file->getPathname());
+ }
+ } else {
+ if ((!isset($_compile_id) || (strlen((string)$_file) > strlen($_compile_id_part) && substr_compare((string)$_file, $_compile_id_part, 0, strlen($_compile_id_part)) == 0)) &&
+ (!isset($resource_name) || (strlen((string)$_file) > strlen($_resource_part_1) && substr_compare((string)$_file, $_resource_part_1, - strlen($_resource_part_1), strlen($_resource_part_1)) == 0) ||
+ (strlen((string)$_file) > strlen($_resource_part_2) && 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;
+ }
+
+ /**
+ * Return array of tag/attributes of all tags used by an template
+ *
+ * @param object $templae template object
+ * @return array of tag/attributes
+ */
+ function getTags(Smarty_Internal_Template $template)
+ {
+ $template->smarty->get_used_tags = true;
+ $template->compileTemplateSource();
+ return $template->compiler_object->used_tags;
+ }
+
+ function testInstall()
+ {
+ echo "<PRE>\n";
+
+ echo "Smarty Installation test...\n";
+
+ echo "Testing template directory...\n";
+
+ foreach((array)$this->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($this->smarty->compile_dir))
+ echo "FAILED: {$this->smarty->compile_dir} is not a directory.\n";
+ elseif (!is_readable($this->smarty->compile_dir))
+ echo "FAILED: {$this->smarty->compile_dir} is not readable.\n";
+ elseif (!is_writable($this->smarty->compile_dir))
+ echo "FAILED: {$this->smarty->compile_dir} is not writable.\n";
+ else
+ echo "{$this->smarty->compile_dir} is OK.\n";
+
+ echo "Testing plugins directory...\n";
+
+ foreach((array)$this->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($this->smarty->cache_dir))
+ echo "FAILED: {$this->smarty->cache_dir} is not a directory.\n";
+ elseif (!is_readable($this->smarty->cache_dir))
+ echo "FAILED: {$this->smarty->cache_dir} is not readable.\n";
+ elseif (!is_writable($this->smarty->cache_dir))
+ echo "FAILED: {$this->smarty->cache_dir} is not writable.\n";
+ else
+ echo "{$this->smarty->cache_dir} is OK.\n";
+
+ echo "Testing configs directory...\n";
+
+ if (!is_dir($this->smarty->config_dir))
+ echo "FAILED: {$this->smarty->config_dir} is not a directory.\n";
+ elseif (!is_readable($this->smarty->config_dir))
+ echo "FAILED: {$this->smarty->config_dir} is not readable.\n";
+ else
+ echo "{$this->smarty->config_dir} is OK.\n";
+
+ echo "Tests complete.\n";
+
+ echo "</PRE>\n";
+
+ return true;
+ }
+}
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_wrapper.php b/gosa-core/include/smarty/sysplugins/smarty_internal_wrapper.php
--- /dev/null
@@ -0,0 +1,131 @@
+<?php
+
+/**
+ * Project: Smarty: the PHP compiling template engine
+ * File: smarty_internal_wrapper.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 $
+ */
+
+/*
+ * Smarty Backward Compatability Wrapper
+ */
+
+class Smarty_Internal_Wrapper {
+
+ protected $smarty;
+
+ function __construct($smarty) {
+ $this->smarty = $smarty;
+ }
+
+ /**
+ * Converts smarty2-style function call to smarty 3-style function call
+ * This is expensive, be sure to port your code to Smarty 3!
+ *
+ * @param string $name Smarty 2 function name
+ * @param array $args Smarty 2 function args
+ */
+ function convert($name, $args) {
+ // throw notice about deprecated function
+ if($this->smarty->deprecation_notices)
+ trigger_error("function call '$name' is unknown or deprecated.",E_USER_NOTICE);
+ // get first and last part of function name
+ $name_parts = explode('_',$name,2);
+ switch($name_parts[0]) {
+ case 'register':
+ case 'unregister':
+ switch($name_parts[1]) {
+ case 'object':
+ return call_user_func_array(array($this->smarty,"{$name_parts[0]}Object"),$args);
+ case 'compiler_function':
+ return call_user_func_array(array($this->smarty,"{$name_parts[0]}Plugin"),array_merge(array('compiler'),$args));
+ case 'prefilter':
+ return call_user_func_array(array($this->smarty,"{$name_parts[0]}Filter"),array_merge(array('pre'),$args));
+ case 'postfilter':
+ return call_user_func_array(array($this->smarty,"{$name_parts[0]}Filter"),array_merge(array('post'),$args));
+ case 'outputfilter':
+ return call_user_func_array(array($this->smarty,"{$name_parts[0]}Filter"),array_merge(array('output'),$args));
+ case 'resource':
+ return call_user_func_array(array($this->smarty,"{$name_parts[0]}Resource"),$args);
+ default:
+ return call_user_func_array(array($this->smarty,"{$name_parts[0]}Plugin"),array_merge(array($name_parts[1]),$args));
+ }
+ case 'get':
+ switch($name_parts[1]) {
+ case 'template_vars':
+ return call_user_func_array(array($this->smarty,'getTemplateVars'),$args);
+ case 'config_vars':
+ return call_user_func_array(array($this->smarty,'getConfigVars'),$args);
+ default:
+ return call_user_func_array(array($myobj,$name_parts[1]),$args);
+ }
+ case 'clear':
+ switch($name_parts[1]) {
+ case 'all_assign':
+ return call_user_func_array(array($this->smarty,'clearAllAssign'),$args);
+ case 'assign':
+ return call_user_func_array(array($this->smarty,'clearAssign'),$args);
+ case 'all_cache':
+ return call_user_func_array(array($this->smarty,'clearAllCache'),$args);
+ case 'cache':
+ return call_user_func_array(array($this->smarty,'clearCache'),$args);
+ case 'compiled_template':
+ return call_user_func_array(array($this->smarty,'clearCompiledTemplate'),$args);
+ }
+ case 'config':
+ switch($name_parts[1]) {
+ case 'load':
+ return call_user_func_array(array($this->smarty,'configLoad'),$args);
+ }
+ case 'trigger':
+ switch($name_parts[1]) {
+ case 'error':
+ return call_user_func_array('trigger_error',$args);
+ }
+ case 'load':
+ switch($name_parts[1]) {
+ case 'filter':
+ return call_user_func_array(array($this->smarty,'loadFilter'),$args);
+ }
+ }
+ throw new SmartyException("unknown method '$name'");
+ }
+
+ /**
+ * trigger Smarty error
+ *
+ * @param string $error_msg
+ * @param integer $error_type
+ */
+ function trigger_error($error_msg, $error_type = E_USER_WARNING)
+ {
+ trigger_error("Smarty error: $error_msg", $error_type);
+ }
+}
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_internal_write_file.php b/gosa-core/include/smarty/sysplugins/smarty_internal_write_file.php
index 5c756f1bdd62c7d8a2ca547a3877276133359e35..4e34335fbebec92d371bb765c81d8df86b95e474 100644 (file)
<?php
/**
-* Smarty write file plugin
-*
-* @package Smarty
-* @subpackage PluginsInternal
-* @author Monte Ohrt
-*/
+ * Smarty write file plugin
+ *
+ * @package Smarty
+ * @subpackage PluginsInternal
+ * @author Monte Ohrt
+ */
+
/**
-* Smarty Internal Write File Class
-*/
+ * 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
- */
+ * 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);
// 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}");
+ if (!($fd = @fopen($_tmp_file, 'wb'))) {
+ $_tmp_file = $_dirpath . DS . uniqid('wrt');
+ if (!($fd = @fopen($_tmp_file, 'wb'))) {
+ throw new SmartyException("unable to write file {$_tmp_file}");
return false;
- }
+ }
+ }
+
+ fwrite($fd, $_contents);
+ fclose($fd);
+
// remove original file
if (file_exists($_filepath))
@unlink($_filepath);
}
}
-?>
+?>
\ No newline at end of file
diff --git a/gosa-core/include/smarty/sysplugins/smarty_security.php b/gosa-core/include/smarty/sysplugins/smarty_security.php
index 2c99fbc36437962e59251055c866add4116bc43c..cd066fb4e85a569728a3f9df10f6cff1b1e08343 100644 (file)
<?php
/**
-* Smarty plugin
-*
-* @package Smarty
-* @subpackage Security
-* @author Uwe Tews
-*/
+ * Smarty plugin
+ *
+ * @package Smarty
+ * @subpackage Security
+ * @author Uwe Tews
+ */
/**
-* This class does contain the security settings
-*/
+ * 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 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
- */
+ * This is the list of template directories that are considered secure.
+ * $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
- */
+ * 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
- */
+ * This is an array of trusted static classes.
+ *
+ * If empty access to all static classes is allowed.
+ * If set to 'none' none is allowed.
+ * @var array
+ */
+ public $static_classes = array();
+
+ /**
+ * This is an array of trusted PHP functions.
+ *
+ * If empty all functions are allowed.
+ * To disable all PHP functions set $php_functions = null.
+ * @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 PHP modifers.
+ *
+ * If empty all modifiers are allowed.
+ * To disable all modifier set $modifiers = null.
+ * @var array
+ */
+ public $php_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
- */
+ * This is an array of trusted streams.
+ *
+ * If empty all streams are allowed.
+ * To disable all streams set $streams = null.
+ * @var array
+ */
public $streams = array('file');
/**
- + flag if constants can be accessed from template
- */
+ * + flag if constants can be accessed from template
+ */
public $allow_constants = true;
/**
- + flag if super globals can be accessed from template
- */
+ * + flag if super globals can be accessed from template
+ */
public $allow_super_globals = true;
/**
- + flag if {php} tag can be executed
- */
+ * + flag if the {php} and {include_php} tag can be executed
+ */
public $allow_php_tag = false;
+
+ public 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 (isset($this->php_functions) && (empty($this->php_functions) || in_array($function_name, $this->php_functions))) {
+ return true;
+ } else {
+ $compiler->trigger_template_error ("PHP function '{$function_name}' not allowed by security setting");
+ return false;
+ }
+ }
+
+ /**
+ * Check if static class is trusted.
+ *
+ * @param string $class_name
+ * @param object $compiler compiler object
+ * @return boolean true if class is trusted
+ */
+ function isTrustedStaticClass($class_name, $compiler)
+ {
+ if (isset($this->static_classes) && (empty($this->static_classes) || in_array($class_name, $this->static_classes))) {
+ return true;
+ } else {
+ $compiler->trigger_template_error ("access to static class '{$class_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 (isset($this->php_modifiers) && (empty($this->php_modifiers) || in_array($modifier_name, $this->php_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 (isset($this->streams) && (empty($this->streams) || in_array($stream_name, $this->streams))) {
+ return true;
+ } else {
+ throw new SmartyException ("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 SmartyException ("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->trusted_dir)) {
+ foreach ((array)$this->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 SmartyException ("directory '{$_rp}' not allowed by security setting");
+ return false;
+ }
}
-?>
+?>
\ No newline at end of file