fix formatting

This commit is contained in:
monte.ohrt
2010-08-17 15:39:51 +00:00
parent ad921936b0
commit 21d507a5cb
97 changed files with 1357 additions and 1262 deletions

View File

@@ -760,6 +760,9 @@ class Smarty extends Smarty_Internal_Data {
} }
} }
/**
* Autoloader
*/
function smartyAutoload($class) function smartyAutoload($class)
{ {
$_class = strtolower($class); $_class = strtolower($class);
@@ -768,11 +771,16 @@ function smartyAutoload($class)
} }
} }
/**
* Smarty exception class
*/
Class SmartyException extends Exception { Class SmartyException extends Exception {
} }
/**
* Smarty compiler exception class
*/
Class SmartyCompilerException extends SmartyException { Class SmartyCompilerException extends SmartyException {
} }
?> ?>

View File

@@ -1,21 +1,21 @@
<?php <?php
/** /**
* Smarty plugin to execute PHP code * Smarty plugin to execute PHP code
* *
* @package Smarty * @package Smarty
* @subpackage PluginsBlock * @subpackage PluginsBlock
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty {php}{/php} block plugin * Smarty {php}{/php} block plugin
* *
* @param string $content contents of the block * @param string $content contents of the block
* @param object $smarty Smarty object * @param object $smarty Smarty object
* @param boolean $ &$repeat repeat flag * @param boolean $ &$repeat repeat flag
* @param object $template template object * @param object $template template object
* @return string content re-formatted * @return string content re-formatted
*/ */
function smarty_block_php($params, $content, $smarty, &$repeat, $template) function smarty_block_php($params, $content, $smarty, &$repeat, $template)
{ {
if (!$smarty->allow_php_tag) { if (!$smarty->allow_php_tag) {
@@ -24,4 +24,5 @@ function smarty_block_php($params, $content, $smarty, &$repeat, $template)
eval($content); eval($content);
return ''; return '';
} }
?> ?>

View File

@@ -1,37 +1,37 @@
<?php <?php
/** /**
* Smarty plugin to format text blocks * Smarty plugin to format text blocks
* *
* @package Smarty * @package Smarty
* @subpackage PluginsBlock * @subpackage PluginsBlock
*/ */
/** /**
* Smarty {textformat}{/textformat} block plugin * Smarty {textformat}{/textformat} block plugin
* *
* Type: block function<br> * Type: block function<br>
* Name: textformat<br> * Name: textformat<br>
* Purpose: format text a certain way with preset styles * Purpose: format text a certain way with preset styles
* or custom wrap/indent settings<br> * or custom wrap/indent settings<br>
* *
* @link http://smarty.php.net/manual/en/language.function.textformat.php {textformat} * @link http://smarty.php.net/manual/en/language.function.textformat.php {textformat}
(Smarty online manual) * (Smarty online manual)
* @param array $params parameters * @param array $params parameters
* <pre> * <pre>
* Params: style: string (email) * Params: style: string (email)
* indent: integer (0) * indent: integer (0)
* wrap: integer (80) * wrap: integer (80)
* wrap_char string ("\n") * wrap_char string ("\n")
* indent_char: string (" ") * indent_char: string (" ")
* wrap_boundary: boolean (true) * wrap_boundary: boolean (true)
* </pre> * </pre>
* @author Monte Ohrt <monte at ohrt dot com> * @author Monte Ohrt <monte at ohrt dot com>
* @param string $content contents of the block * @param string $content contents of the block
* @param object $smarty Smarty object * @param object $smarty Smarty object
* @param boolean &$repeat repeat flag * @param boolean &$repeat repeat flag
* @param object $template template object * @param object $template template object
* @return string content re-formatted * @return string content re-formatted
*/ */
function smarty_block_textformat($params, $content, $smarty, &$repeat, $template) function smarty_block_textformat($params, $content, $smarty, &$repeat, $template)
{ {
if (is_null($content)) { if (is_null($content)) {
@@ -100,4 +100,4 @@ function smarty_block_textformat($params, $content, $smarty, &$repeat, $template
return $assign ? $template->assign($assign, $_output) : $_output; return $assign ? $template->assign($assign, $_output) : $_output;
} }
?> ?>

View File

@@ -5,7 +5,6 @@
* @subpackage PluginsFunction * @subpackage PluginsFunction
*/ */
/** /**
* Smarty {counter} function plugin * Smarty {counter} function plugin
* *
@@ -74,4 +73,5 @@ function smarty_function_counter($params, $smarty)
return $retval; return $retval;
} }
?> ?>

View File

@@ -1,6 +1,7 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
*
* @package Smarty * @package Smarty
* @subpackage PluginsFunction * @subpackage PluginsFunction
*/ */
@@ -41,6 +42,7 @@
* @param Smarty * @param Smarty
* @return string|null * @return string|null
*/ */
function smarty_function_cycle($params, $smarty) function smarty_function_cycle($params, $smarty)
{ {
static $cycle_vars; static $cycle_vars;
@@ -100,4 +102,5 @@ function smarty_function_cycle($params, $smarty)
return $retval; return $retval;
} }
?> ?>

View File

@@ -1,11 +1,11 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
*
* @package Smarty * @package Smarty
* @subpackage PluginsFunction * @subpackage PluginsFunction
*/ */
/** /**
* Smarty {fetch} plugin * Smarty {fetch} plugin
* *
@@ -214,4 +214,4 @@ function smarty_function_fetch($params, $smarty, $template)
} }
} }
?> ?>

View File

@@ -1,11 +1,11 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
*
* @package Smarty * @package Smarty
* @subpackage PluginsFunction * @subpackage PluginsFunction
*/ */
/** /**
* Smarty {html_checkboxes} function plugin * Smarty {html_checkboxes} function plugin
* *
@@ -142,4 +142,4 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte
return $_output; return $_output;
} }
?> ?>

View File

@@ -1,39 +1,39 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsFunction * @subpackage PluginsFunction
*/ */
/** /**
* Smarty {html_image} function plugin * Smarty {html_image} function plugin
* *
* Type: function<br> * Type: function<br>
* Name: html_image<br> * Name: html_image<br>
* Date: Feb 24, 2003<br> * Date: Feb 24, 2003<br>
* Purpose: format HTML tags for the image<br> * Purpose: format HTML tags for the image<br>
* Examples: {html_image file="/images/masthead.gif"} * Examples: {html_image file="/images/masthead.gif"}
* Output: <img src="/images/masthead.gif" width=400 height=23> * Output: <img src="/images/masthead.gif" width=400 height=23>
* *
* @link http://smarty.php.net/manual/en/language.function.html.image.php {html_image} * @link http://smarty.php.net/manual/en/language.function.html.image.php {html_image}
(Smarty online manual) * (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com> * @author Monte Ohrt <monte at ohrt dot com>
* @author credits to Duda <duda@big.hu> * @author credits to Duda <duda@big.hu>
* @version 1.0 * @version 1.0
* @param array $params parameters * @param array $params parameters
* Input:<br> * Input:<br>
* - file = file (and path) of image (required) * - file = file (and path) of image (required)
* - height = image height (optional, default actual height) * - height = image height (optional, default actual height)
* - width = image width (optional, default actual width) * - width = image width (optional, default actual width)
* - basedir = base directory for absolute paths, default * - basedir = base directory for absolute paths, default
* is environment variable DOCUMENT_ROOT * is environment variable DOCUMENT_ROOT
* - path_prefix = prefix for path output (optional, default empty) * - path_prefix = prefix for path output (optional, default empty)
* @param object $smarty Smarty object * @param object $smarty Smarty object
* @param object $template template object * @param object $template template object
* @return string * @return string
* @uses smarty_function_escape_special_chars() * @uses smarty_function_escape_special_chars()
*/ */
function smarty_function_html_image($params, $smarty, $template) function smarty_function_html_image($params, $smarty, $template)
{ {
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');

View File

@@ -1,35 +1,34 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsFunction * @subpackage PluginsFunction
*/ */
/** /**
* Smarty {html_options} function plugin * Smarty {html_options} function plugin
* *
* Type: function<br> * Type: function<br>
* Name: html_options<br> * Name: html_options<br>
* Purpose: Prints the list of <option> tags generated from * Purpose: Prints the list of <option> tags generated from
* the passed parameters * the passed parameters
* *
* @link http://smarty.php.net/manual/en/language.function.html.options.php {html_image} * @link http://smarty.php.net/manual/en/language.function.html.options.php {html_image}
(Smarty online manual) * (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com> * @author Monte Ohrt <monte at ohrt dot com>
* @param array $params parameters * @param array $params parameters
* Input:<br> * Input:<br>
* - name (optional) - string default "select" * - name (optional) - string default "select"
* - values (required if no options supplied) - array * - values (required if no options supplied) - array
* - options (required if no values supplied) - associative array * - options (required if no values supplied) - associative array
* - selected (optional) - string default not set * - selected (optional) - string default not set
* - output (required if not options supplied) - array * - output (required if not options supplied) - array
* @param object $smarty Smarty object * @param object $smarty Smarty object
* @param object $template template object * @param object $template template object
* @return string * @return string
* @uses smarty_function_escape_special_chars() * @uses smarty_function_escape_special_chars()
*/ */
function smarty_function_html_options($params, $smarty, $template) function smarty_function_html_options($params, $smarty, $template)
{ {
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
@@ -119,4 +118,4 @@ function smarty_function_html_options_optgroup($key, $values, $selected)
return $optgroup_html; return $optgroup_html;
} }
?> ?>

View File

@@ -1,45 +1,45 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsFunction * @subpackage PluginsFunction
*/ */
/** /**
* Smarty {html_radios} function plugin * Smarty {html_radios} function plugin
* *
* File: function.html_radios.php<br> * File: function.html_radios.php<br>
* Type: function<br> * Type: function<br>
* Name: html_radios<br> * Name: html_radios<br>
* Date: 24.Feb.2003<br> * Date: 24.Feb.2003<br>
* Purpose: Prints out a list of radio input types<br> * Purpose: Prints out a list of radio input types<br>
* Examples: * Examples:
* <pre> * <pre>
* {html_radios values=$ids output=$names} * {html_radios values=$ids output=$names}
* {html_radios values=$ids name='box' separator='<br>' output=$names} * {html_radios values=$ids name='box' separator='<br>' output=$names}
* {html_radios values=$ids checked=$checked separator='<br>' output=$names} * {html_radios values=$ids checked=$checked separator='<br>' output=$names}
* </pre> * </pre>
* *
* @link http://smarty.php.net/manual/en/language.function.html.radios.php {html_radios} * @link http://smarty.php.net/manual/en/language.function.html.radios.php {html_radios}
(Smarty online manual) * (Smarty online manual)
* @author Christopher Kvarme <christopher.kvarme@flashjab.com> * @author Christopher Kvarme <christopher.kvarme@flashjab.com>
* @author credits to Monte Ohrt <monte at ohrt dot com> * @author credits to Monte Ohrt <monte at ohrt dot com>
* @version 1.0 * @version 1.0
* @param array $params parameters * @param array $params parameters
* Input:<br> * Input:<br>
* - name (optional) - string default "radio" * - name (optional) - string default "radio"
* - values (required) - array * - values (required) - array
* - options (optional) - associative array * - options (optional) - associative array
* - checked (optional) - array default not set * - checked (optional) - array default not set
* - separator (optional) - ie <br> or &nbsp; * - separator (optional) - ie <br> or &nbsp;
* - output (optional) - the output next to each radio button * - output (optional) - the output next to each radio button
* - assign (optional) - assign the output as an array to this variable * - assign (optional) - assign the output as an array to this variable
* @param object $smarty Smarty object * @param object $smarty Smarty object
* @param object $template template object * @param object $template template object
* @return string * @return string
* @uses smarty_function_escape_special_chars() * @uses smarty_function_escape_special_chars()
*/ */
function smarty_function_html_radios($params, $smarty, $template) function smarty_function_html_radios($params, $smarty, $template)
{ {
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
@@ -153,4 +153,4 @@ function smarty_function_html_radios_output($name, $value, $output, $selected, $
return $_output; return $_output;
} }
?> ?>

View File

@@ -1,43 +1,43 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsFunction * @subpackage PluginsFunction
*/ */
/** /**
* Smarty {html_select_date} plugin * Smarty {html_select_date} plugin
* *
* Type: function<br> * Type: function<br>
* Name: html_select_date<br> * Name: html_select_date<br>
* Purpose: Prints the dropdowns for date selection. * Purpose: Prints the dropdowns for date selection.
* *
* ChangeLog:<br> * ChangeLog:<br>
* - 1.0 initial release * - 1.0 initial release
* - 1.1 added support for +/- N syntax for begin * - 1.1 added support for +/- N syntax for begin
* and end year values. (Monte) * and end year values. (Monte)
* - 1.2 added support for yyyy-mm-dd syntax for * - 1.2 added support for yyyy-mm-dd syntax for
* time value. (Jan Rosier) * time value. (Jan Rosier)
* - 1.3 added support for choosing format for * - 1.3 added support for choosing format for
* month values (Gary Loescher) * month values (Gary Loescher)
* - 1.3.1 added support for choosing format for * - 1.3.1 added support for choosing format for
* day values (Marcus Bointon) * day values (Marcus Bointon)
* - 1.3.2 support negative timestamps, force year * - 1.3.2 support negative timestamps, force year
* dropdown to include given date unless explicitly set (Monte) * 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 * - 1.3.4 fix behaviour of 0000-00-00 00:00:00 dates to match that
* of 0000-00-00 dates (cybot, boots) * of 0000-00-00 dates (cybot, boots)
* *
* @link http://smarty.php.net/manual/en/language.function.html.select.date.php {html_select_date} * @link http://smarty.php.net/manual/en/language.function.html.select.date.php {html_select_date}
(Smarty online manual) * (Smarty online manual)
* @version 1.3.4 * @version 1.3.4
* @author Andrei Zmievski * @author Andrei Zmievski
* @author Monte Ohrt <monte at ohrt dot com> * @author Monte Ohrt <monte at ohrt dot com>
* @param array $params parameters * @param array $params parameters
* @param object $smarty Smarty object * @param object $smarty Smarty object
* @param object $template template object * @param object $template template object
* @return string * @return string
*/ */
function smarty_function_html_select_date($params, $smarty, $template) function smarty_function_html_select_date($params, $smarty, $template)
{ {
require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
@@ -329,5 +329,6 @@ function smarty_function_html_select_date($params, $smarty, $template)
} }
return $html_result; return $html_result;
} }
?>
?>

View File

@@ -1,28 +1,28 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsFunction * @subpackage PluginsFunction
*/ */
/** /**
* Smarty {html_select_time} function plugin * Smarty {html_select_time} function plugin
* *
* Type: function<br> * Type: function<br>
* Name: html_select_time<br> * Name: html_select_time<br>
* Purpose: Prints the dropdowns for time selection * Purpose: Prints the dropdowns for time selection
* *
* @link http://smarty.php.net/manual/en/language.function.html.select.time.php {html_select_time} * @link http://smarty.php.net/manual/en/language.function.html.select.time.php {html_select_time}
(Smarty online manual) * (Smarty online manual)
* @author Roberto Berto <roberto@berto.net> * @author Roberto Berto <roberto@berto.net>
* @credits Monte Ohrt <monte AT ohrt DOT com> * @credits Monte Ohrt <monte AT ohrt DOT com>
* @param array $params parameters * @param array $params parameters
* @param object $smarty Smarty object * @param object $smarty Smarty object
* @param object $template template object * @param object $template template object
* @return string * @return string
* @uses smarty_make_timestamp() * @uses smarty_make_timestamp()
*/ */
function smarty_function_html_select_time($params, $smarty, $template) function smarty_function_html_select_time($params, $smarty, $template)
{ {
require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php'); require_once(SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php');
@@ -194,4 +194,4 @@ function smarty_function_html_select_time($params, $smarty, $template)
return $html_result; return $html_result;
} }
?> ?>

View File

@@ -1,53 +1,53 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsFunction * @subpackage PluginsFunction
*/ */
/** /**
* Smarty {html_table} function plugin * Smarty {html_table} function plugin
* *
* Type: function<br> * Type: function<br>
* Name: html_table<br> * Name: html_table<br>
* Date: Feb 17, 2003<br> * Date: Feb 17, 2003<br>
* Purpose: make an html table from an array of data<br> * Purpose: make an html table from an array of data<br>
* *
* *
* Examples: * Examples:
* <pre> * <pre>
* {table loop=$data} * {table loop=$data}
* {table loop=$data cols=4 tr_attr='"bgcolor=red"'} * {table loop=$data cols=4 tr_attr='"bgcolor=red"'}
* {table loop=$data cols="first,second,third" tr_attr=$colors} * {table loop=$data cols="first,second,third" tr_attr=$colors}
* </pre> * </pre>
* *
* @author Monte Ohrt <monte at ohrt dot com> * @author Monte Ohrt <monte at ohrt dot com>
* @author credit to Messju Mohr <messju at lammfellpuschen dot de> * @author credit to Messju Mohr <messju at lammfellpuschen dot de>
* @author credit to boots <boots dot smarty at yahoo dot com> * @author credit to boots <boots dot smarty at yahoo dot com>
* @version 1.1 * @version 1.1
* @link http://smarty.php.net/manual/en/language.function.html.table.php {html_table} * @link http://smarty.php.net/manual/en/language.function.html.table.php {html_table}
(Smarty online manual) * (Smarty online manual)
* @param array $params parameters * @param array $params parameters
* Input:<br> * Input:<br>
* - loop = array to loop through * - loop = array to loop through
* - cols = number of columns, comma separated list of column names * - cols = number of columns, comma separated list of column names
* or array of column names * or array of column names
* - rows = number of rows * - rows = number of rows
* - table_attr = table attributes * - table_attr = table attributes
* - th_attr = table heading attributes (arrays are cycled) * - th_attr = table heading attributes (arrays are cycled)
* - tr_attr = table row attributes (arrays are cycled) * - tr_attr = table row attributes (arrays are cycled)
* - td_attr = table cell attributes (arrays are cycled) * - td_attr = table cell attributes (arrays are cycled)
* - trailpad = value to pad trailing cells with * - trailpad = value to pad trailing cells with
* - caption = text for caption element * - caption = text for caption element
* - vdir = vertical direction (default: "down", means top-to-bottom) * - vdir = vertical direction (default: "down", means top-to-bottom)
* - hdir = horizontal direction (default: "right", means left-to-right) * - hdir = horizontal direction (default: "right", means left-to-right)
* - inner = inner loop (default "cols": print $loop line by line, * - inner = inner loop (default "cols": print $loop line by line,
* $loop will be printed column by column otherwise) * $loop will be printed column by column otherwise)
* @param object $smarty Smarty object * @param object $smarty Smarty object
* @param object $template template object * @param object $template template object
* @return string * @return string
*/ */
function smarty_function_html_table($params, $smarty, $template) function smarty_function_html_table($params, $smarty, $template)
{ {
$table_attr = 'border="1"'; $table_attr = 'border="1"';
@@ -172,5 +172,6 @@ function smarty_function_html_table_cycle($name, $var, $no)
} }
return ($ret) ? ' ' . $ret : ''; return ($ret) ? ' ' . $ret : '';
} }
?>
?>

View File

@@ -1,54 +1,54 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsFunction * @subpackage PluginsFunction
*/ */
/** /**
* Smarty {mailto} function plugin * Smarty {mailto} function plugin
* *
* Type: function<br> * Type: function<br>
* Name: mailto<br> * Name: mailto<br>
* Date: May 21, 2002 * Date: May 21, 2002
* Purpose: automate mailto address link creation, and optionally * Purpose: automate mailto address link creation, and optionally
* encode them.<br> * encode them.<br>
* *
* Examples: * Examples:
* <pre> * <pre>
* {mailto address="me@domain.com"} * {mailto address="me@domain.com"}
* {mailto address="me@domain.com" encode="javascript"} * {mailto address="me@domain.com" encode="javascript"}
* {mailto address="me@domain.com" encode="hex"} * {mailto address="me@domain.com" encode="hex"}
* {mailto address="me@domain.com" subject="Hello to you!"} * {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" cc="you@domain.com,they@domain.com"}
* {mailto address="me@domain.com" extra='class="mailto"'} * {mailto address="me@domain.com" extra='class="mailto"'}
* </pre> * </pre>
* *
* @link http://smarty.php.net/manual/en/language.function.mailto.php {mailto} * @link http://smarty.php.net/manual/en/language.function.mailto.php {mailto}
(Smarty online manual) * (Smarty online manual)
* @version 1.2 * @version 1.2
* @author Monte Ohrt <monte at ohrt dot com> * @author Monte Ohrt <monte at ohrt dot com>
* @author credits to Jason Sweat (added cc, bcc and subject functionality) * @author credits to Jason Sweat (added cc, bcc and subject functionality)
* @param array $params parameters * @param array $params parameters
* Input:<br> * Input:<br>
* - address = e-mail address * - address = e-mail address
* - text = (optional) text to display, default is address * - text = (optional) text to display, default is address
* - encode = (optional) can be one of: * - encode = (optional) can be one of:
* * none : no encoding (default) * * none : no encoding (default)
* * javascript : encode with javascript * * javascript : encode with javascript
* * javascript_charcode : encode with javascript charcode * * javascript_charcode : encode with javascript charcode
* * hex : encode with hexidecimal (no javascript) * * hex : encode with hexidecimal (no javascript)
* - cc = (optional) address(es) to carbon copy * - cc = (optional) address(es) to carbon copy
* - bcc = (optional) address(es) to blind carbon copy * - bcc = (optional) address(es) to blind carbon copy
* - subject = (optional) e-mail subject * - subject = (optional) e-mail subject
* - newsgroups = (optional) newsgroup(s) to post to * - newsgroups = (optional) newsgroup(s) to post to
* - followupto = (optional) address(es) to follow up to * - followupto = (optional) address(es) to follow up to
* - extra = (optional) extra tags for the href link * - extra = (optional) extra tags for the href link
* @param object $smarty Smarty object * @param object $smarty Smarty object
* @param object $template template object * @param object $template template object
* @return string * @return string
*/ */
function smarty_function_mailto($params, $smarty, $template) function smarty_function_mailto($params, $smarty, $template)
{ {
$extra = ''; $extra = '';
@@ -154,4 +154,4 @@ function smarty_function_mailto($params, $smarty, $template)
} }
} }
?> ?>

View File

@@ -7,7 +7,6 @@
* @subpackage PluginsFunction * @subpackage PluginsFunction
*/ */
/** /**
* Smarty {math} function plugin * Smarty {math} function plugin
* *
@@ -81,4 +80,5 @@ function smarty_function_math($params, $smarty, $template)
} }
} }
} }
?> ?>

View File

@@ -1,11 +1,11 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
*
* @package Smarty * @package Smarty
* @subpackage PluginsFunction * @subpackage PluginsFunction
*/ */
/** /**
* Smarty {popup} function plugin * Smarty {popup} function plugin
* *
@@ -115,4 +115,5 @@ function smarty_function_popup($params, $smarty, $template)
return $retval; return $retval;
} }
?>
?>

View File

@@ -1,25 +1,26 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* @package Smarty *
* @subpackage PluginsFunction * @package Smarty
*/ * @subpackage PluginsFunction
*/
/** /**
* Smarty {popup_init} function plugin * Smarty {popup_init} function plugin
* *
* Type: function<br> * Type: function<br>
* Name: popup_init<br> * Name: popup_init<br>
* Purpose: initialize overlib * Purpose: initialize overlib
* @link http://smarty.php.net/manual/en/language.function.popup.init.php {popup_init} * @link http://smarty.php.net/manual/en/language.function.popup.init.php {popup_init}
* (Smarty online manual) * (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com> * @author Monte Ohrt <monte at ohrt dot com>
* @param array $params parameters * @param array $params parameters
* @param object $smarty Smarty object * @param object $smarty Smarty object
* @param object $template template object * @param object $template template object
* @return string * @return string
*/ */
function smarty_function_popup_init($params, $smarty, $template) function smarty_function_popup_init($params, $smarty, $template)
{ {
$zindex = 1000; $zindex = 1000;
@@ -35,4 +36,5 @@ function smarty_function_popup_init($params, $smarty, $template)
trigger_error("popup_init: missing src parameter",E_USER_WARNING); trigger_error("popup_init: missing src parameter",E_USER_WARNING);
} }
} }
?> ?>

