cvs: smarty / NEWS README RELEASE_NOTES Smarty.class.php Smarty_Compiler.class.php /docs designers.sgml /plugins function.cycle.php
| From: | Monte Ohrt | Date: | Tue, 07 May 2002 14:16:35 +0000 |
| Subject: | cvs: smarty / NEWS README RELEASE_NOTES Smarty.class.php Smarty_Compiler.class.php /docs designers.sgml /plugins function.cycle.php | ||
| Groups: | php.smarty.cvs | ||
| Request: | Send a blank email to php-smarty-cvs+get-105@lists.php.net to get a copy of this message | ||
mohrt Tue May 7 10:16:35 2002 EDT
Modified files:
/smarty NEWS README RELEASE_NOTES Smarty.class.php
Smarty_Compiler.class.php
/smarty/docs designers.sgml
/smarty/plugins function.cycle.php
Log:
update cycle function to handle array as input, update files to 2.1.1
Index: smarty/NEWS
diff -u smarty/NEWS:1.195 smarty/NEWS:1.196
--- smarty/NEWS:1.195 Thu May 2 18:05:57 2002
+++ smarty/NEWS Tue May 7 10:16:32 2002
@@ -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)
Index: smarty/README
diff -u smarty/README:1.44 smarty/README:1.45
--- smarty/README:1.44 Tue Apr 30 10:41:36 2002
+++ smarty/README Tue May 7 10:16:33 2002
@@ -2,7 +2,7 @@
Smarty - the PHP compiling template engine
-VERSION: 2.1.0
+VERSION: 2.1.1
AUTHORS:
Index: smarty/RELEASE_NOTES
diff -u smarty/RELEASE_NOTES:1.32 smarty/RELEASE_NOTES:1.33
--- smarty/RELEASE_NOTES:1.32 Tue Apr 30 10:41:36 2002
+++ smarty/RELEASE_NOTES Tue May 7 10:16:33 2002
@@ -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
-----
Index: smarty/Smarty.class.php
diff -u smarty/Smarty.class.php:1.274 smarty/Smarty.class.php:1.275
--- smarty/Smarty.class.php:1.274 Thu May 2 10:34:35 2002
+++ smarty/Smarty.class.php Tue May 7 10:16:33 2002
@@ -5,7 +5,7 @@
* Author: Monte Ohrt <monte@ispi.net>
* Andrei Zmievski <andrei@php.net>
*
- * 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 @@
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
Index: smarty/Smarty_Compiler.class.php
diff -u smarty/Smarty_Compiler.class.php:1.112 smarty/Smarty_Compiler.class.php:1.113
--- smarty/Smarty_Compiler.class.php:1.112 Tue Apr 30 10:41:36 2002
+++ smarty/Smarty_Compiler.class.php Tue May 7 10:16:33 2002
@@ -6,7 +6,7 @@
* Author: Monte Ohrt <monte@ispi.net>
* Andrei Zmievski <andrei@php.net>
*
- * 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
Index: smarty/docs/designers.sgml
diff -u smarty/docs/designers.sgml:1.27 smarty/docs/designers.sgml:1.28
--- smarty/docs/designers.sgml:1.27 Fri May 3 14:22:41 2002
+++ smarty/docs/designers.sgml Tue May 7 10:16:34 2002
@@ -2754,11 +2754,12 @@
</row>
<row>
<entry>values</entry>
- <entry>string</entry>
+ <entry>mixed</entry>
<entry>Yes</entry>
<entry><emphasis>N/A</emphasis></entry>
- <entry>The values to cycle through, delimited by comma,
- or specified in delimiter attribute</entry>
+ <entry>The values to cycle through, either a comma
+ delimited list (see delimiter attribute), or an array
+ of values.</entry>
</row>
<row>
<entry>print</entry>
@@ -2779,7 +2780,7 @@
<entry>string</entry>
<entry>No</entry>
<entry><emphasis>,</emphasis></entry>
- <entry>The value delimiter</entry>
+ <entry>The delimiter to use in the values attribute.</entry>
</row>
</tbody>
</tgroup>
Index: smarty/plugins/function.cycle.php
diff -u smarty/plugins/function.cycle.php:1.6 smarty/plugins/function.cycle.php:1.7
--- smarty/plugins/function.cycle.php:1.6 Fri May 3 14:14:24 2002
+++ smarty/plugins/function.cycle.php Tue May 7 10:16:34 2002
@@ -13,8 +13,10 @@
* Jason Sweat <jsweat_php@yahoo.com>
* 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 @@
$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;