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)
{
$_class = strtolower($class);
@@ -768,11 +771,16 @@ function smartyAutoload($class)
}
}
/**
* Smarty exception class
*/
Class SmartyException extends Exception {
}
/**
* Smarty compiler exception class
*/
Class SmartyCompilerException extends SmartyException {
}
?>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -9,6 +9,7 @@
* @subpackage Compiler
* @author Uwe Tews
*/
/**
* Smarty Internal Plugin Compile Function_Call Class
*/
@@ -71,7 +72,7 @@ class Smarty_Internal_Compile_Call extends Smarty_Internal_CompileBase {
}
}
$_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
if (isset($_assign)) {
if ($compiler->template->caching) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -8,6 +8,7 @@
* @subpackage Compiler
* @author Uwe Tews
*/
/**
* 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";
} else {
$output = "<?php \$_smarty_tpl->assign({$_assign},{$return});?>\n";
}
}
return $output;
}
}
}
?>

View File

@@ -8,6 +8,7 @@
* @subpackage Compiler
* @author Uwe Tews
*/
/**
* 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'])) {
$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 . ';?>';
}
return $output;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -8,6 +8,7 @@
* @subpackage Compiler
* @author Uwe Tews
*/
/**
* 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);
// 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'])) {
$_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 ?>";
@@ -55,12 +56,13 @@ class Smarty_Internal_Compile_Whileclose extends Smarty_Internal_CompileBase {
public function compile($args, $compiler)
{
$this->compiler = $compiler;
// must endblock be nocache?
if ($this->compiler->nocache) {
// must endblock be nocache?
if ($this->compiler->nocache) {
$this->compiler->tag_nocache = true;
}
$this->compiler->nocache = $this->_close_tag(array('while'));
return "<?php }?>";
}
}
?>
?>

View File

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

View File

@@ -7,6 +7,7 @@
* @subpackage Config
* @author Uwe Tews
*/
/**
* Smarty Internal Plugin Configfilelexer
*/
@@ -20,10 +21,10 @@ class Smarty_Internal_Configfilelexer
public $node;
public $line;
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)
{
// set instance object
@@ -521,6 +522,6 @@ class Smarty_Internal_Configfilelexer
$this->yypopstate();
}
}
?>
?>

View File

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

View File

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

View File

@@ -6,6 +6,7 @@
* @subpackage PluginsInternal
* @author Uwe Tews
*/
/**
* 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)) {
$_code = "function {$_function}(\$_smarty_tpl,\$params) {
\$saved_tpl_vars = \$_smarty_tpl->tpl_vars;
foreach (\$params as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);}?>";
\$saved_tpl_vars = \$_smarty_tpl->tpl_vars;
foreach (\$params as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);}?>";
if ($_nocache) {
$_code .= preg_replace(array("!<\?php echo \\'/\*%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/|/\*/%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/\\';\?>!",
"!\\\'!"), array('', "'"), $_template->smarty->template_functions[$_name]['compiled']);

View File

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

View File

@@ -9,13 +9,14 @@
* @author Thue Kristensen
* @author Uwe Tews
*/
abstract class _smarty_parsetree {
abstract public function to_smarty_php();
}
/* A complete smarty tag. */
/**
* A complete smarty tag.
*/
class _smarty_tag extends _smarty_parsetree
{
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 {
public $parser;
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 {
public $parser;
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 {
public $data;
function __construct($parser, $data)
@@ -127,7 +134,10 @@ class _smarty_dq_content extends _smarty_parsetree {
return '"' . $this->data . '"';
}
}
/* Template element */
/**
* Template element
*/
class _smarty_template_buffer extends _smarty_parsetree {
public $subtrees = Array();
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);
} elseif ($this->parser->asp_tags && substr($subtree, 0, 1) == '%') {
$code = substr($code, 0, strlen($code)-1) . '<<?php ?>%' . substr($subtree, 1);
} else {
} else {
$code .= $subtree;
}
continue;
@@ -169,7 +179,7 @@ class _smarty_template_buffer extends _smarty_parsetree {
$subtree = $this->subtrees[$key]->to_smarty_php();
if (substr($subtree, 0, 1) == '>') {
$code = substr($code, 0, strlen($code)-1) . '%<?php ?>>' . substr($subtree, 1);
} else {
} else {
$code .= $subtree;
}
continue;
@@ -178,7 +188,7 @@ class _smarty_template_buffer extends _smarty_parsetree {
$subtree = $this->subtrees[$key]->to_smarty_php();
if (substr($subtree, 0, 1) == '>') {
$code = substr($code, 0, strlen($code)-1) . '?<?php ?>>' . substr($subtree, 1);
} else {
} else {
$code .= $subtree;
}
continue;
@@ -187,8 +197,11 @@ class _smarty_template_buffer extends _smarty_parsetree {
}
return $code;
}
}
/* template text */
}
/**
* template text
*/
class _smarty_text extends _smarty_parsetree {
public $data;
function __construct($parser, $data)
@@ -202,7 +215,10 @@ class _smarty_text extends _smarty_parsetree {
return $this->data;
}
}
/* template linebreaks */
/**
* template linebreaks
*/
class _smarty_linebreak extends _smarty_parsetree {
public $data;
function __construct($parser, $data)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -376,7 +376,7 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
$this->cacheFileChecked = true;
if ($this->caching === SMARTY_CACHING_LIFETIME_SAVED && $this->properties['cache_lifetime'] >= 0 && (time() > ($this->getCachedTimestamp() + $this->properties['cache_lifetime']))) {
$this->tpl_vars = array();
$this->rendered_content = null;
$this->rendered_content = null;
return $this->isCached;
}
if (!empty($this->properties['file_dependency']) && $this->smarty->compile_check) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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