mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
many more phpdoc comment upgrades
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2003-02-15 Greg Beaver <cellog@sourceforge.net>
|
||||
* Smarty.class.php
|
||||
Smarty_Compiler.class.php
|
||||
continue cleaning of phpdoc comments. All that is needed is the
|
||||
addition of @return tags and perhaps a bit more verbose comments
|
||||
and they are finished.
|
||||
|
||||
2003-02-14 Monte Ohrt <monte@ispi.net>
|
||||
|
||||
* NEWS
|
||||
|
204
Smarty.class.php
204
Smarty.class.php
@@ -928,8 +928,8 @@ class Smarty
|
||||
* test to see if valid cache exists for this template
|
||||
*
|
||||
* @param string $tpl_file name of template file
|
||||
* @param $cache_id
|
||||
* @param $compile_id
|
||||
* @param string $cache_id
|
||||
* @param string $compile_id
|
||||
*/
|
||||
function is_cached($tpl_file, $cache_id = null, $compile_id = null)
|
||||
{
|
||||
@@ -957,9 +957,9 @@ class Smarty
|
||||
* or all compiled template files if one is not specified.
|
||||
* This function is for advanced use only, not normally needed.
|
||||
*
|
||||
* @param $tpl_file
|
||||
* @param $compile_id
|
||||
* @param $exp_time
|
||||
* @param string $tpl_file
|
||||
* @param string $compile_id
|
||||
* @param string $exp_time
|
||||
*/
|
||||
function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)
|
||||
{
|
||||
@@ -971,7 +971,7 @@ class Smarty
|
||||
/**
|
||||
* Checks whether requested template exists.
|
||||
*
|
||||
* @param $tpl_file
|
||||
* @param string $tpl_file
|
||||
*/
|
||||
function template_exists($tpl_file)
|
||||
{
|
||||
@@ -981,6 +981,7 @@ class Smarty
|
||||
/**
|
||||
* Returns an array containing template variables
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function &get_template_vars()
|
||||
{
|
||||
@@ -991,8 +992,8 @@ class Smarty
|
||||
/**
|
||||
* trigger Smarty error
|
||||
*
|
||||
* @param $error_msg
|
||||
* @param $error_type
|
||||
* @param string $error_msg
|
||||
* @param integer $error_type
|
||||
*/
|
||||
function trigger_error($error_msg, $error_type = E_USER_WARNING)
|
||||
{
|
||||
@@ -1003,9 +1004,9 @@ class Smarty
|
||||
/**
|
||||
* executes & displays the template results
|
||||
*
|
||||
* @param $tpl_file
|
||||
* @param $cache_id
|
||||
* @param $compile_id
|
||||
* @param string $tpl_file
|
||||
* @param string $cache_id
|
||||
* @param string $compile_id
|
||||
*/
|
||||
function display($tpl_file, $cache_id = null, $compile_id = null)
|
||||
{
|
||||
@@ -1015,10 +1016,10 @@ class Smarty
|
||||
/**
|
||||
* executes & returns or displays the template results
|
||||
*
|
||||
* @param $_smarty_tpl_file
|
||||
* @param $_smarty_cache_id
|
||||
* @param $_smarty_compile_id
|
||||
* @param $_smarty_display
|
||||
* @param string $_smarty_tpl_file
|
||||
* @param string $_smarty_cache_id
|
||||
* @param string $_smarty_compile_id
|
||||
* @param boolean $_smarty_display
|
||||
*/
|
||||
function fetch($_smarty_tpl_file, $_smarty_cache_id = null, $_smarty_compile_id = null, $_smarty_display = false)
|
||||
{
|
||||
@@ -1152,8 +1153,6 @@ class Smarty
|
||||
|
||||
/**
|
||||
* assign $smarty interface variable
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function _assign_smarty_interface()
|
||||
{
|
||||
@@ -1181,8 +1180,8 @@ class Smarty
|
||||
|
||||
/**
|
||||
* generate debug output
|
||||
*
|
||||
* @access public
|
||||
* @return string debug.tpl template output
|
||||
* @uses $debug_tpl debug template, used to display debugging output
|
||||
*/
|
||||
function _generate_debug_output()
|
||||
{
|
||||
@@ -1228,10 +1227,9 @@ class Smarty
|
||||
/**
|
||||
* load configuration values
|
||||
*
|
||||
* @access public
|
||||
* @param $file
|
||||
* @param $section
|
||||
* @param $scope
|
||||
* @param string $file
|
||||
* @param string $section
|
||||
* @param string $scope
|
||||
*/
|
||||
function config_load($file, $section = null, $scope = 'global')
|
||||
{
|
||||
@@ -1326,8 +1324,8 @@ class Smarty
|
||||
/**
|
||||
* determines if a resource is trusted or not
|
||||
*
|
||||
* @param $resource_type
|
||||
* @param $resource_name
|
||||
* @param string $resource_type
|
||||
* @param string $resource_name
|
||||
*/
|
||||
function _is_trusted($resource_type, $resource_name)
|
||||
{
|
||||
@@ -1361,8 +1359,8 @@ class Smarty
|
||||
/**
|
||||
* determines if a resource is secure or not.
|
||||
*
|
||||
* @param $resource_type
|
||||
* @param $resource_name
|
||||
* @param string $resource_type
|
||||
* @param string $resource_name
|
||||
*/
|
||||
function _is_secure($resource_type, $resource_name)
|
||||
{
|
||||
@@ -1395,8 +1393,9 @@ class Smarty
|
||||
/**
|
||||
* Retrieves PHP script resource
|
||||
*
|
||||
* @param $resource
|
||||
* @param $resource_type
|
||||
* sets $php_resource to the returned resource
|
||||
* @param string $resource
|
||||
* @param string $resource_type
|
||||
* @param $php_resource
|
||||
*/
|
||||
function _get_php_resource($resource, &$resource_type, &$php_resource)
|
||||
@@ -1457,8 +1456,8 @@ class Smarty
|
||||
/**
|
||||
* umm... process the template
|
||||
*
|
||||
* @param $tpl_file
|
||||
* @param $compile_path
|
||||
* @param string $tpl_file
|
||||
* @param string $compile_path
|
||||
*/
|
||||
function _process_template($tpl_file, $compile_path)
|
||||
{
|
||||
@@ -1498,8 +1497,7 @@ class Smarty
|
||||
/**
|
||||
* Get the compile path for this template file
|
||||
*
|
||||
* @access private
|
||||
* @param $tpl_file
|
||||
* @param string $tpl_file
|
||||
*/
|
||||
function _get_compile_path($tpl_file)
|
||||
{
|
||||
@@ -1510,9 +1508,10 @@ class Smarty
|
||||
/**
|
||||
* write the compiled template
|
||||
*
|
||||
* @param $compile_path
|
||||
* @param $template_compiled
|
||||
* @param $template_timestamp
|
||||
* @param string $compile_path
|
||||
* @param string $template_compiled
|
||||
* @param integer $template_timestamp
|
||||
* @return true
|
||||
*/
|
||||
function _write_compiled_template($compile_path, $template_compiled, $template_timestamp)
|
||||
{
|
||||
@@ -1525,10 +1524,10 @@ class Smarty
|
||||
/**
|
||||
* parse out the type and name from the template resource
|
||||
*
|
||||
* @param $file_base_path
|
||||
* @param $file_path
|
||||
* @param $resource_type
|
||||
* @param $resource_name
|
||||
* @param string $file_base_path
|
||||
* @param string $file_path
|
||||
* @param string $resource_type
|
||||
* @param string $resource_name
|
||||
*/
|
||||
function _parse_file_path($file_base_path, $file_path, &$resource_type, &$resource_name)
|
||||
{
|
||||
@@ -1576,11 +1575,13 @@ class Smarty
|
||||
* fetch the template info. Gets timestamp, and source
|
||||
* if get_source is true
|
||||
*
|
||||
* @param $tpl_path
|
||||
* @param $template_source
|
||||
* @param $template_timestamp
|
||||
* @param $get_source
|
||||
* @param $quiet
|
||||
* sets $template_source to the source of the template, and
|
||||
* $template_timestamp to its time stamp
|
||||
* @param string $tpl_path
|
||||
* @param string $template_source
|
||||
* @param integer $template_timestamp
|
||||
* @param boolean $get_source
|
||||
* @param boolean $quiet
|
||||
*/
|
||||
function _fetch_template_info($tpl_path, &$template_source, &$template_timestamp, $get_source = true, $quiet = false)
|
||||
{
|
||||
@@ -1641,9 +1642,10 @@ class Smarty
|
||||
/**
|
||||
* called to compile the templates
|
||||
*
|
||||
* @param $tpl_file
|
||||
* @param $template_source
|
||||
* @param $template_compiled
|
||||
* sets $template_compiled to the compiled template
|
||||
* @param string $tpl_file
|
||||
* @param string $template_source
|
||||
* @param string $template_compiled
|
||||
*/
|
||||
function _compile_template($tpl_file, $template_source, &$template_compiled)
|
||||
{
|
||||
@@ -1686,8 +1688,8 @@ class Smarty
|
||||
/**
|
||||
* called for included templates
|
||||
*
|
||||
* @param $_smarty_include_tpl_file
|
||||
* @param $_smarty_include_vars
|
||||
* @param string $_smarty_include_tpl_file
|
||||
* @param string $_smarty_include_vars
|
||||
*/
|
||||
function _smarty_include($_smarty_include_tpl_file, $_smarty_include_vars)
|
||||
{
|
||||
@@ -1729,9 +1731,12 @@ class Smarty
|
||||
/**
|
||||
* called for included templates
|
||||
*
|
||||
* @param $_smarty_include_php_file
|
||||
* @param $_smarty_assign
|
||||
* @param $_smarty_once
|
||||
* @param string $_smarty_include_php_file
|
||||
* @param string $_smarty_assign variable to assign the included template's
|
||||
* output into
|
||||
* @param boolean $_smarty_once uses include_once if this is true
|
||||
* @param array $_smarty_include_vars associative array of vars from
|
||||
* {include file="blah" var=$var}
|
||||
*/
|
||||
function _smarty_include_php($_smarty_include_php_file, $_smarty_assign, $_smarty_once, $_smarty_include_vars)
|
||||
{
|
||||
@@ -1770,7 +1775,7 @@ class Smarty
|
||||
/**
|
||||
* clear configuration values
|
||||
*
|
||||
* @param $var
|
||||
* @param string $var
|
||||
*/
|
||||
function clear_config($var = null)
|
||||
{
|
||||
@@ -1787,7 +1792,7 @@ class Smarty
|
||||
/**
|
||||
* Replace cached inserts with the actual results
|
||||
*
|
||||
* @param $results
|
||||
* @param string $results
|
||||
*/
|
||||
function _process_cached_inserts($results)
|
||||
{
|
||||
@@ -1837,10 +1842,10 @@ class Smarty
|
||||
/**
|
||||
* Handle insert tags
|
||||
*
|
||||
* @param $args
|
||||
* @param array $args
|
||||
*/
|
||||
function _run_insert_handler($args)
|
||||
{
|
||||
function _run_insert_handler($args)
|
||||
{
|
||||
if ($this->debugging) {
|
||||
$debug_start_time = $this->_get_microtime();
|
||||
}
|
||||
@@ -1885,7 +1890,7 @@ function _run_insert_handler($args)
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -1915,8 +1920,7 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* Remove starting and ending quotes from the string
|
||||
*
|
||||
* @access private
|
||||
* @param $string
|
||||
* @param string $string
|
||||
*/
|
||||
function _dequote($string)
|
||||
{
|
||||
@@ -1932,9 +1936,9 @@ function _run_insert_handler($args)
|
||||
* read in a file from line $start for $lines.
|
||||
* read the entire file if $start and $lines are null.
|
||||
*
|
||||
* @param $filename
|
||||
* @param $start
|
||||
* @param $lines
|
||||
* @param string $filename
|
||||
* @param integer $start
|
||||
* @param integer $lines
|
||||
*/
|
||||
function _read_file($filename, $start=null, $lines=null)
|
||||
{
|
||||
@@ -1974,9 +1978,9 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* write out a file to disk
|
||||
*
|
||||
* @param $filename
|
||||
* @param $contents
|
||||
* @param $create_dirs
|
||||
* @param string $filename
|
||||
* @param string $contents
|
||||
* @param boolean $create_dirs
|
||||
*/
|
||||
function _write_file($filename, $contents, $create_dirs = false)
|
||||
{
|
||||
@@ -2003,9 +2007,9 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* get a concrete filename for automagically created content
|
||||
*
|
||||
* @param $auto_base
|
||||
* @param $auto_source
|
||||
* @param $auto_id
|
||||
* @param string $auto_base
|
||||
* @param string $auto_source
|
||||
* @param string $auto_id
|
||||
*/
|
||||
function _get_auto_filename($auto_base, $auto_source = null, $auto_id = null)
|
||||
{
|
||||
@@ -2057,10 +2061,10 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* delete an automagically created file by name and id
|
||||
*
|
||||
* @param $auto_base
|
||||
* @param $auto_source
|
||||
* @param $auto_id
|
||||
* @param $exp_time
|
||||
* @param string $auto_base
|
||||
* @param string $auto_source
|
||||
* @param string $auto_id
|
||||
* @param integer $exp_time
|
||||
*/
|
||||
function _rm_auto($auto_base, $auto_source = null, $auto_id = null, $exp_time = null)
|
||||
{
|
||||
@@ -2096,9 +2100,9 @@ function _run_insert_handler($args)
|
||||
* delete a dir recursively (level=0 -> keep root)
|
||||
* WARNING: no tests, it will try to remove what you tell it!
|
||||
*
|
||||
* @param $dirname
|
||||
* @param $level
|
||||
* @param $exp_time
|
||||
* @param string $dirname
|
||||
* @param integer $level
|
||||
* @param integer $exp_time
|
||||
*/
|
||||
function _rmdir($dirname, $level = 1, $exp_time = null)
|
||||
{
|
||||
@@ -2131,8 +2135,8 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* unlink a file, possibly using expiration time
|
||||
*
|
||||
* @param $resource
|
||||
* @param $exp_time
|
||||
* @param string $resource
|
||||
* @param integer $exp_time
|
||||
*/
|
||||
function _unlink($resource, $exp_time = null)
|
||||
{
|
||||
@@ -2148,7 +2152,7 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* create full directory structure
|
||||
*
|
||||
* @param $dir
|
||||
* @param string $dir
|
||||
*/
|
||||
function _create_dir_structure($dir)
|
||||
{
|
||||
@@ -2194,10 +2198,10 @@ function _run_insert_handler($args)
|
||||
* Prepend the cache information to the cache file
|
||||
* and write it
|
||||
*
|
||||
* @param $tpl_file
|
||||
* @param $cache_id
|
||||
* @param $compile_id
|
||||
* @param $results
|
||||
* @param string $tpl_file
|
||||
* @param string $cache_id
|
||||
* @param string $compile_id
|
||||
* @param string $results
|
||||
*/
|
||||
function _write_cache_file($tpl_file, $cache_id, $compile_id, $results)
|
||||
{
|
||||
@@ -2238,9 +2242,9 @@ function _run_insert_handler($args)
|
||||
* regenerated or not
|
||||
*
|
||||
* @param string $tpl_file
|
||||
* @param $cache_id
|
||||
* @param $compile_id
|
||||
* @param $results
|
||||
* @param string $cache_id
|
||||
* @param string $compile_id
|
||||
* @param string $results
|
||||
*/
|
||||
function _read_cache_file($tpl_file, $cache_id, $compile_id, &$results)
|
||||
{
|
||||
@@ -2325,8 +2329,8 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* get filepath of requested plugin
|
||||
*
|
||||
* @param $type
|
||||
* @param $name
|
||||
* @param string $type
|
||||
* @param string $name
|
||||
*/
|
||||
function _get_plugin_filepath($type, $name)
|
||||
{
|
||||
@@ -2369,7 +2373,7 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* Load requested plugins
|
||||
*
|
||||
* @param $plugins
|
||||
* @param array $plugins
|
||||
*/
|
||||
function _load_plugins($plugins)
|
||||
{
|
||||
@@ -2480,7 +2484,7 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* load a resource plugin
|
||||
*
|
||||
* @param $type
|
||||
* @param string $type
|
||||
*/
|
||||
function _load_resource_plugin($type)
|
||||
{
|
||||
@@ -2540,7 +2544,6 @@ function _run_insert_handler($args)
|
||||
|
||||
/**
|
||||
* automatically load a set of filters
|
||||
*
|
||||
*/
|
||||
function _autoload_filters()
|
||||
{
|
||||
@@ -2554,7 +2557,7 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* Quote subpattern references
|
||||
*
|
||||
* @param $string
|
||||
* @param string $string
|
||||
*/
|
||||
function quote_replace($string)
|
||||
{
|
||||
@@ -2565,9 +2568,12 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* trigger Smarty plugin error
|
||||
*
|
||||
* @param $error_msg
|
||||
* @param $tpl_file
|
||||
* @param $tpl_line
|
||||
* @param string $error_msg
|
||||
* @param string $tpl_file
|
||||
* @param integer $tpl_line
|
||||
* @param string $file
|
||||
* @param integer $line
|
||||
* @param integer $error_type
|
||||
*/
|
||||
function _trigger_fatal_error($error_msg, $tpl_file = null, $tpl_line = null,
|
||||
$file = null, $line = null, $error_type = E_USER_ERROR)
|
||||
@@ -2587,7 +2593,7 @@ function _run_insert_handler($args)
|
||||
|
||||
/**
|
||||
* Get seconds and microseconds
|
||||
*
|
||||
* @return double
|
||||
*/
|
||||
function _get_microtime()
|
||||
{
|
||||
@@ -2600,8 +2606,8 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* Get path to file from include_path
|
||||
*
|
||||
* @param $file_path
|
||||
* @param $new_file_path
|
||||
* @param string $file_path
|
||||
* @param string $new_file_path
|
||||
*/
|
||||
function _get_include_path($file_path, &$new_file_path)
|
||||
{
|
||||
|
@@ -3,11 +3,6 @@
|
||||
/**
|
||||
* Project: Smarty: the PHP compiling template engine
|
||||
* File: Smarty_Compiler.class.php
|
||||
* Author: Monte Ohrt <monte@ispi.net>
|
||||
* Andrei Zmievski <andrei@php.net>
|
||||
*
|
||||
* Version: 2.4.2
|
||||
* Copyright: 2001,2002 ispi of Lincoln, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -35,12 +30,20 @@
|
||||
*
|
||||
* The latest version of Smarty can be obtained from:
|
||||
* http://www.phpinsider.com/
|
||||
*
|
||||
* @link http://www.phpinsider.com/
|
||||
* @author Monte Ohrt <monte@ispi.net>
|
||||
* @author Andrei Zmievski <andrei@php.net>
|
||||
* @version 2.4.2
|
||||
* @copyright 2001,2002 ispi of Lincoln, Inc.
|
||||
* @package Smarty
|
||||
*/
|
||||
|
||||
class Smarty_Compiler extends Smarty {
|
||||
|
||||
// internal vars
|
||||
/**#@+
|
||||
* @access private
|
||||
*/
|
||||
var $_sectionelse_stack = array(); // keeps track of whether section had 'else' part
|
||||
var $_foreachelse_stack = array(); // keeps track of whether foreach had 'else' part
|
||||
var $_literal_blocks = array(); // keeps literal template blocks
|
||||
@@ -69,11 +72,9 @@ class Smarty_Compiler extends Smarty {
|
||||
var $_obj_start_regexp = null;
|
||||
var $_obj_params_regexp = null;
|
||||
var $_obj_call_regexp = null;
|
||||
|
||||
/**#@-*/
|
||||
/**
|
||||
* The class constructor.
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function Smarty_Compiler()
|
||||
{
|
||||
@@ -198,10 +199,10 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* compile a template file
|
||||
*
|
||||
* @access public
|
||||
* @param $tpl_file
|
||||
* @param $template_source
|
||||
* @param $template_compiled
|
||||
* sets $template_compiled to the compiled source
|
||||
* @param string $tpl_file
|
||||
* @param string $template_source
|
||||
* @param string $template_compiled
|
||||
*/
|
||||
function _compile_file($tpl_file, $template_source, &$template_compiled)
|
||||
{
|
||||
@@ -362,8 +363,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile a template tag
|
||||
*
|
||||
* @access public
|
||||
* @param $template_tag
|
||||
* @param string $template_tag
|
||||
*/
|
||||
function _compile_tag($template_tag)
|
||||
{
|
||||
@@ -499,10 +499,10 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* compile the custom compiler tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_command
|
||||
* @param $tag_args
|
||||
* @param $output
|
||||
* sets $output to the compiled custom compiler tag
|
||||
* @param string $tag_command
|
||||
* @param string $tag_args
|
||||
* @param string $output
|
||||
*/
|
||||
function _compile_compiler_tag($tag_command, $tag_args, &$output)
|
||||
{
|
||||
@@ -561,11 +561,11 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* compile block function tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_command
|
||||
* @param $tag_args
|
||||
* @param $tag_modifier
|
||||
* @param $output
|
||||
* sets $output to compiled block function tag
|
||||
* @param string $tag_command
|
||||
* @param string $tag_args
|
||||
* @param string $tag_modifier
|
||||
* @param string $output
|
||||
*/
|
||||
function _compile_block_tag($tag_command, $tag_args, $tag_modifier, &$output)
|
||||
{
|
||||
@@ -649,10 +649,9 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* compile custom function tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_command
|
||||
* @param $tag_args
|
||||
* @param $tag_modifier
|
||||
* @param string $tag_command
|
||||
* @param string $tag_args
|
||||
* @param string $tag_modifier
|
||||
*/
|
||||
function _compile_custom_tag($tag_command, $tag_args, $tag_modifier)
|
||||
{
|
||||
@@ -678,10 +677,9 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* compile a registered object tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_command
|
||||
* @param $attrs
|
||||
* @param $tag_modifier
|
||||
* @param string $tag_command
|
||||
* @param array $attrs
|
||||
* @param string $tag_modifier
|
||||
*/
|
||||
function _compile_registered_object_tag($tag_command, $attrs, $tag_modifier)
|
||||
{
|
||||
@@ -736,8 +734,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile {insert ...} tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_args
|
||||
* @param string $tag_args
|
||||
*/
|
||||
function _compile_insert_tag($tag_args)
|
||||
{
|
||||
@@ -769,8 +766,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile {config_load ...} tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_args
|
||||
* @param string $tag_args
|
||||
*/
|
||||
function _compile_config_load_tag($tag_args)
|
||||
{
|
||||
@@ -805,8 +801,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile {include ...} tag
|
||||
*
|
||||
* @access public
|
||||
* $param $tag_args
|
||||
* $param string $tag_args
|
||||
*/
|
||||
function _compile_include_tag($tag_args)
|
||||
{
|
||||
@@ -855,8 +850,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile {include ...} tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_args
|
||||
* @param string $tag_args
|
||||
*/
|
||||
function _compile_include_php_tag($tag_args)
|
||||
{
|
||||
@@ -889,8 +883,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile {section ...} tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_args
|
||||
* @param string $tag_args
|
||||
*/
|
||||
function _compile_section_start($tag_args)
|
||||
{
|
||||
@@ -994,8 +987,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile {foreach ...} tag.
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_args
|
||||
* @param string $tag_args
|
||||
*/
|
||||
function _compile_foreach_start($tag_args)
|
||||
{
|
||||
@@ -1058,9 +1050,8 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile {capture} .. {/capture} tags
|
||||
*
|
||||
* @access public
|
||||
* @param $start
|
||||
* @param $tag_args
|
||||
* @param boolean $start true if this is the {capture} tag
|
||||
* @param string $tag_args
|
||||
*/
|
||||
function _compile_capture_tag($start, $tag_args = '')
|
||||
{
|
||||
@@ -1085,9 +1076,8 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile {if ...} tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_args
|
||||
* @param $elseif
|
||||
* @param string $tag_args
|
||||
* @param boolean $elseif if true, uses elseif instead of if
|
||||
*/
|
||||
function _compile_if_tag($tag_args, $elseif = false)
|
||||
{
|
||||
@@ -1245,9 +1235,8 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Parse is expression
|
||||
*
|
||||
* @access public
|
||||
* @param $is_arg
|
||||
* @param $tokens
|
||||
* @param string $is_arg
|
||||
* @param array $tokens
|
||||
*/
|
||||
function _parse_is_expr($is_arg, $tokens)
|
||||
{
|
||||
@@ -1307,9 +1296,8 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Parse attribute string
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_args
|
||||
* @param $quote
|
||||
* @param string $tag_args
|
||||
* @param true $quote unused?
|
||||
*/
|
||||
function _parse_attrs($tag_args, $quote = true)
|
||||
{
|
||||
@@ -1392,8 +1380,7 @@ class Smarty_Compiler extends Smarty {
|
||||
* compile multiple variables and section properties tokens into
|
||||
* PHP code
|
||||
*
|
||||
* @access public
|
||||
* @param $tokens
|
||||
* @param array $tokens
|
||||
*/
|
||||
function _parse_vars_props(&$tokens)
|
||||
{
|
||||
@@ -1406,9 +1393,8 @@ class Smarty_Compiler extends Smarty {
|
||||
* compile single variable and section properties token into
|
||||
* PHP code
|
||||
*
|
||||
* @access public
|
||||
* @param $val
|
||||
* @param $tag_attrs
|
||||
* @param string $val
|
||||
* @param string $tag_attrs
|
||||
*/
|
||||
function _parse_var_props($val, $tag_attrs = null)
|
||||
{
|
||||
@@ -1454,8 +1440,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* expand quoted text with embedded variables
|
||||
*
|
||||
* @access public
|
||||
* @param $var_expr
|
||||
* @param string $var_expr
|
||||
*/
|
||||
function _expand_quoted_text($var_expr)
|
||||
{
|
||||
@@ -1475,8 +1460,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* parse variable expression into PHP code
|
||||
*
|
||||
* @access public
|
||||
* @param $var_expr
|
||||
* @param string $var_expr
|
||||
*/
|
||||
function _parse_var($var_expr)
|
||||
{
|
||||
@@ -1572,8 +1556,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* parse arguments in function call parenthesis
|
||||
*
|
||||
* @access public
|
||||
* @param $parenth_args
|
||||
* @param string $parenth_args
|
||||
*/
|
||||
function _parse_parenth_args($parenth_args)
|
||||
{
|
||||
@@ -1589,8 +1572,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* parse configuration variable expression into PHP code
|
||||
*
|
||||
* @access public
|
||||
* @param $conf_var_expr
|
||||
* @param string $conf_var_expr
|
||||
*/
|
||||
function _parse_conf_var($conf_var_expr)
|
||||
{
|
||||
@@ -1611,8 +1593,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* parse section property expression into PHP code
|
||||
*
|
||||
* @access public
|
||||
* @param $section_prop_expr
|
||||
* @param string $section_prop_expr
|
||||
*/
|
||||
function _parse_section_prop($section_prop_expr)
|
||||
{
|
||||
@@ -1635,9 +1616,9 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* parse modifier chain into PHP code
|
||||
*
|
||||
* @access public
|
||||
* @param $output
|
||||
* @param $modifier_string
|
||||
* sets $output to parsed modified chain
|
||||
* @param string $output
|
||||
* @param string $modifier_string
|
||||
*/
|
||||
function _parse_modifiers(&$output, $modifier_string)
|
||||
{
|
||||
@@ -1679,10 +1660,9 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* add plugin
|
||||
*
|
||||
* @access public
|
||||
* @param $type
|
||||
* @param $name
|
||||
* @param $delayed_loading
|
||||
* @param string $type
|
||||
* @param string $name
|
||||
* @param boolean? $delayed_loading
|
||||
*/
|
||||
function _add_plugin($type, $name, $delayed_loading = null)
|
||||
{
|
||||
@@ -1700,8 +1680,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compiles references of type $smarty.foo
|
||||
*
|
||||
* @access public
|
||||
* @param $indexes
|
||||
* @param string $indexes
|
||||
*/
|
||||
function _compile_smarty_ref(&$indexes)
|
||||
{
|
||||
@@ -1814,8 +1793,6 @@ class Smarty_Compiler extends Smarty {
|
||||
|
||||
/**
|
||||
* load pre- and post-filters
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function _load_filters()
|
||||
{
|
||||
@@ -1841,11 +1818,10 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* display Smarty syntax error
|
||||
*
|
||||
* @access public
|
||||
* @param $error_msg
|
||||
* @param $error_type
|
||||
* @param $file
|
||||
* @param $line
|
||||
* @param string $error_msg
|
||||
* @param integer $error_type
|
||||
* @param string $file
|
||||
* @param integer $line
|
||||
*/
|
||||
function _syntax_error($error_msg, $error_type = E_USER_ERROR, $file=null, $line=null)
|
||||
{
|
||||
@@ -1863,8 +1839,8 @@ class Smarty_Compiler extends Smarty {
|
||||
* compare to values by their string length
|
||||
*
|
||||
* @access private
|
||||
* @param $a
|
||||
* @param $b
|
||||
* @param string $a
|
||||
* @param string $b
|
||||
*/
|
||||
function _smarty_sort_length($a, $b)
|
||||
{
|
||||
|
@@ -928,8 +928,8 @@ class Smarty
|
||||
* test to see if valid cache exists for this template
|
||||
*
|
||||
* @param string $tpl_file name of template file
|
||||
* @param $cache_id
|
||||
* @param $compile_id
|
||||
* @param string $cache_id
|
||||
* @param string $compile_id
|
||||
*/
|
||||
function is_cached($tpl_file, $cache_id = null, $compile_id = null)
|
||||
{
|
||||
@@ -957,9 +957,9 @@ class Smarty
|
||||
* or all compiled template files if one is not specified.
|
||||
* This function is for advanced use only, not normally needed.
|
||||
*
|
||||
* @param $tpl_file
|
||||
* @param $compile_id
|
||||
* @param $exp_time
|
||||
* @param string $tpl_file
|
||||
* @param string $compile_id
|
||||
* @param string $exp_time
|
||||
*/
|
||||
function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)
|
||||
{
|
||||
@@ -971,7 +971,7 @@ class Smarty
|
||||
/**
|
||||
* Checks whether requested template exists.
|
||||
*
|
||||
* @param $tpl_file
|
||||
* @param string $tpl_file
|
||||
*/
|
||||
function template_exists($tpl_file)
|
||||
{
|
||||
@@ -981,6 +981,7 @@ class Smarty
|
||||
/**
|
||||
* Returns an array containing template variables
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function &get_template_vars()
|
||||
{
|
||||
@@ -991,8 +992,8 @@ class Smarty
|
||||
/**
|
||||
* trigger Smarty error
|
||||
*
|
||||
* @param $error_msg
|
||||
* @param $error_type
|
||||
* @param string $error_msg
|
||||
* @param integer $error_type
|
||||
*/
|
||||
function trigger_error($error_msg, $error_type = E_USER_WARNING)
|
||||
{
|
||||
@@ -1003,9 +1004,9 @@ class Smarty
|
||||
/**
|
||||
* executes & displays the template results
|
||||
*
|
||||
* @param $tpl_file
|
||||
* @param $cache_id
|
||||
* @param $compile_id
|
||||
* @param string $tpl_file
|
||||
* @param string $cache_id
|
||||
* @param string $compile_id
|
||||
*/
|
||||
function display($tpl_file, $cache_id = null, $compile_id = null)
|
||||
{
|
||||
@@ -1015,10 +1016,10 @@ class Smarty
|
||||
/**
|
||||
* executes & returns or displays the template results
|
||||
*
|
||||
* @param $_smarty_tpl_file
|
||||
* @param $_smarty_cache_id
|
||||
* @param $_smarty_compile_id
|
||||
* @param $_smarty_display
|
||||
* @param string $_smarty_tpl_file
|
||||
* @param string $_smarty_cache_id
|
||||
* @param string $_smarty_compile_id
|
||||
* @param boolean $_smarty_display
|
||||
*/
|
||||
function fetch($_smarty_tpl_file, $_smarty_cache_id = null, $_smarty_compile_id = null, $_smarty_display = false)
|
||||
{
|
||||
@@ -1152,8 +1153,6 @@ class Smarty
|
||||
|
||||
/**
|
||||
* assign $smarty interface variable
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function _assign_smarty_interface()
|
||||
{
|
||||
@@ -1181,8 +1180,8 @@ class Smarty
|
||||
|
||||
/**
|
||||
* generate debug output
|
||||
*
|
||||
* @access public
|
||||
* @return string debug.tpl template output
|
||||
* @uses $debug_tpl debug template, used to display debugging output
|
||||
*/
|
||||
function _generate_debug_output()
|
||||
{
|
||||
@@ -1228,10 +1227,9 @@ class Smarty
|
||||
/**
|
||||
* load configuration values
|
||||
*
|
||||
* @access public
|
||||
* @param $file
|
||||
* @param $section
|
||||
* @param $scope
|
||||
* @param string $file
|
||||
* @param string $section
|
||||
* @param string $scope
|
||||
*/
|
||||
function config_load($file, $section = null, $scope = 'global')
|
||||
{
|
||||
@@ -1326,8 +1324,8 @@ class Smarty
|
||||
/**
|
||||
* determines if a resource is trusted or not
|
||||
*
|
||||
* @param $resource_type
|
||||
* @param $resource_name
|
||||
* @param string $resource_type
|
||||
* @param string $resource_name
|
||||
*/
|
||||
function _is_trusted($resource_type, $resource_name)
|
||||
{
|
||||
@@ -1361,8 +1359,8 @@ class Smarty
|
||||
/**
|
||||
* determines if a resource is secure or not.
|
||||
*
|
||||
* @param $resource_type
|
||||
* @param $resource_name
|
||||
* @param string $resource_type
|
||||
* @param string $resource_name
|
||||
*/
|
||||
function _is_secure($resource_type, $resource_name)
|
||||
{
|
||||
@@ -1395,8 +1393,9 @@ class Smarty
|
||||
/**
|
||||
* Retrieves PHP script resource
|
||||
*
|
||||
* @param $resource
|
||||
* @param $resource_type
|
||||
* sets $php_resource to the returned resource
|
||||
* @param string $resource
|
||||
* @param string $resource_type
|
||||
* @param $php_resource
|
||||
*/
|
||||
function _get_php_resource($resource, &$resource_type, &$php_resource)
|
||||
@@ -1457,8 +1456,8 @@ class Smarty
|
||||
/**
|
||||
* umm... process the template
|
||||
*
|
||||
* @param $tpl_file
|
||||
* @param $compile_path
|
||||
* @param string $tpl_file
|
||||
* @param string $compile_path
|
||||
*/
|
||||
function _process_template($tpl_file, $compile_path)
|
||||
{
|
||||
@@ -1498,8 +1497,7 @@ class Smarty
|
||||
/**
|
||||
* Get the compile path for this template file
|
||||
*
|
||||
* @access private
|
||||
* @param $tpl_file
|
||||
* @param string $tpl_file
|
||||
*/
|
||||
function _get_compile_path($tpl_file)
|
||||
{
|
||||
@@ -1510,9 +1508,10 @@ class Smarty
|
||||
/**
|
||||
* write the compiled template
|
||||
*
|
||||
* @param $compile_path
|
||||
* @param $template_compiled
|
||||
* @param $template_timestamp
|
||||
* @param string $compile_path
|
||||
* @param string $template_compiled
|
||||
* @param integer $template_timestamp
|
||||
* @return true
|
||||
*/
|
||||
function _write_compiled_template($compile_path, $template_compiled, $template_timestamp)
|
||||
{
|
||||
@@ -1525,10 +1524,10 @@ class Smarty
|
||||
/**
|
||||
* parse out the type and name from the template resource
|
||||
*
|
||||
* @param $file_base_path
|
||||
* @param $file_path
|
||||
* @param $resource_type
|
||||
* @param $resource_name
|
||||
* @param string $file_base_path
|
||||
* @param string $file_path
|
||||
* @param string $resource_type
|
||||
* @param string $resource_name
|
||||
*/
|
||||
function _parse_file_path($file_base_path, $file_path, &$resource_type, &$resource_name)
|
||||
{
|
||||
@@ -1576,11 +1575,13 @@ class Smarty
|
||||
* fetch the template info. Gets timestamp, and source
|
||||
* if get_source is true
|
||||
*
|
||||
* @param $tpl_path
|
||||
* @param $template_source
|
||||
* @param $template_timestamp
|
||||
* @param $get_source
|
||||
* @param $quiet
|
||||
* sets $template_source to the source of the template, and
|
||||
* $template_timestamp to its time stamp
|
||||
* @param string $tpl_path
|
||||
* @param string $template_source
|
||||
* @param integer $template_timestamp
|
||||
* @param boolean $get_source
|
||||
* @param boolean $quiet
|
||||
*/
|
||||
function _fetch_template_info($tpl_path, &$template_source, &$template_timestamp, $get_source = true, $quiet = false)
|
||||
{
|
||||
@@ -1641,9 +1642,10 @@ class Smarty
|
||||
/**
|
||||
* called to compile the templates
|
||||
*
|
||||
* @param $tpl_file
|
||||
* @param $template_source
|
||||
* @param $template_compiled
|
||||
* sets $template_compiled to the compiled template
|
||||
* @param string $tpl_file
|
||||
* @param string $template_source
|
||||
* @param string $template_compiled
|
||||
*/
|
||||
function _compile_template($tpl_file, $template_source, &$template_compiled)
|
||||
{
|
||||
@@ -1686,8 +1688,8 @@ class Smarty
|
||||
/**
|
||||
* called for included templates
|
||||
*
|
||||
* @param $_smarty_include_tpl_file
|
||||
* @param $_smarty_include_vars
|
||||
* @param string $_smarty_include_tpl_file
|
||||
* @param string $_smarty_include_vars
|
||||
*/
|
||||
function _smarty_include($_smarty_include_tpl_file, $_smarty_include_vars)
|
||||
{
|
||||
@@ -1729,9 +1731,12 @@ class Smarty
|
||||
/**
|
||||
* called for included templates
|
||||
*
|
||||
* @param $_smarty_include_php_file
|
||||
* @param $_smarty_assign
|
||||
* @param $_smarty_once
|
||||
* @param string $_smarty_include_php_file
|
||||
* @param string $_smarty_assign variable to assign the included template's
|
||||
* output into
|
||||
* @param boolean $_smarty_once uses include_once if this is true
|
||||
* @param array $_smarty_include_vars associative array of vars from
|
||||
* {include file="blah" var=$var}
|
||||
*/
|
||||
function _smarty_include_php($_smarty_include_php_file, $_smarty_assign, $_smarty_once, $_smarty_include_vars)
|
||||
{
|
||||
@@ -1770,7 +1775,7 @@ class Smarty
|
||||
/**
|
||||
* clear configuration values
|
||||
*
|
||||
* @param $var
|
||||
* @param string $var
|
||||
*/
|
||||
function clear_config($var = null)
|
||||
{
|
||||
@@ -1787,7 +1792,7 @@ class Smarty
|
||||
/**
|
||||
* Replace cached inserts with the actual results
|
||||
*
|
||||
* @param $results
|
||||
* @param string $results
|
||||
*/
|
||||
function _process_cached_inserts($results)
|
||||
{
|
||||
@@ -1837,10 +1842,10 @@ class Smarty
|
||||
/**
|
||||
* Handle insert tags
|
||||
*
|
||||
* @param $args
|
||||
* @param array $args
|
||||
*/
|
||||
function _run_insert_handler($args)
|
||||
{
|
||||
function _run_insert_handler($args)
|
||||
{
|
||||
if ($this->debugging) {
|
||||
$debug_start_time = $this->_get_microtime();
|
||||
}
|
||||
@@ -1885,7 +1890,7 @@ function _run_insert_handler($args)
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -1915,8 +1920,7 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* Remove starting and ending quotes from the string
|
||||
*
|
||||
* @access private
|
||||
* @param $string
|
||||
* @param string $string
|
||||
*/
|
||||
function _dequote($string)
|
||||
{
|
||||
@@ -1932,9 +1936,9 @@ function _run_insert_handler($args)
|
||||
* read in a file from line $start for $lines.
|
||||
* read the entire file if $start and $lines are null.
|
||||
*
|
||||
* @param $filename
|
||||
* @param $start
|
||||
* @param $lines
|
||||
* @param string $filename
|
||||
* @param integer $start
|
||||
* @param integer $lines
|
||||
*/
|
||||
function _read_file($filename, $start=null, $lines=null)
|
||||
{
|
||||
@@ -1974,9 +1978,9 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* write out a file to disk
|
||||
*
|
||||
* @param $filename
|
||||
* @param $contents
|
||||
* @param $create_dirs
|
||||
* @param string $filename
|
||||
* @param string $contents
|
||||
* @param boolean $create_dirs
|
||||
*/
|
||||
function _write_file($filename, $contents, $create_dirs = false)
|
||||
{
|
||||
@@ -2003,9 +2007,9 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* get a concrete filename for automagically created content
|
||||
*
|
||||
* @param $auto_base
|
||||
* @param $auto_source
|
||||
* @param $auto_id
|
||||
* @param string $auto_base
|
||||
* @param string $auto_source
|
||||
* @param string $auto_id
|
||||
*/
|
||||
function _get_auto_filename($auto_base, $auto_source = null, $auto_id = null)
|
||||
{
|
||||
@@ -2057,10 +2061,10 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* delete an automagically created file by name and id
|
||||
*
|
||||
* @param $auto_base
|
||||
* @param $auto_source
|
||||
* @param $auto_id
|
||||
* @param $exp_time
|
||||
* @param string $auto_base
|
||||
* @param string $auto_source
|
||||
* @param string $auto_id
|
||||
* @param integer $exp_time
|
||||
*/
|
||||
function _rm_auto($auto_base, $auto_source = null, $auto_id = null, $exp_time = null)
|
||||
{
|
||||
@@ -2096,9 +2100,9 @@ function _run_insert_handler($args)
|
||||
* delete a dir recursively (level=0 -> keep root)
|
||||
* WARNING: no tests, it will try to remove what you tell it!
|
||||
*
|
||||
* @param $dirname
|
||||
* @param $level
|
||||
* @param $exp_time
|
||||
* @param string $dirname
|
||||
* @param integer $level
|
||||
* @param integer $exp_time
|
||||
*/
|
||||
function _rmdir($dirname, $level = 1, $exp_time = null)
|
||||
{
|
||||
@@ -2131,8 +2135,8 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* unlink a file, possibly using expiration time
|
||||
*
|
||||
* @param $resource
|
||||
* @param $exp_time
|
||||
* @param string $resource
|
||||
* @param integer $exp_time
|
||||
*/
|
||||
function _unlink($resource, $exp_time = null)
|
||||
{
|
||||
@@ -2148,7 +2152,7 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* create full directory structure
|
||||
*
|
||||
* @param $dir
|
||||
* @param string $dir
|
||||
*/
|
||||
function _create_dir_structure($dir)
|
||||
{
|
||||
@@ -2194,10 +2198,10 @@ function _run_insert_handler($args)
|
||||
* Prepend the cache information to the cache file
|
||||
* and write it
|
||||
*
|
||||
* @param $tpl_file
|
||||
* @param $cache_id
|
||||
* @param $compile_id
|
||||
* @param $results
|
||||
* @param string $tpl_file
|
||||
* @param string $cache_id
|
||||
* @param string $compile_id
|
||||
* @param string $results
|
||||
*/
|
||||
function _write_cache_file($tpl_file, $cache_id, $compile_id, $results)
|
||||
{
|
||||
@@ -2238,9 +2242,9 @@ function _run_insert_handler($args)
|
||||
* regenerated or not
|
||||
*
|
||||
* @param string $tpl_file
|
||||
* @param $cache_id
|
||||
* @param $compile_id
|
||||
* @param $results
|
||||
* @param string $cache_id
|
||||
* @param string $compile_id
|
||||
* @param string $results
|
||||
*/
|
||||
function _read_cache_file($tpl_file, $cache_id, $compile_id, &$results)
|
||||
{
|
||||
@@ -2325,8 +2329,8 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* get filepath of requested plugin
|
||||
*
|
||||
* @param $type
|
||||
* @param $name
|
||||
* @param string $type
|
||||
* @param string $name
|
||||
*/
|
||||
function _get_plugin_filepath($type, $name)
|
||||
{
|
||||
@@ -2369,7 +2373,7 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* Load requested plugins
|
||||
*
|
||||
* @param $plugins
|
||||
* @param array $plugins
|
||||
*/
|
||||
function _load_plugins($plugins)
|
||||
{
|
||||
@@ -2480,7 +2484,7 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* load a resource plugin
|
||||
*
|
||||
* @param $type
|
||||
* @param string $type
|
||||
*/
|
||||
function _load_resource_plugin($type)
|
||||
{
|
||||
@@ -2540,7 +2544,6 @@ function _run_insert_handler($args)
|
||||
|
||||
/**
|
||||
* automatically load a set of filters
|
||||
*
|
||||
*/
|
||||
function _autoload_filters()
|
||||
{
|
||||
@@ -2554,7 +2557,7 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* Quote subpattern references
|
||||
*
|
||||
* @param $string
|
||||
* @param string $string
|
||||
*/
|
||||
function quote_replace($string)
|
||||
{
|
||||
@@ -2565,9 +2568,12 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* trigger Smarty plugin error
|
||||
*
|
||||
* @param $error_msg
|
||||
* @param $tpl_file
|
||||
* @param $tpl_line
|
||||
* @param string $error_msg
|
||||
* @param string $tpl_file
|
||||
* @param integer $tpl_line
|
||||
* @param string $file
|
||||
* @param integer $line
|
||||
* @param integer $error_type
|
||||
*/
|
||||
function _trigger_fatal_error($error_msg, $tpl_file = null, $tpl_line = null,
|
||||
$file = null, $line = null, $error_type = E_USER_ERROR)
|
||||
@@ -2587,7 +2593,7 @@ function _run_insert_handler($args)
|
||||
|
||||
/**
|
||||
* Get seconds and microseconds
|
||||
*
|
||||
* @return double
|
||||
*/
|
||||
function _get_microtime()
|
||||
{
|
||||
@@ -2600,8 +2606,8 @@ function _run_insert_handler($args)
|
||||
/**
|
||||
* Get path to file from include_path
|
||||
*
|
||||
* @param $file_path
|
||||
* @param $new_file_path
|
||||
* @param string $file_path
|
||||
* @param string $new_file_path
|
||||
*/
|
||||
function _get_include_path($file_path, &$new_file_path)
|
||||
{
|
||||
|
@@ -3,11 +3,6 @@
|
||||
/**
|
||||
* Project: Smarty: the PHP compiling template engine
|
||||
* File: Smarty_Compiler.class.php
|
||||
* Author: Monte Ohrt <monte@ispi.net>
|
||||
* Andrei Zmievski <andrei@php.net>
|
||||
*
|
||||
* Version: 2.4.2
|
||||
* Copyright: 2001,2002 ispi of Lincoln, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -35,12 +30,20 @@
|
||||
*
|
||||
* The latest version of Smarty can be obtained from:
|
||||
* http://www.phpinsider.com/
|
||||
*
|
||||
* @link http://www.phpinsider.com/
|
||||
* @author Monte Ohrt <monte@ispi.net>
|
||||
* @author Andrei Zmievski <andrei@php.net>
|
||||
* @version 2.4.2
|
||||
* @copyright 2001,2002 ispi of Lincoln, Inc.
|
||||
* @package Smarty
|
||||
*/
|
||||
|
||||
class Smarty_Compiler extends Smarty {
|
||||
|
||||
// internal vars
|
||||
/**#@+
|
||||
* @access private
|
||||
*/
|
||||
var $_sectionelse_stack = array(); // keeps track of whether section had 'else' part
|
||||
var $_foreachelse_stack = array(); // keeps track of whether foreach had 'else' part
|
||||
var $_literal_blocks = array(); // keeps literal template blocks
|
||||
@@ -69,11 +72,9 @@ class Smarty_Compiler extends Smarty {
|
||||
var $_obj_start_regexp = null;
|
||||
var $_obj_params_regexp = null;
|
||||
var $_obj_call_regexp = null;
|
||||
|
||||
/**#@-*/
|
||||
/**
|
||||
* The class constructor.
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function Smarty_Compiler()
|
||||
{
|
||||
@@ -198,10 +199,10 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* compile a template file
|
||||
*
|
||||
* @access public
|
||||
* @param $tpl_file
|
||||
* @param $template_source
|
||||
* @param $template_compiled
|
||||
* sets $template_compiled to the compiled source
|
||||
* @param string $tpl_file
|
||||
* @param string $template_source
|
||||
* @param string $template_compiled
|
||||
*/
|
||||
function _compile_file($tpl_file, $template_source, &$template_compiled)
|
||||
{
|
||||
@@ -362,8 +363,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile a template tag
|
||||
*
|
||||
* @access public
|
||||
* @param $template_tag
|
||||
* @param string $template_tag
|
||||
*/
|
||||
function _compile_tag($template_tag)
|
||||
{
|
||||
@@ -499,10 +499,10 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* compile the custom compiler tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_command
|
||||
* @param $tag_args
|
||||
* @param $output
|
||||
* sets $output to the compiled custom compiler tag
|
||||
* @param string $tag_command
|
||||
* @param string $tag_args
|
||||
* @param string $output
|
||||
*/
|
||||
function _compile_compiler_tag($tag_command, $tag_args, &$output)
|
||||
{
|
||||
@@ -561,11 +561,11 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* compile block function tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_command
|
||||
* @param $tag_args
|
||||
* @param $tag_modifier
|
||||
* @param $output
|
||||
* sets $output to compiled block function tag
|
||||
* @param string $tag_command
|
||||
* @param string $tag_args
|
||||
* @param string $tag_modifier
|
||||
* @param string $output
|
||||
*/
|
||||
function _compile_block_tag($tag_command, $tag_args, $tag_modifier, &$output)
|
||||
{
|
||||
@@ -649,10 +649,9 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* compile custom function tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_command
|
||||
* @param $tag_args
|
||||
* @param $tag_modifier
|
||||
* @param string $tag_command
|
||||
* @param string $tag_args
|
||||
* @param string $tag_modifier
|
||||
*/
|
||||
function _compile_custom_tag($tag_command, $tag_args, $tag_modifier)
|
||||
{
|
||||
@@ -678,10 +677,9 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* compile a registered object tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_command
|
||||
* @param $attrs
|
||||
* @param $tag_modifier
|
||||
* @param string $tag_command
|
||||
* @param array $attrs
|
||||
* @param string $tag_modifier
|
||||
*/
|
||||
function _compile_registered_object_tag($tag_command, $attrs, $tag_modifier)
|
||||
{
|
||||
@@ -736,8 +734,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile {insert ...} tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_args
|
||||
* @param string $tag_args
|
||||
*/
|
||||
function _compile_insert_tag($tag_args)
|
||||
{
|
||||
@@ -769,8 +766,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile {config_load ...} tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_args
|
||||
* @param string $tag_args
|
||||
*/
|
||||
function _compile_config_load_tag($tag_args)
|
||||
{
|
||||
@@ -805,8 +801,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile {include ...} tag
|
||||
*
|
||||
* @access public
|
||||
* $param $tag_args
|
||||
* $param string $tag_args
|
||||
*/
|
||||
function _compile_include_tag($tag_args)
|
||||
{
|
||||
@@ -855,8 +850,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile {include ...} tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_args
|
||||
* @param string $tag_args
|
||||
*/
|
||||
function _compile_include_php_tag($tag_args)
|
||||
{
|
||||
@@ -889,8 +883,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile {section ...} tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_args
|
||||
* @param string $tag_args
|
||||
*/
|
||||
function _compile_section_start($tag_args)
|
||||
{
|
||||
@@ -994,8 +987,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile {foreach ...} tag.
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_args
|
||||
* @param string $tag_args
|
||||
*/
|
||||
function _compile_foreach_start($tag_args)
|
||||
{
|
||||
@@ -1058,9 +1050,8 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile {capture} .. {/capture} tags
|
||||
*
|
||||
* @access public
|
||||
* @param $start
|
||||
* @param $tag_args
|
||||
* @param boolean $start true if this is the {capture} tag
|
||||
* @param string $tag_args
|
||||
*/
|
||||
function _compile_capture_tag($start, $tag_args = '')
|
||||
{
|
||||
@@ -1085,9 +1076,8 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compile {if ...} tag
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_args
|
||||
* @param $elseif
|
||||
* @param string $tag_args
|
||||
* @param boolean $elseif if true, uses elseif instead of if
|
||||
*/
|
||||
function _compile_if_tag($tag_args, $elseif = false)
|
||||
{
|
||||
@@ -1245,9 +1235,8 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Parse is expression
|
||||
*
|
||||
* @access public
|
||||
* @param $is_arg
|
||||
* @param $tokens
|
||||
* @param string $is_arg
|
||||
* @param array $tokens
|
||||
*/
|
||||
function _parse_is_expr($is_arg, $tokens)
|
||||
{
|
||||
@@ -1307,9 +1296,8 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Parse attribute string
|
||||
*
|
||||
* @access public
|
||||
* @param $tag_args
|
||||
* @param $quote
|
||||
* @param string $tag_args
|
||||
* @param true $quote unused?
|
||||
*/
|
||||
function _parse_attrs($tag_args, $quote = true)
|
||||
{
|
||||
@@ -1392,8 +1380,7 @@ class Smarty_Compiler extends Smarty {
|
||||
* compile multiple variables and section properties tokens into
|
||||
* PHP code
|
||||
*
|
||||
* @access public
|
||||
* @param $tokens
|
||||
* @param array $tokens
|
||||
*/
|
||||
function _parse_vars_props(&$tokens)
|
||||
{
|
||||
@@ -1406,9 +1393,8 @@ class Smarty_Compiler extends Smarty {
|
||||
* compile single variable and section properties token into
|
||||
* PHP code
|
||||
*
|
||||
* @access public
|
||||
* @param $val
|
||||
* @param $tag_attrs
|
||||
* @param string $val
|
||||
* @param string $tag_attrs
|
||||
*/
|
||||
function _parse_var_props($val, $tag_attrs = null)
|
||||
{
|
||||
@@ -1454,8 +1440,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* expand quoted text with embedded variables
|
||||
*
|
||||
* @access public
|
||||
* @param $var_expr
|
||||
* @param string $var_expr
|
||||
*/
|
||||
function _expand_quoted_text($var_expr)
|
||||
{
|
||||
@@ -1475,8 +1460,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* parse variable expression into PHP code
|
||||
*
|
||||
* @access public
|
||||
* @param $var_expr
|
||||
* @param string $var_expr
|
||||
*/
|
||||
function _parse_var($var_expr)
|
||||
{
|
||||
@@ -1572,8 +1556,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* parse arguments in function call parenthesis
|
||||
*
|
||||
* @access public
|
||||
* @param $parenth_args
|
||||
* @param string $parenth_args
|
||||
*/
|
||||
function _parse_parenth_args($parenth_args)
|
||||
{
|
||||
@@ -1589,8 +1572,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* parse configuration variable expression into PHP code
|
||||
*
|
||||
* @access public
|
||||
* @param $conf_var_expr
|
||||
* @param string $conf_var_expr
|
||||
*/
|
||||
function _parse_conf_var($conf_var_expr)
|
||||
{
|
||||
@@ -1611,8 +1593,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* parse section property expression into PHP code
|
||||
*
|
||||
* @access public
|
||||
* @param $section_prop_expr
|
||||
* @param string $section_prop_expr
|
||||
*/
|
||||
function _parse_section_prop($section_prop_expr)
|
||||
{
|
||||
@@ -1635,9 +1616,9 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* parse modifier chain into PHP code
|
||||
*
|
||||
* @access public
|
||||
* @param $output
|
||||
* @param $modifier_string
|
||||
* sets $output to parsed modified chain
|
||||
* @param string $output
|
||||
* @param string $modifier_string
|
||||
*/
|
||||
function _parse_modifiers(&$output, $modifier_string)
|
||||
{
|
||||
@@ -1679,10 +1660,9 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* add plugin
|
||||
*
|
||||
* @access public
|
||||
* @param $type
|
||||
* @param $name
|
||||
* @param $delayed_loading
|
||||
* @param string $type
|
||||
* @param string $name
|
||||
* @param boolean? $delayed_loading
|
||||
*/
|
||||
function _add_plugin($type, $name, $delayed_loading = null)
|
||||
{
|
||||
@@ -1700,8 +1680,7 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* Compiles references of type $smarty.foo
|
||||
*
|
||||
* @access public
|
||||
* @param $indexes
|
||||
* @param string $indexes
|
||||
*/
|
||||
function _compile_smarty_ref(&$indexes)
|
||||
{
|
||||
@@ -1814,8 +1793,6 @@ class Smarty_Compiler extends Smarty {
|
||||
|
||||
/**
|
||||
* load pre- and post-filters
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
function _load_filters()
|
||||
{
|
||||
@@ -1841,11 +1818,10 @@ class Smarty_Compiler extends Smarty {
|
||||
/**
|
||||
* display Smarty syntax error
|
||||
*
|
||||
* @access public
|
||||
* @param $error_msg
|
||||
* @param $error_type
|
||||
* @param $file
|
||||
* @param $line
|
||||
* @param string $error_msg
|
||||
* @param integer $error_type
|
||||
* @param string $file
|
||||
* @param integer $line
|
||||
*/
|
||||
function _syntax_error($error_msg, $error_type = E_USER_ERROR, $file=null, $line=null)
|
||||
{
|
||||
@@ -1863,8 +1839,8 @@ class Smarty_Compiler extends Smarty {
|
||||
* compare to values by their string length
|
||||
*
|
||||
* @access private
|
||||
* @param $a
|
||||
* @param $b
|
||||
* @param string $a
|
||||
* @param string $b
|
||||
*/
|
||||
function _smarty_sort_length($a, $b)
|
||||
{
|
||||
|
Reference in New Issue
Block a user