View File

@@ -1,30 +1,30 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsModifier * @subpackage PluginsModifier
*/ */
/** /**
* Smarty date_format modifier plugin * Smarty date_format modifier plugin
* *
* Type: modifier<br> * Type: modifier<br>
* Name: date_format<br> * Name: date_format<br>
* Purpose: format datestamps via strftime<br> * Purpose: format datestamps via strftime<br>
* Input:<br> * Input:<br>
* - string: input date string * - string: input date string
* - format: strftime format for output * - format: strftime format for output
* - default_date: default date if $string is empty * - 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) * @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> * @author Monte Ohrt <monte at ohrt dot com>
* @param string $ * @param string $
* @param string $ * @param string $
* @param string $ * @param string $
* @return string |void * @return string |void
* @uses smarty_make_timestamp() * @uses smarty_make_timestamp()
*/ */
function smarty_modifier_date_format($string, $format = SMARTY_RESOURCE_DATE_FORMAT, $default_date = '',$formatter='auto') function smarty_modifier_date_format($string, $format = SMARTY_RESOURCE_DATE_FORMAT, $default_date = '',$formatter='auto')
{ {
/** /**
@@ -58,4 +58,4 @@ function smarty_modifier_date_format($string, $format = SMARTY_RESOURCE_DATE_FOR
} }
} }
?> ?>

View File

@@ -1,25 +1,25 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage Debug * @subpackage Debug
*/ */
/** /**
* Smarty debug_print_var modifier plugin * Smarty debug_print_var modifier plugin
* *
* Type: modifier<br> * Type: modifier<br>
* Name: debug_print_var<br> * Name: debug_print_var<br>
* Purpose: formats variable contents for display in the console * 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) * @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> * @author Monte Ohrt <monte at ohrt dot com>
* @param array $ |object * @param array $ |object
* @param integer $ * @param integer $
* @param integer $ * @param integer $
* @return string * @return string
*/ */
function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40) function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40)
{ {
$_replace = array("\n" => '<i>\n</i>', $_replace = array("\n" => '<i>\n</i>',
@@ -84,4 +84,4 @@ function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40)
return $results; return $results;
} }
?> ?>

View File

@@ -1,12 +1,11 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsModifier * @subpackage PluginsModifier
*/ */
/** /**
* Smarty escape modifier plugin * Smarty escape modifier plugin
* *

View File

@@ -1,10 +1,10 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
*
* @package Smarty * @package Smarty
* @subpackage PluginsModifier * @subpackage PluginsModifier
*/ */
/** /**
* Smarty regex_replace modifier plugin * Smarty regex_replace modifier plugin
@@ -42,4 +42,5 @@ function _smarty_regex_replace_check($search)
} }
return $search; return $search;
} }
?> ?>

View File

@@ -1,7 +1,6 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
*
* @package Smarty * @package Smarty
* @subpackage PluginsModifier * @subpackage PluginsModifier
*/ */

View File

@@ -1,7 +1,6 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
*
* @package Smarty * @package Smarty
* @subpackage PluginsModifier * @subpackage PluginsModifier
*/ */

View File

@@ -1,11 +1,11 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsModifier * @subpackage PluginsModifier
*/ */
/** /**
* Smarty truncate modifier plugin * Smarty truncate modifier plugin
* *

View File

@@ -1,11 +1,11 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
*
* @package Smarty * @package Smarty
* @subpackage PluginsModifierCompiler * @subpackage PluginsModifierCompiler
*/ */
/** /**
* Smarty cat modifier plugin * Smarty cat modifier plugin
* *
@@ -23,7 +23,7 @@
*/ */
function smarty_modifiercompiler_cat($params, $compiler) function smarty_modifiercompiler_cat($params, $compiler)
{ {
return '('.implode(').(', $params).')'; return '('.implode(').(', $params).')';
} }
?> ?>

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsModifierCompiler * @subpackage PluginsModifierCompiler
*/ */
@@ -34,5 +34,6 @@ function smarty_modifiercompiler_count_characters($params, $compiler)
} }
return 'preg_match_all(\'/[^\s]/\',' . $params[0] . ', $tmp)'; return 'preg_match_all(\'/[^\s]/\',' . $params[0] . ', $tmp)';
} }
} }
?> ?>

