diff --git a/ChangeLog b/ChangeLog index 2794e20e..081cd63a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-04-20 Greg Beaver + * plugins/* + Smarty.class.php + Smarty_Compiler.class.php + Config_File.class.php: + updated all doc comments to phpDocumentor format (whew!) + 2003-04-06 Messju Mohr * libs/plugins/function.math.php: diff --git a/NEWS b/NEWS index 75806073..d74d932b 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - all in-code doc comments converted to phpDocumentor format (Greg) - moved strip from smarty core to plugin (Monte) - moved config_load from smarty core to plugin (Monte) - added &$repeat-paramter to block-functions (messju) diff --git a/libs/Config_File.class.php b/libs/Config_File.class.php index a8348ba5..8a44f69c 100644 --- a/libs/Config_File.class.php +++ b/libs/Config_File.class.php @@ -34,10 +34,14 @@ * @copyright Copyright: 2001,2002 ispi of Lincoln, Inc. * @author Andrei Zmievski * @access public + * @package Smarty */ /* $Id$ */ - +/** + * Config file reading class + * @package Smarty + */ class Config_File { /**#@+ * Options diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index fdc1d763..0cae0076 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -909,6 +909,7 @@ class Smarty * @param string $cache_id name of cache_id * @param string $compile_id name of compile_id * @param string $exp_time expiration time + * @return boolean */ function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null) { @@ -935,6 +936,7 @@ class Smarty * clear the entire contents of cache (all templates) * * @param string $exp_time expire time + * @return boolean results of {@link _rm_auto()} */ function clear_all_cache($exp_time = null) { @@ -953,6 +955,7 @@ class Smarty * @param string $tpl_file name of template file * @param string $cache_id * @param string $compile_id + * @return string|false results of {@link _read_cache_file()} */ function is_cached($tpl_file, $cache_id = null, $compile_id = null) { @@ -983,6 +986,7 @@ class Smarty * @param string $tpl_file * @param string $compile_id * @param string $exp_time + * @return boolean results of {@link _rm_auto()} */ function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null) { @@ -995,6 +999,7 @@ class Smarty * Checks whether requested template exists. * * @param string $tpl_file + * @return boolean */ function template_exists($tpl_file) { @@ -1006,7 +1011,7 @@ class Smarty * * @param string $name * @param string $type - * @return mixed + * @return array */ function &get_template_vars($name=null) { @@ -1023,7 +1028,7 @@ class Smarty * * @param string $name * @param string $type - * @return mixed + * @return array */ function &get_config_vars($name=null) { @@ -1290,6 +1295,7 @@ class Smarty * return a reference to a registered object * * @param string $name + * @return object */ function &get_registered_object($name) { if (!isset($this->_reg_objects[$name])) @@ -1309,6 +1315,7 @@ class Smarty * * @param string $resource_type * @param string $resource_name + * @return boolean */ function _is_trusted($resource_type, $resource_name) { @@ -1344,6 +1351,7 @@ class Smarty * * @param string $resource_type * @param string $resource_name + * @return boolean */ function _is_secure($resource_type, $resource_name) { @@ -1380,6 +1388,7 @@ class Smarty * @param string $resource * @param string $resource_type * @param $php_resource + * @return boolean */ function _get_php_resource($resource, &$resource_type, &$php_resource) { @@ -1442,6 +1451,7 @@ class Smarty * * @param string $tpl_file * @param string $compile_path + * @return boolean */ function _process_template($tpl_file, $compile_path) { @@ -1482,6 +1492,7 @@ class Smarty * Get the compile path for this template file * * @param string $tpl_file + * @return string results of {@link _get_auto_filename()} */ function _get_compile_path($tpl_file) { @@ -1512,6 +1523,7 @@ class Smarty * @param string $file_path * @param string $resource_type * @param string $resource_name + * @return boolean */ function _parse_file_path($file_base_path, $file_path, &$resource_type, &$resource_name) { @@ -1566,6 +1578,7 @@ class Smarty * @param integer $template_timestamp * @param boolean $get_source * @param boolean $quiet + * @return boolean */ function _fetch_template_info($tpl_path, &$template_source, &$template_timestamp, $get_source = true, $quiet = false) { @@ -1630,6 +1643,7 @@ class Smarty * @param string $tpl_file * @param string $template_source * @param string $template_compiled + * @return boolean */ function _compile_template($tpl_file, $template_source, &$template_compiled) { @@ -1778,6 +1792,7 @@ class Smarty * Replace cached inserts with the actual results * * @param string $results + * @return string */ function _process_cached_inserts($results) { @@ -1825,6 +1840,7 @@ class Smarty * Handle insert tags * * @param array $args + * @return string */ function _run_insert_handler($args) { @@ -1878,6 +1894,9 @@ class Smarty /** * Handle modifiers * + * @param string|null $modifier_name + * @param array|null $map_array + * @return string result of modifiers */ function _run_mod_handler() { @@ -1903,6 +1922,7 @@ class Smarty * Remove starting and ending quotes from the string * * @param string $string + * @return string */ function _dequote($string) { @@ -1921,6 +1941,7 @@ class Smarty * @param string $filename * @param integer $start * @param integer $lines + * @return string */ function _read_file($filename, $start=null, $lines=null) { @@ -1963,6 +1984,7 @@ class Smarty * @param string $filename * @param string $contents * @param boolean $create_dirs + * @return boolean */ function _write_file($filename, $contents, $create_dirs = false) { @@ -1999,6 +2021,9 @@ class Smarty * @param string $auto_base * @param string $auto_source * @param string $auto_id + * @return string + * @staticvar string|null + * @staticvar string|null */ function _get_auto_filename($auto_base, $auto_source = null, $auto_id = null) { @@ -2054,6 +2079,7 @@ class Smarty * @param string $auto_source * @param string $auto_id * @param integer $exp_time + * @return boolean */ function _rm_auto($auto_base, $auto_source = null, $auto_id = null, $exp_time = null) { @@ -2093,6 +2119,7 @@ class Smarty * @param string $dirname * @param integer $level * @param integer $exp_time + * @return boolean */ function _rmdir($dirname, $level = 1, $exp_time = null) { @@ -2192,6 +2219,7 @@ class Smarty * @param string $cache_id * @param string $compile_id * @param string $results + * @return true|null */ function _write_cache_file($tpl_file, $cache_id, $compile_id, $results) { @@ -2229,6 +2257,7 @@ class Smarty * @param string $cache_id * @param string $compile_id * @param string $results + * @return boolean */ function _read_cache_file($tpl_file, $cache_id, $compile_id, &$results) { @@ -2309,6 +2338,7 @@ class Smarty * * @param string $cache_id * @param string $compile_id + * @return string|null */ function _get_auto_id($cache_id=null, $compile_id=null) { if (isset($cache_id)) @@ -2324,6 +2354,7 @@ class Smarty * * @param string $type * @param string $name + * @return string|false */ function _get_plugin_filepath($type, $name) { @@ -2537,6 +2568,7 @@ class Smarty /** * automatically load a set of filters + * @uses load_filter() */ function _autoload_filters() { @@ -2551,6 +2583,7 @@ class Smarty * Quote subpattern references * * @param string $string + * @return string */ function quote_replace($string) { @@ -2601,6 +2634,8 @@ class Smarty * * @param string $file_path * @param string $new_file_path + * @return boolean + * @staticvar array|null */ function _get_include_path($file_path, &$new_file_path) { diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 6e92b196..9ef3c717 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -40,7 +40,10 @@ */ /* $Id$ */ - +/** + * Template compiling class + * @package Smarty + */ class Smarty_Compiler extends Smarty { // internal vars @@ -206,6 +209,7 @@ class Smarty_Compiler extends Smarty { * @param string $tpl_file * @param string $template_source * @param string $template_compiled + * @return true */ function _compile_file($tpl_file, $template_source, &$template_compiled) { @@ -358,6 +362,7 @@ class Smarty_Compiler extends Smarty { * Compile a template tag * * @param string $template_tag + * @return string */ function _compile_tag($template_tag) { @@ -490,6 +495,7 @@ class Smarty_Compiler extends Smarty { * @param string $tag_command * @param string $tag_args * @param string $output + * @return boolean */ function _compile_compiler_tag($tag_command, $tag_args, &$output) { @@ -554,6 +560,7 @@ class Smarty_Compiler extends Smarty { * @param string $tag_args * @param string $tag_modifier * @param string $output + * @return boolean */ function _compile_block_tag($tag_command, $tag_args, $tag_modifier, &$output) { @@ -642,6 +649,7 @@ class Smarty_Compiler extends Smarty { * @param string $tag_command * @param string $tag_args * @param string $tag_modifier + * @return string */ function _compile_custom_tag($tag_command, $tag_args, $tag_modifier) { @@ -673,6 +681,7 @@ class Smarty_Compiler extends Smarty { * @param string $tag_command * @param array $attrs * @param string $tag_modifier + * @return string */ function _compile_registered_object_tag($tag_command, $attrs, $tag_modifier) { @@ -728,6 +737,7 @@ class Smarty_Compiler extends Smarty { * Compile {insert ...} tag * * @param string $tag_args + * @return string */ function _compile_insert_tag($tag_args) { @@ -758,7 +768,8 @@ class Smarty_Compiler extends Smarty { /** * Compile {include ...} tag * - * $param string $tag_args + * @param string $tag_args + * @return string */ function _compile_include_tag($tag_args) { @@ -808,6 +819,7 @@ class Smarty_Compiler extends Smarty { * Compile {include ...} tag * * @param string $tag_args + * @return string */ function _compile_include_php_tag($tag_args) { @@ -840,6 +852,7 @@ class Smarty_Compiler extends Smarty { * Compile {section ...} tag * * @param string $tag_args + * @return string */ function _compile_section_start($tag_args) { @@ -944,6 +957,7 @@ class Smarty_Compiler extends Smarty { * Compile {foreach ...} tag. * * @param string $tag_args + * @return string */ function _compile_foreach_start($tag_args) { @@ -1008,6 +1022,7 @@ class Smarty_Compiler extends Smarty { * * @param boolean $start true if this is the {capture} tag * @param string $tag_args + * @return string */ function _compile_capture_tag($start, $tag_args = '') { @@ -1034,6 +1049,7 @@ class Smarty_Compiler extends Smarty { * * @param string $tag_args * @param boolean $elseif if true, uses elseif instead of if + * @return string */ function _compile_if_tag($tag_args, $elseif = false) { @@ -1195,6 +1211,7 @@ class Smarty_Compiler extends Smarty { * * @param string $is_arg * @param array $tokens + * @return array */ function _parse_is_expr($is_arg, $tokens) { @@ -1256,6 +1273,7 @@ class Smarty_Compiler extends Smarty { * * @param string $tag_args * @param true $quote unused? + * @return array */ function _parse_attrs($tag_args, $quote = true) { @@ -1354,6 +1372,7 @@ class Smarty_Compiler extends Smarty { * * @param string $val * @param string $tag_attrs + * @return string */ function _parse_var_props($val, $tag_attrs = null) { @@ -1400,6 +1419,7 @@ class Smarty_Compiler extends Smarty { * expand quoted text with embedded variables * * @param string $var_expr + * @return string */ function _expand_quoted_text($var_expr) { @@ -1424,6 +1444,7 @@ class Smarty_Compiler extends Smarty { * parse variable expression into PHP code * * @param string $var_expr + * @return string */ function _parse_var($var_expr) { @@ -1502,6 +1523,7 @@ class Smarty_Compiler extends Smarty { * parse arguments in function call parenthesis * * @param string $parenth_args + * @return string */ function _parse_parenth_args($parenth_args) { @@ -1518,6 +1540,7 @@ class Smarty_Compiler extends Smarty { * parse configuration variable expression into PHP code * * @param string $conf_var_expr + * @return string */ function _parse_conf_var($conf_var_expr) { @@ -1539,6 +1562,7 @@ class Smarty_Compiler extends Smarty { * parse section property expression into PHP code * * @param string $section_prop_expr + * @return string */ function _parse_section_prop($section_prop_expr) { @@ -1634,6 +1658,7 @@ class Smarty_Compiler extends Smarty { * Compiles references of type $smarty.foo * * @param string $indexes + * @return string */ function _compile_smarty_ref(&$indexes) { @@ -1740,6 +1765,7 @@ class Smarty_Compiler extends Smarty { * * @param string $type * @param string $name + * @return string */ function _compile_plugin_call($type, $name) { if (isset($this->_plugins[$type][$name])) { @@ -1810,6 +1836,7 @@ class Smarty_Compiler extends Smarty { * @access private * @param string $a * @param string $b + * @return 0|-1|1 */ function _smarty_sort_length($a, $b) { diff --git a/libs/plugins/block.strip.php b/libs/plugins/block.strip.php index 3d29f17f..b03ce78c 100644 --- a/libs/plugins/block.strip.php +++ b/libs/plugins/block.strip.php @@ -6,12 +6,17 @@ */ /** - * Smarty textformat plugin + * Smarty {strip}{/strip} block plugin * * Type: block function
* Name: strip
* Purpose: strip unwanted white space from text
- * + * @link http://smarty.php.net/manual/en/language.function.strip.php {strip} + * (Smarty online manual) + * @param array unused, no parameters for this block + * @param string content of {strip}{/strip} tags + * @param Smarty clever method emulation + * @return string $content stripped of whitespace */ function smarty_block_strip($params, $content, &$this) { diff --git a/libs/plugins/block.textformat.php b/libs/plugins/block.textformat.php index 88101381..8dd8affa 100644 --- a/libs/plugins/block.textformat.php +++ b/libs/plugins/block.textformat.php @@ -6,12 +6,14 @@ */ /** - * Smarty textformat plugin + * Smarty {textformat}{/textformat} block plugin * * Type: block function
* Name: textformat
* Purpose: format text a certain way with preset styles * or custom wrap/indent settings
+ * @link http://smarty.php.net/manual/en/language.function.textformat.php {textformat} + * (Smarty online manual) * @param array *
  * Params:   style: string (email)
@@ -23,6 +25,7 @@
  * 
* @param string contents of the block * @param Smarty clever simulation of a method + * @return string string $content re-formatted */ function smarty_block_textformat($params, $content, &$this) { diff --git a/libs/plugins/function.assign.php b/libs/plugins/function.assign.php index 0eb29602..3823791d 100644 --- a/libs/plugins/function.assign.php +++ b/libs/plugins/function.assign.php @@ -1,12 +1,20 @@ + * Name: assign
* Purpose: assign a value to a template variable - * ------------------------------------------------------------- + * @link http://smarty.php.net/manual/en/language.custom.functions.php#LANGUAGE.FUNCTION.ASSIGN {assign} + * (Smarty online manual) + * @param array Format: array('var' => variable name, 'value' => value to assign) + * @param Smarty */ function smarty_function_assign($params, &$smarty) { diff --git a/libs/plugins/function.debug.php b/libs/plugins/function.debug.php index d059a42f..a91f45f4 100644 --- a/libs/plugins/function.debug.php +++ b/libs/plugins/function.debug.php @@ -1,15 +1,25 @@ + * @package Smarty + * @subpackage plugins + */ + + +/** + * Smarty {debug} function plugin + * + * Type: function
+ * Name: debug
+ * Date: July 1, 2002
* Purpose: popup debug window - * ------------------------------------------------------------- + * @link http://smarty.php.net/manual/en/language.function.debug.php {debug} + * (Smarty online manual) + * @author Monte Ohrt + * @version 1.0 + * @param array + * @param Smarty + * @return string output from {@link Smarty::_generate_debug_output()} */ function smarty_function_debug($params, &$smarty) { diff --git a/libs/plugins/function.eval.php b/libs/plugins/function.eval.php index 662d2c78..27bc43fd 100644 --- a/libs/plugins/function.eval.php +++ b/libs/plugins/function.eval.php @@ -1,12 +1,21 @@ + * Name: eval
+ * Purpose: evaluate a template variable as a template
+ * @link http://smarty.php.net/manual/en/language.function.eval.php {eval} + * (Smarty online manual) + * @param array + * @param Smarty */ function smarty_function_eval($params, &$this) { diff --git a/libs/plugins/function.fetch.php b/libs/plugins/function.fetch.php index d533f123..2e5a8ac3 100644 --- a/libs/plugins/function.fetch.php +++ b/libs/plugins/function.fetch.php @@ -1,12 +1,23 @@ + * Name: fetch
* Purpose: fetch file, web or ftp data and display results - * ------------------------------------------------------------- + * @link http://smarty.php.net/manual/en/language.function.fetch.php {fetch} + * (Smarty online manual) + * @param array + * @param Smarty + * @return string|null if the assign parameter is passed, Smarty assigns the + * result to a template variable */ function smarty_function_fetch($params, &$smarty) { diff --git a/libs/plugins/function.html_checkboxes.php b/libs/plugins/function.html_checkboxes.php index 577b47d5..c146fc19 100644 --- a/libs/plugins/function.html_checkboxes.php +++ b/libs/plugins/function.html_checkboxes.php @@ -1,26 +1,41 @@ or   - * output (optional) - without this one the buttons don't have names - * Author: Christopher Kvarme - * Credits: Monte Ohrt - * Examples: {html_checkboxes values=$ids output=$names} - * {html_checkboxes values=$ids name='box' separator='
' output=$names} - * {html_checkboxes values=$ids checked=$checked separator='
' output=$names} - * ------------------------------------------------------------- + * @package Smarty + * @subpackage plugins + */ + + +/** + * Smarty {html_checkboxes} function plugin + * + * File: function.html_checkboxes.php
+ * Type: function
+ * Name: html_checkboxes
+ * Date: 24.Feb.2003
+ * Purpose: Prints out a list of checkbox input types
+ * Input:
+ * - name (optional) - string default "checkbox" + * - values (required) - array + * - options (optional) - associative array + * - checked (optional) - array default not set + * - separator (optional) - ie
or   + * - output (optional) - without this one the buttons don't have names + * Examples: + *
+ * {html_checkboxes values=$ids output=$names}
+ * {html_checkboxes values=$ids name='box' separator='
' output=$names} + * {html_checkboxes values=$ids checked=$checked separator='
' output=$names} + *
+ * @link http://smarty.php.net/manual/en/language.function.html.checkboxes.php {html_checkboxes} + * (Smarty online manual) + * @author Christopher Kvarme + * @author credits to Monte Ohrt + * @version 1.0 + * @param array + * @param Smarty + * @return string + * @uses smarty_function_escape_special_chars() */ function smarty_function_html_checkboxes($params, &$smarty) { diff --git a/libs/plugins/function.html_image.php b/libs/plugins/function.html_image.php index 39827df3..30000056 100644 --- a/libs/plugins/function.html_image.php +++ b/libs/plugins/function.html_image.php @@ -1,26 +1,38 @@ - * Credits: Duda - wrote first image function - * in repository, helped with lots of functionality - * Purpose: format HTML tags for the image - * Input: file = file (and path) of image (required) - * border = border width (optional, default 0) - * height = image height (optional, default actual height) - * image =image width (optional, default actual width) - * basedir = base directory for absolute paths, default + * @package Smarty + * @subpackage plugins + */ + + +/** + * Smarty {html_image} function plugin + * + * Type: function
+ * Name: html_image
+ * Date: Feb 24, 2003
+ * Purpose: format HTML tags for the image
+ * Input:
+ * - file = file (and path) of image (required) + * - border = border width (optional, default 0) + * - height = image height (optional, default actual height) + * - image =image width (optional, default actual width) + * - basedir = base directory for absolute paths, default * is environment variable DOCUMENT_ROOT * * Examples: {image file="images/masthead.gif"} * Output: - * ------------------------------------------------------------- + * @link http://smarty.php.net/manual/en/language.function.html.image.php {html_image} + * (Smarty online manual) + * @author Monte Ohrt + * @author credits to Duda - wrote first image function + * in repository, helped with lots of functionality + * @version 1.0 + * @param array + * @param Smarty + * @return string + * @uses smarty_function_escape_special_chars() */ function smarty_function_html_image($params, &$smarty) { diff --git a/libs/plugins/function.html_options.php b/libs/plugins/function.html_options.php index 20a6e5d1..9c7a5678 100644 --- a/libs/plugins/function.html_options.php +++ b/libs/plugins/function.html_options.php @@ -1,18 +1,30 @@ + * Name: html_options
+ * Input:
+ * - 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 * Purpose: Prints the list of