diff --git a/NEWS b/NEWS index 4e9e23c8..39575c16 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +Version 2.1.1 +------------- + - added cycle function (Monte) - fixed bug with resource testing, and include_path (Monte) - fixed a bug with register_outputfilter function (Monte) diff --git a/README b/README index 9c1974dc..907b2f06 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME: Smarty - the PHP compiling template engine -VERSION: 2.1.0 +VERSION: 2.1.1 AUTHORS: diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 171ed5da..7fc8e04b 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -1,3 +1,11 @@ +2.1.1 +----- + +There was a bug with template paths and the include_path, this has been fixed. +Also register_outputfilter() did not work, this is fixed. A new template +function named "cycle" has been added to the distribution, nice for cycling +through a list (or array) of values. + 2.1.0 ----- diff --git a/Smarty.class.php b/Smarty.class.php index 92864eed..c672fbef 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -5,7 +5,7 @@ * Author: Monte Ohrt * Andrei Zmievski * - * Version: 2.1.0 + * Version: 2.1.1 * Copyright: 2001,2002 ispi of Lincoln, Inc. * * This library is free software; you can redistribute it and/or @@ -164,7 +164,7 @@ class Smarty var $_conf_obj = null; // configuration object var $_config = array(); // loaded configuration settings var $_smarty_md5 = 'f8d698aea36fcbead2b9d5359ffca76f'; // md5 checksum of the string 'Smarty' - var $_version = '2.1.0'; // Smarty version number + var $_version = '2.1.1'; // Smarty version number var $_extract = false; // flag for custom functions var $_inclusion_depth = 0; // current template inclusion depth var $_compile_id = null; // for different compiled templates diff --git a/Smarty_Compiler.class.php b/Smarty_Compiler.class.php index 8590ca49..3beb15c8 100644 --- a/Smarty_Compiler.class.php +++ b/Smarty_Compiler.class.php @@ -6,7 +6,7 @@ * Author: Monte Ohrt * Andrei Zmievski * - * Version: 2.1.0 + * Version: 2.1.1 * Copyright: 2001,2002 ispi of Lincoln, Inc. * * This library is free software; you can redistribute it and/or diff --git a/docs/designers.sgml b/docs/designers.sgml index 3b712fe1..1eec5db7 100644 --- a/docs/designers.sgml +++ b/docs/designers.sgml @@ -2754,11 +2754,12 @@ OUTPUT: values - string + mixed Yes N/A - The values to cycle through, delimited by comma, - or specified in delimiter attribute + The values to cycle through, either a comma + delimited list (see delimiter attribute), or an array + of values. print @@ -2779,7 +2780,7 @@ OUTPUT: string No , - The value delimiter + The delimiter to use in the values attribute. diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 92864eed..c672fbef 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -5,7 +5,7 @@ * Author: Monte Ohrt * Andrei Zmievski * - * Version: 2.1.0 + * Version: 2.1.1 * Copyright: 2001,2002 ispi of Lincoln, Inc. * * This library is free software; you can redistribute it and/or @@ -164,7 +164,7 @@ class Smarty var $_conf_obj = null; // configuration object var $_config = array(); // loaded configuration settings var $_smarty_md5 = 'f8d698aea36fcbead2b9d5359ffca76f'; // md5 checksum of the string 'Smarty' - var $_version = '2.1.0'; // Smarty version number + var $_version = '2.1.1'; // Smarty version number var $_extract = false; // flag for custom functions var $_inclusion_depth = 0; // current template inclusion depth var $_compile_id = null; // for different compiled templates diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 8590ca49..3beb15c8 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -6,7 +6,7 @@ * Author: Monte Ohrt * Andrei Zmievski * - * Version: 2.1.0 + * Version: 2.1.1 * Copyright: 2001,2002 ispi of Lincoln, Inc. * * This library is free software; you can redistribute it and/or diff --git a/libs/plugins/function.cycle.php b/libs/plugins/function.cycle.php index aadefeb6..ea3ddbd9 100644 --- a/libs/plugins/function.cycle.php +++ b/libs/plugins/function.cycle.php @@ -13,8 +13,10 @@ * Jason Sweat * Purpose: cycle through given values * Input: name = name of cycle (optional) - * values = comma separated list of values to cycle + * values = comma separated list of values to cycle, + * or an array of values to cycle * (this can be left out for subsequent calls) + * * reset = boolean - resets given var to true * print = boolean - print var or not. default is true * advance = boolean - whether or not to advance the cycle @@ -62,7 +64,11 @@ function smarty_function_cycle($params, &$smarty) $cycle_vars[$name]['values'] = $values; } - $cycle_array = explode($delimiter,$cycle_vars[$name]['values']); + if(!is_array($cycle_vars[$name]['values'])) { + $cycle_array = explode($delimiter,$cycle_vars[$name]['values']); + } else { + $cycle_array = $cycle_vars[$name]['values']; + } if(!isset($cycle_vars[$name]['index']) || $reset ) { $cycle_vars[$name]['index'] = 0; diff --git a/plugins/function.cycle.php b/plugins/function.cycle.php index aadefeb6..ea3ddbd9 100644 --- a/plugins/function.cycle.php +++ b/plugins/function.cycle.php @@ -13,8 +13,10 @@ * Jason Sweat * Purpose: cycle through given values * Input: name = name of cycle (optional) - * values = comma separated list of values to cycle + * values = comma separated list of values to cycle, + * or an array of values to cycle * (this can be left out for subsequent calls) + * * reset = boolean - resets given var to true * print = boolean - print var or not. default is true * advance = boolean - whether or not to advance the cycle @@ -62,7 +64,11 @@ function smarty_function_cycle($params, &$smarty) $cycle_vars[$name]['values'] = $values; } - $cycle_array = explode($delimiter,$cycle_vars[$name]['values']); + if(!is_array($cycle_vars[$name]['values'])) { + $cycle_array = explode($delimiter,$cycle_vars[$name]['values']); + } else { + $cycle_array = $cycle_vars[$name]['values']; + } if(!isset($cycle_vars[$name]['index']) || $reset ) { $cycle_vars[$name]['index'] = 0;