View File

@@ -1,11 +1,11 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
*
* @package Smarty * @package Smarty
* @subpackage PluginsModifierCompiler * @subpackage PluginsModifierCompiler
*/ */
/** /**
* Smarty count_paragraphs modifier plugin * Smarty count_paragraphs modifier plugin
* *
@@ -23,4 +23,5 @@ function smarty_modifiercompiler_count_paragraphs($params, $compiler)
// count \r or \n characters // count \r or \n characters
return '(preg_match_all(\'#[\r\n]+#\', ' . $params[0] . ', $tmp)+1)'; return '(preg_match_all(\'#[\r\n]+#\', ' . $params[0] . ', $tmp)+1)';
} }
?> ?>

View File

@@ -1,11 +1,11 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
*
* @package Smarty * @package Smarty
* @subpackage PluginsModifierCompiler * @subpackage PluginsModifierCompiler
*/ */
/** /**
* Smarty count_sentences modifier plugin * Smarty count_sentences modifier plugin
* *

View File

@@ -17,7 +17,7 @@
* @author Uwe Tews * @author Uwe Tews
* @param array $params parameters * @param array $params parameters
* @return string with compiled code * @return string with compiled code
*/ */
function smarty_modifiercompiler_count_words($params, $compiler) function smarty_modifiercompiler_count_words($params, $compiler)
{ {
// mb_ functions available? // mb_ functions available?

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsModifierCompiler * @subpackage PluginsModifierCompiler
*/ */

View File

@@ -5,7 +5,6 @@
* @subpackage PluginsModifierCompiler * @subpackage PluginsModifierCompiler
*/ */
/** /**
* Smarty indent modifier plugin * Smarty indent modifier plugin
* *
@@ -18,6 +17,7 @@
* @param array $params parameters * @param array $params parameters
* @return string with compiled code * @return string with compiled code
*/ */
function smarty_modifiercompiler_indent($params, $compiler) function smarty_modifiercompiler_indent($params, $compiler)
{ {
if (!isset($params[1])) { if (!isset($params[1])) {

View File

@@ -1,24 +1,24 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* * @package Smarty
* @package Smarty * @subpackage PluginsModifierCompiler
* @subpackage PluginsModifierCompiler */
*/
/** /**
* Smarty lower modifier plugin * Smarty lower modifier plugin
* *
* Type: modifier<br> * Type: modifier<br>
* Name: lower<br> * Name: lower<br>
* Purpose: convert string to lowercase * Purpose: convert string to lowercase
* *
* @link http://smarty.php.net/manual/en/language.modifier.lower.php lower (Smarty online manual) * @link http://smarty.php.net/manual/en/language.modifier.lower.php lower (Smarty online manual)
* @author Monte Ohrt <monte at ohrt dot com> * @author Monte Ohrt <monte at ohrt dot com>
* @author Uwe Tews * @author Uwe Tews
* @param array $params parameters * @param array $params parameters
* @return string with compiled code * @return string with compiled code
*/ */
function smarty_modifiercompiler_lower($params, $compiler) function smarty_modifiercompiler_lower($params, $compiler)
{ {
if (function_exists('mb_strtolower')) { if (function_exists('mb_strtolower')) {

View File

@@ -1,11 +1,11 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
*
* @package Smarty * @package Smarty
* @subpackage PluginsModifierCompiler * @subpackage PluginsModifierCompiler
*/ */
/** /**
* Smarty noprint modifier plugin * Smarty noprint modifier plugin
* *

View File

@@ -1,26 +1,26 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsModifierCompiler * @subpackage PluginsModifierCompiler
*/ */
/** /**
* Smarty string_format modifier plugin * Smarty string_format modifier plugin
* *
* Type: modifier<br> * Type: modifier<br>
* Name: string_format<br> * Name: string_format<br>
* Purpose: format strings via sprintf * Purpose: format strings via sprintf
* *
* @link http://smarty.php.net/manual/en/language.modifier.string.format.php string_format (Smarty online manual) * @link http://smarty.php.net/manual/en/language.modifier.string.format.php string_format (Smarty online manual)
* @author Uwe Tews * @author Uwe Tews
* @param array $params parameters * @param array $params parameters
* @return string with compiled code * @return string with compiled code
*/ */
function smarty_modifiercompiler_string_format($params, $compiler) function smarty_modifiercompiler_string_format($params, $compiler)
{ {
return 'sprintf(' . $params[1] . ',' . $params[0] . ')'; return 'sprintf(' . $params[1] . ',' . $params[0] . ')';
} }
?> ?>

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsModifierCompiler * @subpackage PluginsModifierCompiler
*/ */
@@ -21,6 +21,7 @@
* @param array $params parameters * @param array $params parameters
* @return string with compiled code * @return string with compiled code
*/ */
function smarty_modifiercompiler_strip($params, $compiler) function smarty_modifiercompiler_strip($params, $compiler)
{ {
if (!isset($params[1])) { if (!isset($params[1])) {

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsModifierCompiler * @subpackage PluginsModifierCompiler
*/ */
@@ -18,6 +18,7 @@
* @param array $params parameters * @param array $params parameters
* @return string with compiled code * @return string with compiled code
*/ */
function smarty_modifiercompiler_strip_tags($params, $compiler) function smarty_modifiercompiler_strip_tags($params, $compiler)
{ {
if (!isset($params[1])) { if (!isset($params[1])) {

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsModifierCompiler * @subpackage PluginsModifierCompiler
*/ */

View File

@@ -1,7 +1,7 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsModifierCompiler * @subpackage PluginsModifierCompiler
*/ */

View File

@@ -1,6 +1,7 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
*
* @package Smarty * @package Smarty
* @subpackage PluginsFilter * @subpackage PluginsFilter
*/ */
@@ -73,4 +74,4 @@ function smarty_outputfilter_trimwhitespace_replace($search_str, $replace, &$sub
} }
?> ?>

View File

@@ -1,11 +1,11 @@
<?php <?php
/** /**
* Smarty shared plugin * Smarty shared plugin
*
* @package Smarty * @package Smarty
* @subpackage PluginsShared * @subpackage PluginsShared
*/ */
/** /**
* escape_special_chars common function * escape_special_chars common function
* *
@@ -25,4 +25,5 @@ function smarty_function_escape_special_chars($string)
} }
return $string; return $string;
} }
?> ?>

View File

@@ -1,11 +1,11 @@
<?php <?php
/** /**
* Smarty shared plugin * Smarty shared plugin
*
* @package Smarty * @package Smarty
* @subpackage PluginsShared * @subpackage PluginsShared
*/ */
/** /**
* Function: smarty_make_timestamp<br> * Function: smarty_make_timestamp<br>
* Purpose: used by other smarty functions to make a timestamp * Purpose: used by other smarty functions to make a timestamp
@@ -14,6 +14,7 @@
* @param string $string * @param string $string
* @return string * @return string
*/ */
function smarty_make_timestamp($string) function smarty_make_timestamp($string)
{ {
if(empty($string)) { if(empty($string)) {
@@ -38,4 +39,5 @@ function smarty_make_timestamp($string)
return $time; return $time;
} }
} }
?> ?>

View File

@@ -1,18 +1,19 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsFilter * @subpackage PluginsFilter
*/ */
/** /**
* Smarty htmlspecialchars variablefilter plugin * Smarty htmlspecialchars variablefilter plugin
* *
* @param string $source input string * @param string $source input string
* @param object $ &$smarty Smarty object * @param object $ &$smarty Smarty object
* @return string filtered output * @return string filtered output
*/ */
function smarty_variablefilter_htmlspecialchars($source, $smarty) function smarty_variablefilter_htmlspecialchars($source, $smarty)
{ {
return htmlspecialchars($source, ENT_QUOTES); return htmlspecialchars($source, ENT_QUOTES);

View File

@@ -1,17 +1,18 @@
<?php <?php
/** /**
* Smarty Internal Plugin Compile Append * Smarty Internal Plugin Compile Append
* *
* Compiles the {append} tag * Compiles the {append} tag
* *
* @package Smarty * @package Smarty
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Append Class * Smarty Internal Plugin Compile Append Class
*/ */
class Smarty_Internal_Compile_Append extends Smarty_Internal_CompileBase { class Smarty_Internal_Compile_Append extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the {append} tag * Compiles code for the {append} tag

View File

@@ -9,6 +9,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Assign Class * Smarty Internal Plugin Compile Assign Class
*/ */

View File

@@ -8,6 +8,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Block Class * Smarty Internal Plugin Compile Block Class
*/ */

View File

@@ -9,6 +9,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Function_Call Class * Smarty Internal Plugin Compile Function_Call Class
*/ */
@@ -71,7 +72,7 @@ class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase {
} }
} }
$_params = 'array(' . implode(",", $_paramsArray) . ')'; $_params = 'array(' . implode(",", $_paramsArray) . ')';
$_hash = str_replace('-','_',$compiler->template->properties['nocache_hash']); $_hash = str_replace('-','_',$compiler->template->properties['nocache_hash']);
// was there an assign attribute // was there an assign attribute
if (isset($_assign)) { if (isset($_assign)) {
if ($compiler->template->caching) { if ($compiler->template->caching) {

View File

@@ -1,24 +1,25 @@
<?php <?php
/** /**
* Smarty Internal Plugin Compile Capture * Smarty Internal Plugin Compile Capture
* *
* Compiles the {capture} tag * Compiles the {capture} tag
* *
* @package Smarty * @package Smarty
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Capture Class * Smarty Internal Plugin Compile Capture Class
*/ */
class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase { class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the {capture} tag * Compiles code for the {capture} tag
* *
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;
@@ -39,16 +40,16 @@ class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase {
} }
/** /**
* Smarty Internal Plugin Compile Captureclose Class * Smarty Internal Plugin Compile Captureclose Class
*/ */
class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase { class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the {/capture} tag * Compiles code for the {/capture} tag
* *
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;
@@ -69,4 +70,4 @@ class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase {
} }
} }
?> ?>

View File

@@ -9,6 +9,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Config Load Class * Smarty Internal Plugin Compile Config Load Class
*/ */

View File

@@ -1,24 +1,25 @@
<?php <?php
/** /**
* Smarty Internal Plugin Compile Debug * Smarty Internal Plugin Compile Debug
* *
* Compiles the {debug} tag * Compiles the {debug} tag
* It opens a window the the Smarty Debugging Console * It opens a window the the Smarty Debugging Console
* @package Smarty * @package Smarty
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Debug Class * Smarty Internal Plugin Compile Debug Class
*/ */
class Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase { class Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the {debug} tag * Compiles code for the {debug} tag
* *
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;
@@ -31,4 +32,4 @@ class Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase {
} }
} }
?> ?>

View File

@@ -1,24 +1,25 @@
<?php <?php
/** /**
* Smarty Internal Plugin Compile Eval * Smarty Internal Plugin Compile Eval
* *
* Compiles the {eval} tag * Compiles the {eval} tag
* @package Smarty * @package Smarty
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Eval Class * Smarty Internal Plugin Compile Eval Class
*/ */
class Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase { class Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the {eval} tag * Compiles code for the {eval} tag
* *
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;
@@ -43,4 +44,4 @@ class Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase {
} }
} }
?> ?>

View File

@@ -9,6 +9,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile extend Class * Smarty Internal Plugin Compile extend Class
*/ */

View File

@@ -8,6 +8,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile For Class * Smarty Internal Plugin Compile For Class
*/ */

View File

@@ -8,6 +8,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Foreach Class * Smarty Internal Plugin Compile Foreach Class
*/ */

View File

@@ -8,6 +8,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Function Class * Smarty Internal Plugin Compile Function Class
*/ */
@@ -40,9 +41,9 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase {
$output = ''; $output = '';
} else { } else {
$output = "<?php if (!function_exists('smarty_template_function_{$_name}')) { $output = "<?php if (!function_exists('smarty_template_function_{$_name}')) {
function smarty_template_function_{$_name}(\$_smarty_tpl,\$params) { function smarty_template_function_{$_name}(\$_smarty_tpl,\$params) {
\$saved_tpl_vars = \$_smarty_tpl->tpl_vars; \$saved_tpl_vars = \$_smarty_tpl->tpl_vars;
foreach (\$params 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);}?>";
} }
// Init temporay context // Init temporay context
$compiler->template->required_plugins = array('compiled' => array(), 'nocache' => array()); $compiler->template->required_plugins = array('compiled' => array(), 'nocache' => array());

View File

@@ -1,24 +1,25 @@
<?php <?php
/** /**
* Smarty Internal Plugin Compile If * Smarty Internal Plugin Compile If
* *
* Compiles the {if} {else} {elseif} {/if} tags * Compiles the {if} {else} {elseif} {/if} tags
* *
* @package Smarty * @package Smarty
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile If Class * Smarty Internal Plugin Compile If Class
*/ */
class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase { class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the {if} tag * Compiles code for the {if} tag
* *
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;
@@ -37,16 +38,16 @@ class Smarty_Internal_Compile_If extends Smarty_Internal_CompileBase {
} }
/** /**
* Smarty Internal Plugin Compile Else Class * Smarty Internal Plugin Compile Else Class
*/ */
class Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase { class Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the {else} tag * Compiles code for the {else} tag
* *
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;
@@ -58,16 +59,16 @@ class Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase {
} }
/** /**
* Smarty Internal Plugin Compile ElseIf Class * Smarty Internal Plugin Compile ElseIf Class
*/ */
class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase { class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the {elseif} tag * Compiles code for the {elseif} tag
* *
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;
@@ -111,4 +112,4 @@ class Smarty_Internal_Compile_Ifclose extends Smarty_Internal_CompileBase {
} }
} }
?> ?>

View File

@@ -9,6 +9,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Include Class * Smarty Internal Plugin Compile Include Class
*/ */

View File

@@ -1,25 +1,26 @@
<?php <?php
/** /**
* Smarty Internal Plugin Compile Include PHP * Smarty Internal Plugin Compile Include PHP
* *
* Compiles the {include_php} tag * Compiles the {include_php} tag
* *
* @package Smarty * @package Smarty
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @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 { class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the {include_php} tag * Compiles code for the {include_php} tag
* *
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;
@@ -65,4 +66,4 @@ class Smarty_Internal_Compile_Include_Php extends Smarty_Internal_CompileBase {
} }
} }
?> ?>

View File

@@ -9,6 +9,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Insert Class * Smarty Internal Plugin Compile Insert Class
*/ */

View File

@@ -1,25 +1,26 @@
<?php <?php
/** /**
* Smarty Internal Plugin Compile Ldelim * Smarty Internal Plugin Compile Ldelim
* *
* Compiles the {ldelim} tag * Compiles the {ldelim} tag
* @package Smarty * @package Smarty
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Ldelim Class * Smarty Internal Plugin Compile Ldelim Class
*/ */
class Smarty_Internal_Compile_Ldelim extends Smarty_Internal_CompileBase { class Smarty_Internal_Compile_Ldelim extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the {ldelim} tag * Compiles code for the {ldelim} tag
* *
* This tag does output the left delimiter * This tag does output the left delimiter
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;
@@ -28,5 +29,6 @@ class Smarty_Internal_Compile_Ldelim extends Smarty_Internal_CompileBase {
$this->compiler->has_code = true; $this->compiler->has_code = true;
return $this->compiler->smarty->left_delimiter; return $this->compiler->smarty->left_delimiter;
} }
} }
?> ?>

View File

@@ -1,25 +1,26 @@
<?php <?php
/** /**
* Smarty Internal Plugin Compile Nocache * Smarty Internal Plugin Compile Nocache
* *
* Compiles the {nocache} {/nocache} tags * Compiles the {nocache} {/nocache} tags
* @package Smarty * @package Smarty
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Nocache Class * Smarty Internal Plugin Compile Nocache Class
*/ */
class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase { class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the {nocache} tag * Compiles code for the {nocache} tag
* *
* This tag does not generate compiled output. It only sets a compiler flag * This tag does not generate compiled output. It only sets a compiler flag
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;
@@ -33,17 +34,17 @@ class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase {
} }
/** /**
* Smarty Internal Plugin Compile Nocacheclose Class * Smarty Internal Plugin Compile Nocacheclose Class
*/ */
class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase { class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the {/nocache} tag * Compiles code for the {/nocache} tag
* *
* This tag does not generate compiled output. It only sets a compiler flag * This tag does not generate compiled output. It only sets a compiler flag
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;
@@ -56,4 +57,4 @@ class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase {
} }
} }
?> ?>

View File

@@ -8,6 +8,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Block Plugin Class * Smarty Internal Plugin Compile Block Plugin Class
*/ */

View File

@@ -8,6 +8,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Function Plugin Class * Smarty Internal Plugin Compile Function Plugin Class
*/ */

View File

@@ -8,6 +8,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Modifier Class * Smarty Internal Plugin Compile Modifier Class
*/ */

View File

@@ -1,26 +1,27 @@
<?php <?php
/** /**
* Smarty Internal Plugin Compile Object Block Function * Smarty Internal Plugin Compile Object Block Function
* *
* Compiles code for registered objects as block function * Compiles code for registered objects as block function
* *
* @package Smarty * @package Smarty
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @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 { class Smarty_Internal_Compile_Private_Object_Block_Function extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the execution of block plugin * Compiles code for the execution of block plugin
* *
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param string $tag name of block function * @param string $tag name of block function
* @param string $methode name of methode to call * @param string $methode name of methode to call
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler, $tag, $methode) public function compile($args, $compiler, $tag, $methode)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;

View File

@@ -8,6 +8,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Object Function Class * Smarty Internal Plugin Compile Object Function Class
*/ */
@@ -55,8 +56,9 @@ class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_Co
$output = "<?php echo {$return};?>\n"; $output = "<?php echo {$return};?>\n";
} else { } else {
$output = "<?php \$_smarty_tpl->assign({$_assign},{$return});?>\n"; $output = "<?php \$_smarty_tpl->assign({$_assign},{$return});?>\n";
} }
return $output; return $output;
} }
} }
?> ?>

View File

@@ -8,6 +8,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Print Expression Class * Smarty Internal Plugin Compile Print Expression Class
*/ */
@@ -58,7 +59,7 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C
if (isset($_attr['modifierlist'])) { if (isset($_attr['modifierlist'])) {
$output = $this->compiler->compileTag('private_modifier', array('modifierlist' => $_attr['modifierlist'], 'value' => $output)); $output = $this->compiler->compileTag('private_modifier', array('modifierlist' => $_attr['modifierlist'], 'value' => $output));
} }
$this->compiler->has_output = true; $this->compiler->has_output = true;
$output = '<?php echo ' . $output . ';?>'; $output = '<?php echo ' . $output . ';?>';
} }
return $output; return $output;

View File

@@ -1,25 +1,26 @@
<?php <?php
/** /**
* Smarty Internal Plugin Compile Registered Block * Smarty Internal Plugin Compile Registered Block
* *
* Compiles code for the execution of a registered block function * Compiles code for the execution of a registered block function
* *
* @package Smarty * @package Smarty
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Registered Block Class * Smarty Internal Plugin Compile Registered Block Class
*/ */
class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_CompileBase { class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the execution of a block function * Compiles code for the execution of a block function
* *
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param string $tag name of block function * @param string $tag name of block function
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler, $tag) public function compile($args, $compiler, $tag)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;

View File

@@ -8,6 +8,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Registered Function Class * Smarty Internal Plugin Compile Registered Function Class
*/ */

View File

@@ -1,24 +1,25 @@
<?php <?php
/** /**
* Smarty Internal Plugin Compile Special Smarty Variable * Smarty Internal Plugin Compile Special Smarty Variable
* *
* Compiles the special $smarty variables * Compiles the special $smarty variables
* *
* @package Smarty * @package Smarty
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @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 { class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the speical $smarty variables * Compiles code for the speical $smarty variables
* *
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$_index = explode(',', str_replace(array(']['), array(','), substr($args, 1, strlen($args)-2))); $_index = explode(',', str_replace(array(']['), array(','), substr($args, 1, strlen($args)-2)));

View File

@@ -1,25 +1,26 @@
<?php <?php
/** /**
* Smarty Internal Plugin Compile Rdelim * Smarty Internal Plugin Compile Rdelim
* *
* Compiles the {rdelim} tag * Compiles the {rdelim} tag
* @package Smarty * @package Smarty
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Rdelim Class * Smarty Internal Plugin Compile Rdelim Class
*/ */
class Smarty_Internal_Compile_Rdelim extends Smarty_Internal_CompileBase { class Smarty_Internal_Compile_Rdelim extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the {rdelim} tag * Compiles code for the {rdelim} tag
* *
* This tag does output the right delimiter * This tag does output the right delimiter
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;
@@ -28,5 +29,6 @@ class Smarty_Internal_Compile_Rdelim extends Smarty_Internal_CompileBase {
$this->compiler->has_code = true; $this->compiler->has_code = true;
return $this->compiler->smarty->right_delimiter; return $this->compiler->smarty->right_delimiter;
} }
} }
?>
?>

View File

@@ -1,24 +1,25 @@
<?php <?php
/** /**
* Smarty Internal Plugin Compile Section * Smarty Internal Plugin Compile Section
* *
* Compiles the {section} {sectionelse} {/section} tags * Compiles the {section} {sectionelse} {/section} tags
* *
* @package Smarty * @package Smarty
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Section Class * Smarty Internal Plugin Compile Section Class
*/ */
class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase { class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the {section} tag * Compiles code for the {section} tag
* *
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;
@@ -28,8 +29,8 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase {
$_attr = $this->_get_attributes($args); $_attr = $this->_get_attributes($args);
$this->_open_tag('section', array('section',$this->compiler->nocache)); $this->_open_tag('section', array('section',$this->compiler->nocache));
// maybe nocache because of nocache variables // maybe nocache because of nocache variables
$this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache; $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
$output = "<?php "; $output = "<?php ";
@@ -116,12 +117,12 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_CompileBase {
*/ */
class Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase { class Smarty_Internal_Compile_Sectionelse extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the {sectionelse} tag * Compiles code for the {sectionelse} tag
* *
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;
@@ -136,24 +137,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 { class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase {
/** /**
* Compiles code for the {/section} tag * Compiles code for the {/section} tag
* *
* @param array $args array with attributes from parser * @param array $args array with attributes from parser
* @param object $compiler compiler object * @param object $compiler compiler object
* @return string compiled code * @return string compiled code
*/ */
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;
// check and get attributes // check and get attributes
$_attr = $this->_get_attributes($args); $_attr = $this->_get_attributes($args);
// must endblock be nocache? // must endblock be nocache?
if ($this->compiler->nocache) { if ($this->compiler->nocache) {
$this->compiler->tag_nocache = true; $this->compiler->tag_nocache = true;
} }
@@ -166,5 +167,4 @@ class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase {
} }
} }
?>
?>

View File

@@ -8,6 +8,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile While Class * Smarty Internal Plugin Compile While Class
*/ */
@@ -28,9 +29,9 @@ class Smarty_Internal_Compile_While extends Smarty_Internal_CompileBase {
$this->_open_tag('while', $this->compiler->nocache); $this->_open_tag('while', $this->compiler->nocache);
// maybe nocache because of nocache variables // maybe nocache because of nocache variables
$this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache; $this->compiler->nocache = $this->compiler->nocache | $this->compiler->tag_nocache;
if (is_array($args['if condition'])) { 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 = " <?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 ?>"; $_output .= " while (\$_smarty_tpl->tpl_vars[".$args['if condition']['var']."]->value = ".$args['if condition']['value'].") {\n ?>";
@@ -55,12 +56,13 @@ class Smarty_Internal_Compile_Whileclose extends Smarty_Internal_CompileBase {
public function compile($args, $compiler) public function compile($args, $compiler)
{ {
$this->compiler = $compiler; $this->compiler = $compiler;
// must endblock be nocache? // must endblock be nocache?
if ($this->compiler->nocache) { if ($this->compiler->nocache) {
$this->compiler->tag_nocache = true; $this->compiler->tag_nocache = true;
} }
$this->compiler->nocache = $this->_close_tag(array('while')); $this->compiler->nocache = $this->_close_tag(array('while'));
return "<?php }?>"; return "<?php }?>";
} }
} }
?>
?>

View File

@@ -10,6 +10,7 @@
* @subpackage Config * @subpackage Config
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Main config file compiler class * Main config file compiler class
*/ */

View File

@@ -7,6 +7,7 @@
* @subpackage Config * @subpackage Config
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Configfilelexer * Smarty Internal Plugin Configfilelexer
*/ */
@@ -20,10 +21,10 @@ class Smarty_Internal_Configfilelexer
public $node; public $node;
public $line; public $line;
private $state = 1; private $state = 1;
public $smarty_token_names = array ( // Text for parser error messages public $smarty_token_names = array ( // Text for parser error messages
); );
function __construct($data, $smarty) function __construct($data, $smarty)
{ {
// set instance object // set instance object
@@ -521,6 +522,6 @@ class Smarty_Internal_Configfilelexer
$this->yypopstate(); $this->yypopstate();
} }
} }
?>
?>

View File

@@ -164,7 +164,7 @@ class Smarty_Internal_Configfileparser#line 79 "smarty_internal_configfileparser
private function add_global_vars(Array $vars) { private function add_global_vars(Array $vars) {
if (!isset($this->compiler->config_data['vars'])) { if (!isset($this->compiler->config_data['vars'])) {
$this->compiler->config_data['vars'] = Array(); $this->compiler->config_data['vars'] = Array();
} }
foreach ($vars as $var) { foreach ($vars as $var) {
$this->set_var($var, $this->compiler->config_data); $this->set_var($var, $this->compiler->config_data);
@@ -404,7 +404,7 @@ static public $yy_action = array(
$this->yystack[$this->yyidx]->stateno, $this->yystack[$this->yyidx]->stateno,
self::$yyRuleInfo[$yyruleno]['lhs']); self::$yyRuleInfo[$yyruleno]['lhs']);
if (isset(self::$yyExpectedTokens[$nextstate])) { if (isset(self::$yyExpectedTokens[$nextstate])) {
$expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]); $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]);
if (in_array($token, if (in_array($token,
self::$yyExpectedTokens[$nextstate], true)) { self::$yyExpectedTokens[$nextstate], true)) {
$this->yyidx = $yyidx; $this->yyidx = $yyidx;
@@ -439,8 +439,8 @@ static public $yy_action = array(
} }
break; break;
} while (true); } while (true);
$this->yyidx = $yyidx; $this->yyidx = $yyidx;
$this->yystack = $stack; $this->yystack = $stack;
return array_unique($expected); return array_unique($expected);
} }
@@ -868,4 +868,5 @@ static public $yy_action = array(
} while ($yymajor != self::YYNOCODE && $this->yyidx >= 0); } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0);
} }
} }
?> ?>

View File

@@ -9,6 +9,7 @@
* @subpackage Debug * @subpackage Debug
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Debug Class * Smarty Internal Plugin Debug Class
*/ */

View File

@@ -6,6 +6,7 @@
* @subpackage PluginsInternal * @subpackage PluginsInternal
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* This class does call function defined with the {function} tag * This class does call function defined with the {function} tag
*/ */
@@ -20,8 +21,8 @@ class Smarty_Internal_Function_Call_Handler extends Smarty_Internal_Template {
} }
if (!is_callable($_function)) { if (!is_callable($_function)) {
$_code = "function {$_function}(\$_smarty_tpl,\$params) { $_code = "function {$_function}(\$_smarty_tpl,\$params) {
\$saved_tpl_vars = \$_smarty_tpl->tpl_vars; \$saved_tpl_vars = \$_smarty_tpl->tpl_vars;
foreach (\$params as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);}?>"; foreach (\$params as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);}?>";
if ($_nocache) { if ($_nocache) {
$_code .= preg_replace(array("!<\?php echo \\'/\*%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/|/\*/%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/\\';\?>!", $_code .= preg_replace(array("!<\?php echo \\'/\*%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/|/\*/%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/\\';\?>!",
"!\\\'!"), array('', "'"), $_template->smarty->template_functions[$_name]['compiled']); "!\\\'!"), array('', "'"), $_template->smarty->template_functions[$_name]['compiled']);

View File

@@ -9,6 +9,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Compile Insert Class * Smarty Internal Plugin Compile Insert Class
*/ */

View File

@@ -9,13 +9,14 @@
* @author Thue Kristensen * @author Thue Kristensen
* @author Uwe Tews * @author Uwe Tews
*/ */
abstract class _smarty_parsetree { abstract class _smarty_parsetree {
abstract public function to_smarty_php(); abstract public function to_smarty_php();
} }
/**
/* A complete smarty tag. */ * A complete smarty tag.
*/
class _smarty_tag extends _smarty_parsetree class _smarty_tag extends _smarty_parsetree
{ {
public $parser; public $parser;
@@ -42,7 +43,9 @@ class _smarty_tag extends _smarty_parsetree
} }
} }
/* Code fragment inside a tag. */ /**
* Code fragment inside a tag.
*/
class _smarty_code extends _smarty_parsetree { class _smarty_code extends _smarty_parsetree {
public $parser; public $parser;
public $data; public $data;
@@ -58,7 +61,9 @@ class _smarty_code extends _smarty_parsetree {
} }
} }
/* Double quoted string inside a tag. */ /**
* Double quoted string inside a tag.
*/
class _smarty_doublequoted extends _smarty_parsetree { class _smarty_doublequoted extends _smarty_parsetree {
public $parser; public $parser;
public $subtrees = Array(); public $subtrees = Array();
@@ -113,7 +118,9 @@ class _smarty_doublequoted extends _smarty_parsetree {
} }
} }
/* Raw chars as part of a double quoted string. */ /**
* Raw chars as part of a double quoted string.
*/
class _smarty_dq_content extends _smarty_parsetree { class _smarty_dq_content extends _smarty_parsetree {
public $data; public $data;
function __construct($parser, $data) function __construct($parser, $data)
@@ -127,7 +134,10 @@ class _smarty_dq_content extends _smarty_parsetree {
return '"' . $this->data . '"'; return '"' . $this->data . '"';
} }
} }
/* Template element */
/**
* Template element
*/
class _smarty_template_buffer extends _smarty_parsetree { class _smarty_template_buffer extends _smarty_parsetree {
public $subtrees = Array(); public $subtrees = Array();
function __construct($parser) function __construct($parser)
@@ -160,7 +170,7 @@ class _smarty_template_buffer extends _smarty_parsetree {
$code = substr($code, 0, strlen($code)-1) . '<<?php ?>?' . substr($subtree, 1); $code = substr($code, 0, strlen($code)-1) . '<<?php ?>?' . substr($subtree, 1);
} elseif ($this->parser->asp_tags && substr($subtree, 0, 1) == '%') { } elseif ($this->parser->asp_tags && substr($subtree, 0, 1) == '%') {
$code = substr($code, 0, strlen($code)-1) . '<<?php ?>%' . substr($subtree, 1); $code = substr($code, 0, strlen($code)-1) . '<<?php ?>%' . substr($subtree, 1);
} else { } else {
$code .= $subtree; $code .= $subtree;
} }
continue; continue;
@@ -169,7 +179,7 @@ class _smarty_template_buffer extends _smarty_parsetree {
$subtree = $this->subtrees[$key]->to_smarty_php(); $subtree = $this->subtrees[$key]->to_smarty_php();
if (substr($subtree, 0, 1) == '>') { if (substr($subtree, 0, 1) == '>') {
$code = substr($code, 0, strlen($code)-1) . '%<?php ?>>' . substr($subtree, 1); $code = substr($code, 0, strlen($code)-1) . '%<?php ?>>' . substr($subtree, 1);
} else { } else {
$code .= $subtree; $code .= $subtree;
} }
continue; continue;
@@ -178,7 +188,7 @@ class _smarty_template_buffer extends _smarty_parsetree {
$subtree = $this->subtrees[$key]->to_smarty_php(); $subtree = $this->subtrees[$key]->to_smarty_php();
if (substr($subtree, 0, 1) == '>') { if (substr($subtree, 0, 1) == '>') {
$code = substr($code, 0, strlen($code)-1) . '?<?php ?>>' . substr($subtree, 1); $code = substr($code, 0, strlen($code)-1) . '?<?php ?>>' . substr($subtree, 1);
} else { } else {
$code .= $subtree; $code .= $subtree;
} }
continue; continue;
@@ -187,8 +197,11 @@ class _smarty_template_buffer extends _smarty_parsetree {
} }
return $code; return $code;
} }
} }
/* template text */
/**
* template text
*/
class _smarty_text extends _smarty_parsetree { class _smarty_text extends _smarty_parsetree {
public $data; public $data;
function __construct($parser, $data) function __construct($parser, $data)
@@ -202,7 +215,10 @@ class _smarty_text extends _smarty_parsetree {
return $this->data; return $this->data;
} }
} }
/* template linebreaks */
/**
* template linebreaks
*/
class _smarty_linebreak extends _smarty_parsetree { class _smarty_linebreak extends _smarty_parsetree {
public $data; public $data;
function __construct($parser, $data) function __construct($parser, $data)

View File

@@ -260,3 +260,5 @@ class Smarty_Internal_Register {
} }
} }
} }
?>

View File

@@ -9,6 +9,7 @@
* @subpackage TemplateResources * @subpackage TemplateResources
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Resource Extends * Smarty Internal Plugin Resource Extends
*/ */
@@ -127,14 +128,18 @@ class Smarty_Internal_Resource_Extends {
} }
} }
// $_template->template_filepath = $saved_filepath; // $_template->template_filepath = $saved_filepath;
} }
/**
* saveBlockData
*/
protected function saveBlockData($block_content, $block_tag, $_filepath) protected function saveBlockData($block_content, $block_tag, $_filepath)
{ {
if (0 == preg_match("!(.?)(name=)(.*?)(?=(\s|{$this->_rdl}))!", $block_tag, $_match)) { if (0 == preg_match("!(.?)(name=)(.*?)(?=(\s|{$this->_rdl}))!", $block_tag, $_match)) {
$this->smarty->trigger_error("'{$block_tag}' missing name attribute in file '$_filepath'"); $this->smarty->trigger_error("'{$block_tag}' missing name attribute in file '$_filepath'");
} else { } else {
$_name = trim($_match[3], '\'"'); $_name = trim($_match[3], '\'"');
// replace {$smarty.block.child} // replace {$smarty.block.child}
if (strpos($block_content, $this->smarty->left_delimiter . '$smarty.block.child' . $this->smarty->right_delimiter) !== false) { if (strpos($block_content, $this->smarty->left_delimiter . '$smarty.block.child' . $this->smarty->right_delimiter) !== false) {
if (isset($this->smarty->block_data[$_name])) { if (isset($this->smarty->block_data[$_name])) {
$block_content = str_replace($this->smarty->left_delimiter . '$smarty.block.child' . $this->smarty->right_delimiter, $block_content = str_replace($this->smarty->left_delimiter . '$smarty.block.child' . $this->smarty->right_delimiter,

View File

@@ -1,17 +1,18 @@
<?php <?php
/** /**
* Smarty Internal Plugin Resource File * Smarty Internal Plugin Resource File
* *
* Implements the file system as resource for Smarty templates * Implements the file system as resource for Smarty templates
* *
* @package Smarty * @package Smarty
* @subpackage TemplateResources * @subpackage TemplateResources
* @author Uwe Tews * @author Uwe Tews
*/ */
/**
* Smarty Internal Plugin Resource File /**
*/ * Smarty Internal Plugin Resource File
*/
class Smarty_Internal_Resource_File { class Smarty_Internal_Resource_File {
public function __construct($smarty) public function __construct($smarty)
{ {
@@ -26,10 +27,10 @@ class Smarty_Internal_Resource_File {
public $isEvaluated = false; public $isEvaluated = false;
/** /**
* Return flag if template source is existing * Return flag if template source is existing
* *
* @return boolean true * @return boolean true
*/ */
public function isExisting($template) public function isExisting($template)
{ {
if ($template->getTemplateFilepath() === false) { if ($template->getTemplateFilepath() === false) {
@@ -40,11 +41,11 @@ class Smarty_Internal_Resource_File {
} }
/** /**
* Get filepath to template source * Get filepath to template source
* *
* @param object $_template template object * @param object $_template template object
* @return string filepath to template source file * @return string filepath to template source file
*/ */
public function getTemplateFilepath($_template) public function getTemplateFilepath($_template)
{ {
$_filepath = $_template->buildTemplateFilepath (); $_filepath = $_template->buildTemplateFilepath ();
@@ -59,22 +60,22 @@ class Smarty_Internal_Resource_File {
} }
/** /**
* Get timestamp to template source * Get timestamp to template source
* *
* @param object $_template template object * @param object $_template template object
* @return integer timestamp of template source file * @return integer timestamp of template source file
*/ */
public function getTemplateTimestamp($_template) public function getTemplateTimestamp($_template)
{ {
return filemtime($_template->getTemplateFilepath()); return filemtime($_template->getTemplateFilepath());
} }
/** /**
* Read template source from file * Read template source from file
* *
* @param object $_template template object * @param object $_template template object
* @return string content of template source file * @return string content of template source file
*/ */
public function getTemplateSource($_template) public function getTemplateSource($_template)
{ {
// read template file // read template file
@@ -87,11 +88,11 @@ class Smarty_Internal_Resource_File {
} }
/** /**
* Get filepath to compiled template * Get filepath to compiled template
* *
* @param object $_template template object * @param object $_template template object
* @return string return path to compiled template * @return string return path to compiled template
*/ */
public function getCompiledFilepath($_template) public function getCompiledFilepath($_template)
{ {
$_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;
@@ -124,4 +125,4 @@ class Smarty_Internal_Resource_File {
} }
} }
?> ?>

View File

@@ -1,21 +1,22 @@
<?php <?php
/** /**
* Smarty Internal Plugin Resource PHP * Smarty Internal Plugin Resource PHP
* *
* Implements the file system as resource for PHP templates * Implements the file system as resource for PHP templates
* *
* @package Smarty * @package Smarty
* @subpackage TemplateResources * @subpackage TemplateResources
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Resource PHP * Smarty Internal Plugin Resource PHP
*/ */
class Smarty_Internal_Resource_PHP { class Smarty_Internal_Resource_PHP {
/** /**
* Class constructor, enable short open tags * Class constructor, enable short open tags
*/ */
public function __construct($smarty) public function __construct($smarty)
{ {
$this->smarty = $smarty; $this->smarty = $smarty;
@@ -26,10 +27,10 @@ class Smarty_Internal_Resource_PHP {
public $isEvaluated = false; public $isEvaluated = false;
/** /**
* Return flag if template source is existing * Return flag if template source is existing
* *
* @return boolean true * @return boolean true
*/ */
public function isExisting($template) public function isExisting($template)
{ {
if ($template->getTemplateFilepath() === false) { if ($template->getTemplateFilepath() === false) {
@@ -40,11 +41,11 @@ class Smarty_Internal_Resource_PHP {
} }
/** /**
* Get filepath to template source * Get filepath to template source
* *
* @param object $_template template object * @param object $_template template object
* @return string filepath to template source file * @return string filepath to template source file
*/ */
public function getTemplateFilepath($_template) public function getTemplateFilepath($_template)
{ {
$_filepath = $_template->buildTemplateFilepath (); $_filepath = $_template->buildTemplateFilepath ();
@@ -57,22 +58,22 @@ class Smarty_Internal_Resource_PHP {
} }
/** /**
* Get timestamp to template source * Get timestamp to template source
* *
* @param object $_template template object * @param object $_template template object
* @return integer timestamp of template source file * @return integer timestamp of template source file
*/ */
public function getTemplateTimestamp($_template) public function getTemplateTimestamp($_template)
{ {
return filemtime($_template->getTemplateFilepath()); return filemtime($_template->getTemplateFilepath());
} }
/** /**
* Read template source from file * Read template source from file
* *
* @param object $_template template object * @param object $_template template object
* @return string content of template source file * @return string content of template source file
*/ */
public function getTemplateSource($_template) public function getTemplateSource($_template)
{ {
if (file_exists($_template->getTemplateFilepath())) { if (file_exists($_template->getTemplateFilepath())) {
@@ -83,13 +84,12 @@ class Smarty_Internal_Resource_PHP {
} }
} }
/** /**
* Get filepath to compiled template * Get filepath to compiled template
* *
* @param object $_template template object * @param object $_template template object
* @return boolean return false as compiled template is not stored * @return boolean return false as compiled template is not stored
*/ */
public function getCompiledFilepath($_template) public function getCompiledFilepath($_template)
{ {
// no filepath for PHP templates // no filepath for PHP templates
@@ -97,8 +97,8 @@ class Smarty_Internal_Resource_PHP {
} }
/** /**
* renders the PHP template * renders the PHP template
*/ */
public function renderUncompiled($_smarty_template) public function renderUncompiled($_smarty_template)
{ {
if (!$this->smarty->allow_php_templates) { if (!$this->smarty->allow_php_templates) {

View File

@@ -1,18 +1,18 @@
<?php <?php
/** /**
* Smarty Internal Plugin Resource Registered * Smarty Internal Plugin Resource Registered
* *
* Implements the registered resource for Smarty template * Implements the registered resource for Smarty template
* *
* @package Smarty * @package Smarty
* @subpackage TemplateResources * @subpackage TemplateResources
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Resource Registered * Smarty Internal Plugin Resource Registered
*/ */
class Smarty_Internal_Resource_Registered { class Smarty_Internal_Resource_Registered {
public function __construct($smarty) public function __construct($smarty)
{ {
@@ -27,10 +27,10 @@ class Smarty_Internal_Resource_Registered {
public $isEvaluated = false; public $isEvaluated = false;
/** /**
* Return flag if template source is existing * Return flag if template source is existing
* *
* @return boolean true * @return boolean true
*/ */
public function isExisting($_template) public function isExisting($_template)
{ {
if (is_integer($_template->getTemplateTimestamp())) { if (is_integer($_template->getTemplateTimestamp())) {
@@ -40,11 +40,11 @@ class Smarty_Internal_Resource_Registered {
} }
} }
/** /**
* Get filepath to template source * Get filepath to template source
* *
* @param object $_template template object * @param object $_template template object
* @return string return 'string' as template source is not a file * @return string return 'string' as template source is not a file
*/ */
public function getTemplateFilepath($_template) public function getTemplateFilepath($_template)
{ {
// no filepath for strings // no filepath for strings
@@ -52,14 +52,14 @@ class Smarty_Internal_Resource_Registered {
$_filepath = $_template->resource_type .':'.$_template->resource_name; $_filepath = $_template->resource_type .':'.$_template->resource_name;
$_template->templateUid = sha1($_filepath); $_template->templateUid = sha1($_filepath);
return $_filepath; return $_filepath;
} }
/** /**
* Get timestamp to template source * Get timestamp to template source
* *
* @param object $_template template object * @param object $_template template object
* @return boolean false as string resources have no timestamp * @return boolean false as string resources have no timestamp
*/ */
public function getTemplateTimestamp($_template) public function getTemplateTimestamp($_template)
{ {
// return timestamp // return timestamp
@@ -67,13 +67,14 @@ class Smarty_Internal_Resource_Registered {
call_user_func_array($this->smarty->_plugins['resource'][$_template->resource_type][0][1], call_user_func_array($this->smarty->_plugins['resource'][$_template->resource_type][0][1],
array($_template->resource_name, &$time_stamp, $this->smarty)); array($_template->resource_name, &$time_stamp, $this->smarty));
return is_numeric($time_stamp) ? (int)$time_stamp : $time_stamp; return is_numeric($time_stamp) ? (int)$time_stamp : $time_stamp;
} }
/** /**
* Get timestamp to template source by type and name * Get timestamp to template source by type and name
* *
* @param object $_template template object * @param object $_template template object
* @return boolean false as string resources have no timestamp * @return boolean false as string resources have no timestamp
*/ */
public function getTemplateTimestampTypeName($_resource_type, $_resource_name) public function getTemplateTimestampTypeName($_resource_type, $_resource_name)
{ {
// return timestamp // return timestamp
@@ -84,11 +85,11 @@ class Smarty_Internal_Resource_Registered {
} }
/** /**
* Retuen template source from resource name * Retuen template source from resource name
* *
* @param object $_template template object * @param object $_template template object
* @return string content of template source * @return string content of template source
*/ */
public function getTemplateSource($_template) public function getTemplateSource($_template)
{ {
// return template string // return template string
@@ -97,11 +98,11 @@ class Smarty_Internal_Resource_Registered {
} }
/** /**
* Get filepath to compiled template * Get filepath to compiled template
* *
* @param object $_template template object * @param object $_template template object
* @return boolean return false as compiled template is not stored * @return boolean return false as compiled template is not stored
*/ */
public function getCompiledFilepath($_template) public function getCompiledFilepath($_template)
{ {
$_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;
@@ -134,4 +135,4 @@ class Smarty_Internal_Resource_Registered {
} }
} }
?> ?>

View File

@@ -1,18 +1,18 @@
<?php <?php
/** /**
* Smarty Internal Plugin Resource Stream * Smarty Internal Plugin Resource Stream
* *
* Implements the streams as resource for Smarty template * Implements the streams as resource for Smarty template
* *
* @package Smarty * @package Smarty
* @subpackage TemplateResources * @subpackage TemplateResources
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Resource Stream * Smarty Internal Plugin Resource Stream
*/ */
class Smarty_Internal_Resource_Stream { class Smarty_Internal_Resource_Stream {
public function __construct($smarty) public function __construct($smarty)
{ {
@@ -27,10 +27,10 @@ class Smarty_Internal_Resource_Stream {
public $isEvaluated = true; public $isEvaluated = true;
/** /**
* Return flag if template source is existing * Return flag if template source is existing
* *
* @return boolean true * @return boolean true
*/ */
public function isExisting($template) public function isExisting($template)
{ {
if ($template->getTemplateSource() == '') { if ($template->getTemplateSource() == '') {
@@ -40,11 +40,11 @@ class Smarty_Internal_Resource_Stream {
} }
} }
/** /**
* Get filepath to template source * Get filepath to template source
* *
* @param object $_template template object * @param object $_template template object
* @return string return 'string' as template source is not a file * @return string return 'string' as template source is not a file
*/ */
public function getTemplateFilepath($_template) public function getTemplateFilepath($_template)
{ {
// no filepath for strings // no filepath for strings
@@ -53,11 +53,11 @@ class Smarty_Internal_Resource_Stream {
} }
/** /**
* Get timestamp to template source * Get timestamp to template source
* *
* @param object $_template template object * @param object $_template template object
* @return boolean false as string resources have no timestamp * @return boolean false as string resources have no timestamp
*/ */
public function getTemplateTimestamp($_template) public function getTemplateTimestamp($_template)
{ {
// strings must always be compiled and have no timestamp // strings must always be compiled and have no timestamp
@@ -65,11 +65,11 @@ class Smarty_Internal_Resource_Stream {
} }
/** /**
* Retuen template source from resource name * Retuen template source from resource name
* *
* @param object $_template template object * @param object $_template template object
* @return string content of template source * @return string content of template source
*/ */
public function getTemplateSource($_template) public function getTemplateSource($_template)
{ {
// return template string // return template string
@@ -84,11 +84,11 @@ class Smarty_Internal_Resource_Stream {
} }
/** /**
* Get filepath to compiled template * Get filepath to compiled template
* *
* @param object $_template template object * @param object $_template template object
* @return boolean return false as compiled template is not stored * @return boolean return false as compiled template is not stored
*/ */
public function getCompiledFilepath($_template) public function getCompiledFilepath($_template)
{ {
// no filepath for strings // no filepath for strings
@@ -96,4 +96,4 @@ class Smarty_Internal_Resource_Stream {
} }
} }
?> ?>

View File

@@ -1,18 +1,18 @@
<?php <?php
/** /**
* Smarty Internal Plugin Resource String * Smarty Internal Plugin Resource String
* *
* Implements the strings as resource for Smarty template * Implements the strings as resource for Smarty template
* *
* @package Smarty * @package Smarty
* @subpackage TemplateResources * @subpackage TemplateResources
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Resource String * Smarty Internal Plugin Resource String
*/ */
class Smarty_Internal_Resource_String { class Smarty_Internal_Resource_String {
public function __construct($smarty) public function __construct($smarty)
{ {
@@ -27,21 +27,21 @@ class Smarty_Internal_Resource_String {
public $isEvaluated = true; public $isEvaluated = true;
/** /**
* Return flag if template source is existing * Return flag if template source is existing
* *
* @return boolean true * @return boolean true
*/ */
public function isExisting($template) public function isExisting($template)
{ {
return true; return true;
} }
/** /**
* Get filepath to template source * Get filepath to template source
* *
* @param object $_template template object * @param object $_template template object
* @return string return 'string' as template source is not a file * @return string return 'string' as template source is not a file
*/ */
public function getTemplateFilepath($_template) public function getTemplateFilepath($_template)
{ {
// no filepath for strings // no filepath for strings
@@ -50,11 +50,11 @@ class Smarty_Internal_Resource_String {
} }
/** /**
* Get timestamp to template source * Get timestamp to template source
* *
* @param object $_template template object * @param object $_template template object
* @return boolean false as string resources have no timestamp * @return boolean false as string resources have no timestamp
*/ */
public function getTemplateTimestamp($_template) public function getTemplateTimestamp($_template)
{ {
// strings must always be compiled and have no timestamp // strings must always be compiled and have no timestamp
@@ -62,11 +62,11 @@ class Smarty_Internal_Resource_String {
} }
/** /**
* Retuen template source from resource name * Retuen template source from resource name
* *
* @param object $_template template object * @param object $_template template object
* @return string content of template source * @return string content of template source
*/ */
public function getTemplateSource($_template) public function getTemplateSource($_template)
{ {
// return template string // return template string
@@ -75,11 +75,11 @@ class Smarty_Internal_Resource_String {
} }
/** /**
* Get filepath to compiled template * Get filepath to compiled template
* *
* @param object $_template template object * @param object $_template template object
* @return boolean return false as compiled template is not stored * @return boolean return false as compiled template is not stored
*/ */
public function getCompiledFilepath($_template) public function getCompiledFilepath($_template)
{ {
// no filepath for strings // no filepath for strings
@@ -87,4 +87,4 @@ class Smarty_Internal_Resource_String {
} }
} }
?> ?>

View File

@@ -1,26 +1,27 @@
<?php <?php
/** /**
* Smarty Internal Plugin Security Handler * Smarty Internal Plugin Security Handler
* *
* @package Smarty * @package Smarty
* @subpackage Security * @subpackage Security
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* This class contains all methods for security checking * This class contains all methods for security checking
*/ */
class Smarty_Internal_Security_Handler { class Smarty_Internal_Security_Handler {
function __construct($smarty) function __construct($smarty)
{ {
$this->smarty = $smarty; $this->smarty = $smarty;
} }
/** /**
* Check if PHP function is trusted. * Check if PHP function is trusted.
* *
* @param string $function_name * @param string $function_name
* @param object $compiler compiler object * @param object $compiler compiler object
* @return boolean true if function is trusted * @return boolean true if function is trusted
*/ */
function isTrustedPhpFunction($function_name, $compiler) function isTrustedPhpFunction($function_name, $compiler)
{ {
if (empty($this->smarty->security_policy->php_functions) || in_array($function_name, $this->smarty->security_policy->php_functions)) { if (empty($this->smarty->security_policy->php_functions) || in_array($function_name, $this->smarty->security_policy->php_functions)) {
@@ -32,12 +33,12 @@ class Smarty_Internal_Security_Handler {
} }
/** /**
* Check if static class is trusted. * Check if static class is trusted.
* *
* @param string $class_name * @param string $class_name
* @param object $compiler compiler object * @param object $compiler compiler object
* @return boolean true if class is trusted * @return boolean true if class is trusted
*/ */
function isTrustedStaticClass($class_name, $compiler) function isTrustedStaticClass($class_name, $compiler)
{ {
if (empty($this->smarty->security_policy->static_classes) || in_array($class_name, $this->smarty->security_policy->static_classes)) { if (empty($this->smarty->security_policy->static_classes) || in_array($class_name, $this->smarty->security_policy->static_classes)) {
@@ -48,12 +49,12 @@ class Smarty_Internal_Security_Handler {
} }
} }
/** /**
* Check if modifier is trusted. * Check if modifier is trusted.
* *
* @param string $modifier_name * @param string $modifier_name
* @param object $compiler compiler object * @param object $compiler compiler object
* @return boolean true if modifier is trusted * @return boolean true if modifier is trusted
*/ */
function isTrustedModifier($modifier_name, $compiler) function isTrustedModifier($modifier_name, $compiler)
{ {
if (empty($this->smarty->security_policy->modifiers) || in_array($modifier_name, $this->smarty->security_policy->modifiers)) { if (empty($this->smarty->security_policy->modifiers) || in_array($modifier_name, $this->smarty->security_policy->modifiers)) {
@@ -64,12 +65,12 @@ class Smarty_Internal_Security_Handler {
} }
} }
/** /**
* Check if stream is trusted. * Check if stream is trusted.
* *
* @param string $stream_name * @param string $stream_name
* @param object $compiler compiler object * @param object $compiler compiler object
* @return boolean true if stream is trusted * @return boolean true if stream is trusted
*/ */
function isTrustedStream($stream_name) function isTrustedStream($stream_name)
{ {
if (empty($this->smarty->security_policy->streams) || in_array($stream_name, $this->smarty->security_policy->streams)) { if (empty($this->smarty->security_policy->streams) || in_array($stream_name, $this->smarty->security_policy->streams)) {
@@ -81,12 +82,12 @@ class Smarty_Internal_Security_Handler {
} }
/** /**
* Check if directory of file resource is trusted. * Check if directory of file resource is trusted.
* *
* @param string $filepath * @param string $filepath
* @param object $compiler compiler object * @param object $compiler compiler object
* @return boolean true if directory is trusted * @return boolean true if directory is trusted
*/ */
function isTrustedResourceDir($filepath) function isTrustedResourceDir($filepath)
{ {
$_rp = realpath($filepath); $_rp = realpath($filepath);
@@ -115,13 +116,14 @@ class Smarty_Internal_Security_Handler {
throw new SmartyException ("directory '{$_rp}' not allowed by security setting"); throw new SmartyException ("directory '{$_rp}' not allowed by security setting");
return false; return false;
} }
/** /**
* Check if directory of file resource is trusted. * Check if directory of file resource is trusted.
* *
* @param string $filepath * @param string $filepath
* @param object $compiler compiler object * @param object $compiler compiler object
* @return boolean true if directory is trusted * @return boolean true if directory is trusted
*/ */
function isTrustedPHPDir($filepath) function isTrustedPHPDir($filepath)
{ {
$_rp = realpath($filepath); $_rp = realpath($filepath);

View File

@@ -9,7 +9,9 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
require_once("smarty_internal_parsetree.php"); require_once("smarty_internal_parsetree.php");
/** /**
* Class SmartyTemplateCompiler * Class SmartyTemplateCompiler
*/ */

View File

@@ -376,7 +376,7 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
$this->cacheFileChecked = true; $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 = array();
$this->rendered_content = null; $this->rendered_content = null;
return $this->isCached; return $this->isCached;
} }
if (!empty($this->properties['file_dependency']) && $this->smarty->compile_check) { if (!empty($this->properties['file_dependency']) && $this->smarty->compile_check) {

View File

@@ -8,6 +8,7 @@
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Main compiler class * Main compiler class
*/ */
@@ -402,6 +403,5 @@ class Smarty_Internal_TemplateCompilerBase {
} }
throw new SmartyCompilerException($error_text); throw new SmartyCompilerException($error_text);
} }
} }
?> ?>

View File

@@ -1,15 +1,16 @@
<?php <?php
/** /**
* Smarty Internal Plugin Templatelexer * 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 * @package Smarty
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* Smarty Internal Plugin Templatelexer * Smarty Internal Plugin Templatelexer
*/ */
class Smarty_Internal_Templatelexer class Smarty_Internal_Templatelexer
{ {
public $data; public $data;
@@ -22,61 +23,61 @@ class Smarty_Internal_Templatelexer
public $state = 1; public $state = 1;
public $strip = false; public $strip = false;
private $heredoc_id_stack = Array(); private $heredoc_id_stack = Array();
public $smarty_token_names = array ( // Text for parser error messages public $smarty_token_names = array ( // Text for parser error messages
'IDENTITY' => '===', 'IDENTITY' => '===',
'NONEIDENTITY' => '!==', 'NONEIDENTITY' => '!==',
'EQUALS' => '==', 'EQUALS' => '==',
'NOTEQUALS' => '!=', 'NOTEQUALS' => '!=',
'GREATEREQUAL' => '(>=,ge)', 'GREATEREQUAL' => '(>=,ge)',
'LESSEQUAL' => '(<=,le)', 'LESSEQUAL' => '(<=,le)',
'GREATERTHAN' => '(>,gt)', 'GREATERTHAN' => '(>,gt)',
'LESSTHAN' => '(<,lt)', 'LESSTHAN' => '(<,lt)',
'MOD' => '(%,mod)', 'MOD' => '(%,mod)',
'NOT' => '(!,not)', 'NOT' => '(!,not)',
'LAND' => '(&&,and)', 'LAND' => '(&&,and)',
'LOR' => '(||,or)', 'LOR' => '(||,or)',
'LXOR' => 'xor', 'LXOR' => 'xor',
'OPENP' => '(', 'OPENP' => '(',
'CLOSEP' => ')', 'CLOSEP' => ')',
'OPENB' => '[', 'OPENB' => '[',
'CLOSEB' => ']', 'CLOSEB' => ']',
'PTR' => '->', 'PTR' => '->',
'APTR' => '=>', 'APTR' => '=>',
'EQUAL' => '=', 'EQUAL' => '=',
'NUMBER' => 'number', 'NUMBER' => 'number',
'UNIMATH' => '+" , "-', 'UNIMATH' => '+" , "-',
'MATH' => '*" , "/" , "%', 'MATH' => '*" , "/" , "%',
'INCDEC' => '++" , "--', 'INCDEC' => '++" , "--',
'SPACE' => ' ', 'SPACE' => ' ',
'DOLLAR' => '$', 'DOLLAR' => '$',
'SEMICOLON' => ';', 'SEMICOLON' => ';',
'COLON' => ':', 'COLON' => ':',
'DOUBLECOLON' => '::', 'DOUBLECOLON' => '::',
'AT' => '@', 'AT' => '@',
'HATCH' => '#', 'HATCH' => '#',
'QUOTE' => '"', 'QUOTE' => '"',
'BACKTICK' => '`', 'BACKTICK' => '`',
'VERT' => '|', 'VERT' => '|',
'DOT' => '.', 'DOT' => '.',
'COMMA' => '","', 'COMMA' => '","',
'ANDSYM' => '"&"', 'ANDSYM' => '"&"',
'QMARK' => '"?"', 'QMARK' => '"?"',
'ID' => 'identifier', 'ID' => 'identifier',
'OTHER' => 'text', 'OTHER' => 'text',
'LINEBREAK' => 'newline', 'LINEBREAK' => 'newline',
'FAKEPHPSTARTTAG' => 'Fake PHP start tag', 'FAKEPHPSTARTTAG' => 'Fake PHP start tag',
'PHPSTARTTAG' => 'PHP start tag', 'PHPSTARTTAG' => 'PHP start tag',
'PHPENDTAG' => 'PHP end tag', 'PHPENDTAG' => 'PHP end tag',
'LITERALSTART' => 'Literal start', 'LITERALSTART' => 'Literal start',
'LITERALEND' => 'Literal end', 'LITERALEND' => 'Literal end',
'LDELSLASH' => 'closing tag', 'LDELSLASH' => 'closing tag',
'COMMENT' => 'comment', 'COMMENT' => 'comment',
'LITERALEND' => 'literal close', 'LITERALEND' => 'literal close',
'AS' => 'as', 'AS' => 'as',
'TO' => 'to', 'TO' => 'to',
); );
function __construct($data,$compiler) function __construct($data,$compiler)
{ {
// set instance object // set instance object
@@ -90,8 +91,8 @@ class Smarty_Internal_Templatelexer
$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->ldel_length = strlen($this->smarty->left_delimiter);
$this->rdel = preg_quote($this->smarty->right_delimiter,'/'); $this->rdel = preg_quote($this->smarty->right_delimiter,'/');
$this->smarty_token_names['LDEL'] = $this->smarty->left_delimiter; $this->smarty_token_names['LDEL'] = $this->smarty->left_delimiter;
$this->smarty_token_names['RDEL'] = $this->smarty->right_delimiter; $this->smarty_token_names['RDEL'] = $this->smarty->right_delimiter;
} }
public static function &instance($new_instance = null) public static function &instance($new_instance = null)
{ {
@@ -1171,4 +1172,4 @@ class Smarty_Internal_Templatelexer
} }
} }
?> ?>

View File

@@ -1,13 +1,13 @@
<?php <?php
/** /**
* Smarty Internal Plugin Templateparser * Smarty Internal Plugin Templateparser
* *
* This is the template parser. * This is the template parser.
* It is generated from the internal.templateparser.y file * It is generated from the internal.templateparser.y file
* @package Smarty * @package Smarty
* @subpackage Compiler * @subpackage Compiler
* @author Uwe Tews * @author Uwe Tews
*/ */
class TP_yyToken implements ArrayAccess class TP_yyToken implements ArrayAccess
{ {
@@ -107,12 +107,12 @@ class Smarty_Internal_Templateparser#line 79 "smarty_internal_templateparser.php
$this->sec_obj = $this->smarty; $this->sec_obj = $this->smarty;
} }
$this->compiler->has_variable_string = false; $this->compiler->has_variable_string = false;
$this->compiler->prefix_code = array(); $this->compiler->prefix_code = array();
$this->prefix_number = 0; $this->prefix_number = 0;
$this->block_nesting_level = 0; $this->block_nesting_level = 0;
$this->is_xml = false; $this->is_xml = false;
$this->asp_tags = (ini_get('asp_tags') != '0'); $this->asp_tags = (ini_get('asp_tags') != '0');
$this->current_buffer = $this->root_buffer = new _smarty_template_buffer($this); $this->current_buffer = $this->root_buffer = new _smarty_template_buffer($this);
} }
public static function &instance($new_instance = null) public static function &instance($new_instance = null)
{ {
@@ -1436,7 +1436,7 @@ static public $yy_action = array(
$this->yystack[$this->yyidx]->stateno, $this->yystack[$this->yyidx]->stateno,
self::$yyRuleInfo[$yyruleno]['lhs']); self::$yyRuleInfo[$yyruleno]['lhs']);
if (isset(self::$yyExpectedTokens[$nextstate])) { if (isset(self::$yyExpectedTokens[$nextstate])) {
$expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]); $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]);
if (in_array($token, if (in_array($token,
self::$yyExpectedTokens[$nextstate], true)) { self::$yyExpectedTokens[$nextstate], true)) {
$this->yyidx = $yyidx; $this->yyidx = $yyidx;
@@ -1471,8 +1471,8 @@ static public $yy_action = array(
} }
break; break;
} while (true); } while (true);
$this->yyidx = $yyidx; $this->yyidx = $yyidx;
$this->yystack = $stack; $this->yystack = $stack;
return array_unique($expected); return array_unique($expected);
} }
@@ -2051,7 +2051,7 @@ static public $yy_action = array(
#line 126 "smarty_internal_templateparser.y" #line 126 "smarty_internal_templateparser.y"
function yy_r6(){ function yy_r6(){
if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU) { if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU) {
$this->_retvalue = new _smarty_text($this, self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor)); $this->_retvalue = new _smarty_text($this, self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor));
} elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) { } elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) {
$this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES)); $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES));
}elseif ($this->sec_obj->php_handling == SMARTY_PHP_ALLOW) { }elseif ($this->sec_obj->php_handling == SMARTY_PHP_ALLOW) {
@@ -2067,7 +2067,7 @@ static public $yy_action = array(
$this->is_xml = true; $this->is_xml = true;
$this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode("<?php echo '?>';?>", $this->compiler, true)); $this->_retvalue = new _smarty_text($this, $this->compiler->processNocacheCode("<?php echo '?>';?>", $this->compiler, true));
}elseif ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU) { }elseif ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU) {
$this->_retvalue = new _smarty_text($this, '?<?php ?>>'); $this->_retvalue = new _smarty_text($this, '?<?php ?>>');
} elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) { } elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) {
$this->_retvalue = new _smarty_text($this, htmlspecialchars('?>', ENT_QUOTES)); $this->_retvalue = new _smarty_text($this, htmlspecialchars('?>', ENT_QUOTES));
}elseif ($this->sec_obj->php_handling == SMARTY_PHP_ALLOW) { }elseif ($this->sec_obj->php_handling == SMARTY_PHP_ALLOW) {
@@ -2080,7 +2080,7 @@ static public $yy_action = array(
#line 154 "smarty_internal_templateparser.y" #line 154 "smarty_internal_templateparser.y"
function yy_r8(){ function yy_r8(){
if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU) { if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU) {
$this->_retvalue = new _smarty_text($this, '<<?php ?>%'); $this->_retvalue = new _smarty_text($this, '<<?php ?>%');
} elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) { } elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) {
$this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES)); $this->_retvalue = new _smarty_text($this, htmlspecialchars($this->yystack[$this->yyidx + 0]->minor, ENT_QUOTES));
}elseif ($this->sec_obj->php_handling == SMARTY_PHP_ALLOW) { }elseif ($this->sec_obj->php_handling == SMARTY_PHP_ALLOW) {
@@ -2101,7 +2101,7 @@ static public $yy_action = array(
#line 175 "smarty_internal_templateparser.y" #line 175 "smarty_internal_templateparser.y"
function yy_r9(){ function yy_r9(){
if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU) { if ($this->sec_obj->php_handling == SMARTY_PHP_PASSTHRU) {
$this->_retvalue = new _smarty_text($this, '%<?php ?>>'); $this->_retvalue = new _smarty_text($this, '%<?php ?>>');
} elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) { } elseif ($this->sec_obj->php_handling == SMARTY_PHP_QUOTE) {
$this->_retvalue = new _smarty_text($this, htmlspecialchars('%>', ENT_QUOTES)); $this->_retvalue = new _smarty_text($this, htmlspecialchars('%>', ENT_QUOTES));
}elseif ($this->sec_obj->php_handling == SMARTY_PHP_ALLOW) { }elseif ($this->sec_obj->php_handling == SMARTY_PHP_ALLOW) {
@@ -2121,9 +2121,9 @@ static public $yy_action = array(
#line 2117 "smarty_internal_templateparser.php" #line 2117 "smarty_internal_templateparser.php"
#line 195 "smarty_internal_templateparser.y" #line 195 "smarty_internal_templateparser.y"
function yy_r10(){if ($this->lex->strip) { function yy_r10(){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))); $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 { } else {
$this->_retvalue = new _smarty_text($this, self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor)); $this->_retvalue = new _smarty_text($this, self::escape_start_tag($this->yystack[$this->yyidx + 0]->minor));
} }
} }
#line 2125 "smarty_internal_templateparser.php" #line 2125 "smarty_internal_templateparser.php"
@@ -2132,9 +2132,9 @@ static public $yy_action = array(
#line 2128 "smarty_internal_templateparser.php" #line 2128 "smarty_internal_templateparser.php"
#line 206 "smarty_internal_templateparser.y" #line 206 "smarty_internal_templateparser.y"
function yy_r12(){if ($this->lex->strip) { function yy_r12(){if ($this->lex->strip) {
$this->_retvalue = new _smarty_text($this, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor)); $this->_retvalue = new _smarty_text($this, preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $this->yystack[$this->yyidx + 0]->minor));
} else { } else {
$this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor); $this->_retvalue = new _smarty_text($this, $this->yystack[$this->yyidx + 0]->minor);
} }
} }
#line 2136 "smarty_internal_templateparser.php" #line 2136 "smarty_internal_templateparser.php"
@@ -2356,9 +2356,9 @@ static public $yy_action = array(
#line 2352 "smarty_internal_templateparser.php" #line 2352 "smarty_internal_templateparser.php"
#line 412 "smarty_internal_templateparser.y" #line 412 "smarty_internal_templateparser.y"
function yy_r107(){if ((!$this->template->security || $this->smarty->security_handler->isTrustedStaticClass($this->yystack[$this->yyidx + -2]->minor, $this->compiler)) || isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor])) { function yy_r107(){if ((!$this->template->security || $this->smarty->security_handler->isTrustedStaticClass($this->yystack[$this->yyidx + -2]->minor, $this->compiler)) || isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor])) {
if (isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor])) { 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; $this->_retvalue = $this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor].'::'.$this->yystack[$this->yyidx + 0]->minor;
} else { } else {
$this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor; $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor;
} }
} else { } else {
@@ -2466,9 +2466,9 @@ static public $yy_action = array(
#line 2462 "smarty_internal_templateparser.php" #line 2462 "smarty_internal_templateparser.php"
#line 514 "smarty_internal_templateparser.y" #line 514 "smarty_internal_templateparser.y"
function yy_r139(){if (!$this->template->security || $this->smarty->security_handler->isTrustedPhpFunction($this->yystack[$this->yyidx + -3]->minor, $this->compiler)) { function yy_r139(){if (!$this->template->security || $this->smarty->security_handler->isTrustedPhpFunction($this->yystack[$this->yyidx + -3]->minor, $this->compiler)) {
if ($this->yystack[$this->yyidx + -3]->minor == 'isset' || $this->yystack[$this->yyidx + -3]->minor == 'empty' || $this->yystack[$this->yyidx + -3]->minor == 'array' || is_callable($this->yystack[$this->yyidx + -3]->minor)) { if ($this->yystack[$this->yyidx + -3]->minor == 'isset' || $this->yystack[$this->yyidx + -3]->minor == 'empty' || $this->yystack[$this->yyidx + -3]->minor == 'array' || is_callable($this->yystack[$this->yyidx + -3]->minor)) {
$this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". $this->yystack[$this->yyidx + -1]->minor .")"; $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . "(". $this->yystack[$this->yyidx + -1]->minor .")";
} else { } else {
$this->compiler->trigger_template_error ("unknown function \"" . $this->yystack[$this->yyidx + -3]->minor . "\""); $this->compiler->trigger_template_error ("unknown function \"" . $this->yystack[$this->yyidx + -3]->minor . "\"");
} }
} } } }

View File

@@ -1,36 +1,36 @@
<?php <?php
/** /**
* Project: Smarty: the PHP compiling template engine * Project: Smarty: the PHP compiling template engine
* File: smarty_internal_unregister.php * File: smarty_internal_unregister.php
* SVN: $Id: $ * SVN: $Id: $
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * 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, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* For questions, help, comments, discussion, etc., please join the * For questions, help, comments, discussion, etc., please join the
* Smarty mailing list. Send a blank e-mail to * Smarty mailing list. Send a blank e-mail to
* smarty-discussion-subscribe@googlegroups.com * smarty-discussion-subscribe@googlegroups.com
* *
* @link http://www.smarty.net/ * @link http://www.smarty.net/
* @copyright 2008 New Digital Group, Inc. * @copyright 2008 New Digital Group, Inc.
* @author Monte Ohrt <monte at ohrt dot com> * @author Monte Ohrt <monte at ohrt dot com>
* @author Uwe Tews * @author Uwe Tews
* @package Smarty * @package Smarty
* @subpackage PluginsInternal * @subpackage PluginsInternal
* @version 3-SVN$Rev: 3286 $ * @version 3-SVN$Rev: 3286 $
*/ */
class Smarty_Internal_Unregister { class Smarty_Internal_Unregister {
@@ -41,10 +41,10 @@ class Smarty_Internal_Unregister {
} }
/** /**
* Unregisters block function * Unregisters block function
* *
* @param string $block_tag name of template function * @param string $block_tag name of template function
*/ */
function block($block_tag) function block($block_tag)
{ {
if (isset($this->smarty->registered_plugins['block'][$block_tag])) { if (isset($this->smarty->registered_plugins['block'][$block_tag])) {
@@ -53,10 +53,10 @@ class Smarty_Internal_Unregister {
} }
/** /**
* Unregisters compiler function * Unregisters compiler function
* *
* @param string $compiler_tag name of template function * @param string $compiler_tag name of template function
*/ */
function compilerFunction($compiler_tag) function compilerFunction($compiler_tag)
{ {
if (isset($this->smarty->registered_plugins['compiler'][$compiler_tag])) { if (isset($this->smarty->registered_plugins['compiler'][$compiler_tag])) {
@@ -65,10 +65,10 @@ class Smarty_Internal_Unregister {
} }
/** /**
* Unregisters custom function * Unregisters custom function
* *
* @param string $function_tag name of template function * @param string $function_tag name of template function
*/ */
function templateFunction($function_tag) function templateFunction($function_tag)
{ {
if (isset($this->smarty->registered_plugins['function'][$function_tag])) { if (isset($this->smarty->registered_plugins['function'][$function_tag])) {
@@ -77,10 +77,10 @@ class Smarty_Internal_Unregister {
} }
/** /**
* Unregisters modifier * Unregisters modifier
* *
* @param string $modifier name of template modifier * @param string $modifier name of template modifier
*/ */
function modifier($modifier) function modifier($modifier)
{ {
if (isset($this->smarty->registered_plugins['modifier'][$modifier])) { if (isset($this->smarty->registered_plugins['modifier'][$modifier])) {
@@ -89,73 +89,74 @@ class Smarty_Internal_Unregister {
} }
/** /**
* Unregisters template object * Unregisters template object
* *
* @param string $object_name name of template object * @param string $object_name name of template object
*/ */
function templateObject($object_name) function templateObject($object_name)
{ {
unset($this->smarty->registered_objects[$object_name]); unset($this->smarty->registered_objects[$object_name]);
} }
/** /**
* Unregisters template class * Unregisters template class
* *
* @param string $object_name name of template object * @param string $object_name name of template object
*/ */
function templateClass($class_name) function templateClass($class_name)
{ {
unset($this->smarty->registered_classes[$class_name]); unset($this->smarty->registered_classes[$class_name]);
} }
/** /**
* Unregisters an output filter * Unregisters an output filter
* *
* @param callback $function_name * @param callback $function_name
*/ */
function outputFilter($function_name) function outputFilter($function_name)
{ {
unset($this->smarty->registered_filters['output'][$this->smarty->_get_filter_name($function_name)]); unset($this->smarty->registered_filters['output'][$this->smarty->_get_filter_name($function_name)]);
} }
/** /**
* Unregisters a postfilter function * Unregisters a postfilter function
* *
* @param callback $function_name * @param callback $function_name
*/ */
function postFilter($function_name) function postFilter($function_name)
{ {
unset($this->smarty->registered_filters['post'][$this->smarty->_get_filter_name($function_name)]); unset($this->smarty->registered_filters['post'][$this->smarty->_get_filter_name($function_name)]);
} }
/** /**
* Unregisters a prefilter function * Unregisters a prefilter function
* *
* @param callback $function_name * @param callback $function_name
*/ */
function preFilter($function_name) function preFilter($function_name)
{ {
unset($this->smarty->registered_filters['pre'][$this->smarty->_get_filter_name($function_name)]); unset($this->smarty->registered_filters['pre'][$this->smarty->_get_filter_name($function_name)]);
} }
/** /**
* Unregisters a resource * Unregisters a resource
* *
* @param string $resource_name name of resource * @param string $resource_name name of resource
*/ */
function resource($resource_name) function resource($resource_name)
{ {
unset($this->smarty->plugins['resource'][$resource_name]); unset($this->smarty->plugins['resource'][$resource_name]);
} }
/** /**
* Unregisters a variablefilter function * Unregisters a variablefilter function
* *
* @param callback $function_name * @param callback $function_name
*/ */
function variableFilter($function_name) function variableFilter($function_name)
{ {
unset($this->smarty->registered_filters['variable'][$this->smarty->_get_filter_name($function_name)]); unset($this->smarty->registered_filters['variable'][$this->smarty->_get_filter_name($function_name)]);
} }
} }
?>

View File

@@ -274,3 +274,4 @@ class Smarty_Internal_Utility {
return true; return true;
} }
} }
?>

View File

@@ -1,36 +1,36 @@
<?php <?php
/** /**
* Project: Smarty: the PHP compiling template engine * Project: Smarty: the PHP compiling template engine
* File: smarty_internal_wrapper.php * File: smarty_internal_wrapper.php
* SVN: $Id: $ * SVN: $Id: $
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version. * 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, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* For questions, help, comments, discussion, etc., please join the * For questions, help, comments, discussion, etc., please join the
* Smarty mailing list. Send a blank e-mail to * Smarty mailing list. Send a blank e-mail to
* smarty-discussion-subscribe@googlegroups.com * smarty-discussion-subscribe@googlegroups.com
* *
* @link http://www.smarty.net/ * @link http://www.smarty.net/
* @copyright 2008 New Digital Group, Inc. * @copyright 2008 New Digital Group, Inc.
* @author Monte Ohrt <monte at ohrt dot com> * @author Monte Ohrt <monte at ohrt dot com>
* @author Uwe Tews * @author Uwe Tews
* @package Smarty * @package Smarty
* @subpackage PluginsInternal * @subpackage PluginsInternal
* @version 3-SVN$Rev: 3286 $ * @version 3-SVN$Rev: 3286 $
*/ */
/* /*
* Smarty Backward Compatability Wrapper * Smarty Backward Compatability Wrapper
@@ -45,12 +45,12 @@ class Smarty_Internal_Wrapper {
} }
/** /**
* Converts smarty2-style function call to smarty 3-style function call * Converts smarty2-style function call to smarty 3-style function call
* This is expensive, be sure to port your code to Smarty 3! * This is expensive, be sure to port your code to Smarty 3!
* *
* @param string $name Smarty 2 function name * @param string $name Smarty 2 function name
* @param array $args Smarty 2 function args * @param array $args Smarty 2 function args
*/ */
function convert($name, $args) { function convert($name, $args) {
// throw notice about deprecated function // throw notice about deprecated function
if($this->smarty->deprecation_notices) if($this->smarty->deprecation_notices)
@@ -124,4 +124,4 @@ class Smarty_Internal_Wrapper {
} }
} }
?> ?>

View File

@@ -1,23 +1,24 @@
<?php <?php
/** /**
* Smarty write file plugin * Smarty write file plugin
* *
* @package Smarty * @package Smarty
* @subpackage PluginsInternal * @subpackage PluginsInternal
* @author Monte Ohrt * @author Monte Ohrt
*/ */
/** /**
* Smarty Internal Write File Class * Smarty Internal Write File Class
*/ */
class Smarty_Internal_Write_File { class Smarty_Internal_Write_File {
/** /**
* Writes file in a save way to disk * Writes file in a save way to disk
* *
* @param string $_filepath complete filepath * @param string $_filepath complete filepath
* @param string $_contents file content * @param string $_contents file content
* @return boolean true * @return boolean true
*/ */
public static function writeFile($_filepath, $_contents, $smarty) public static function writeFile($_filepath, $_contents, $smarty)
{ {
$old_umask = umask(0); $old_umask = umask(0);

View File

@@ -1,96 +1,96 @@
<?php <?php
/** /**
* Smarty plugin * Smarty plugin
* *
* @package Smarty * @package Smarty
* @subpackage Security * @subpackage Security
* @author Uwe Tews * @author Uwe Tews
*/ */
/** /**
* This class does contain the security settings * This class does contain the security settings
*/ */
class Smarty_Security { class Smarty_Security {
/** /**
* This determines how Smarty handles "<?php ... ?>" tags in templates. * This determines how Smarty handles "<?php ... ?>" tags in templates.
* possible values: * possible values:
* <ul> * <ul>
* <li>SMARTY_PHP_PASSTHRU -> echo PHP tags as they are</li> * <li>SMARTY_PHP_PASSTHRU -> echo PHP tags as they are</li>
* <li>SMARTY_PHP_QUOTE -> escape tags as entities</li> * <li>SMARTY_PHP_QUOTE -> escape tags as entities</li>
* <li>SMARTY_PHP_REMOVE -> remove php tags</li> * <li>SMARTY_PHP_REMOVE -> remove php tags</li>
* <li>SMARTY_PHP_ALLOW -> execute php tags</li> * <li>SMARTY_PHP_ALLOW -> execute php tags</li>
* </ul> * </ul>
* *
* @var integer * @var integer
*/ */
public $php_handling = SMARTY_PHP_PASSTHRU; public $php_handling = SMARTY_PHP_PASSTHRU;
/** /**
* This is the list of template directories that are considered secure. * This is the list of template directories that are considered secure.
* One directory per array element. * One directory per array element.
* $template_dir is in this list implicitly. * $template_dir is in this list implicitly.
* *
* @var array * @var array
*/ */
public $secure_dir = array(); public $secure_dir = array();
/** /**
* This is an array of directories where trusted php scripts reside. * This is an array of directories where trusted php scripts reside.
* {@link $security} is disabled during their inclusion/execution. * {@link $security} is disabled during their inclusion/execution.
* *
* @var array * @var array
*/ */
public $trusted_dir = array(); public $trusted_dir = array();
/** /**
* This is an array of trusted static classes. * This is an array of trusted static classes.
* *
* If empty access to all static classes is allowed. * If empty access to all static classes is allowed.
* If set to 'none' none is allowed. * If set to 'none' none is allowed.
* @var array * @var array
*/ */
public $static_classes = array(); public $static_classes = array();
/** /**
* This is an array of trusted PHP functions. * This is an array of trusted PHP functions.
* *
* If empty all functions are allowed. * If empty all functions are allowed.
* If set to 'none' none is allowed. * If set to 'none' none is allowed.
* @var array * @var array
*/ */
public $php_functions = array('isset', 'empty', public $php_functions = array('isset', 'empty',
'count', 'sizeof','in_array', 'is_array','time','nl2br'); 'count', 'sizeof','in_array', 'is_array','time','nl2br');
/** /**
* This is an array of trusted modifers. * This is an array of trusted modifers.
* *
* If empty all modifiers are allowed. * If empty all modifiers are allowed.
* If set to 'none' none is allowed. * If set to 'none' none is allowed.
* @var array * @var array
*/ */
public $modifiers = array('escape','count'); public $modifiers = array('escape','count');
/** /**
* This is an array of trusted streams. * This is an array of trusted streams.
* *
* If empty all streams are allowed. * If empty all streams are allowed.
* If set to 'none' none is allowed. * If set to 'none' none is allowed.
* @var array * @var array
*/ */
public $streams = array('file'); public $streams = array('file');
/** /**
+ flag if constants can be accessed from template * + flag if constants can be accessed from template
*/ */
public $allow_constants = true; 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; public $allow_super_globals = true;
/** /**
+ flag if {php} tag can be executed * + flag if {php} tag can be executed
*/ */
public $allow_php_tag = false; public $allow_php_tag = false;
} }