1 |
cvsjoko |
1.1 |
<?php |
2 |
|
|
|
3 |
|
|
/* |
4 |
|
|
* Smarty plugin |
5 |
|
|
* ------------------------------------------------------------- |
6 |
|
|
* Type: function |
7 |
|
|
* Name: cycle |
8 |
|
|
* Version: 1.3 |
9 |
|
|
* Date: May 3, 2002 |
10 |
|
|
* Author: Monte Ohrt <monte@ispi.net> |
11 |
|
|
* Credits: Mark Priatel <mpriatel@rogers.com> |
12 |
|
|
* Gerard <gerard@interfold.com> |
13 |
|
|
* Jason Sweat <jsweat_php@yahoo.com> |
14 |
|
|
* Purpose: cycle through given values |
15 |
|
|
* Input: name = name of cycle (optional) |
16 |
|
|
* values = comma separated list of values to cycle, |
17 |
|
|
* or an array of values to cycle |
18 |
|
|
* (this can be left out for subsequent calls) |
19 |
|
|
* |
20 |
|
|
* reset = boolean - resets given var to true |
21 |
|
|
* print = boolean - print var or not. default is true |
22 |
|
|
* advance = boolean - whether or not to advance the cycle |
23 |
|
|
* delimiter = the value delimiter, default is "," |
24 |
|
|
* assign = boolean, assigns to template var instead of |
25 |
|
|
* printed. |
26 |
|
|
* |
27 |
|
|
* Examples: {cycle values="#eeeeee,#d0d0d0d"} |
28 |
|
|
* {cycle name=row values="one,two,three" reset=true} |
29 |
|
|
* {cycle name=row} |
30 |
|
|
* ------------------------------------------------------------- |
31 |
|
|
*/ |
32 |
|
|
function smarty_function_debug($params, &$smarty) |
33 |
|
|
{ |
34 |
|
|
if($params['output']) { |
35 |
|
|
$smarty->assign('_smarty_debug_output',$params['output']); |
36 |
|
|
} |
37 |
|
|
echo $smarty->_generate_debug_output(); |
38 |
|
|
} |
39 |
|
|
|
40 |
|
|
/* vim: set expandtab: */ |
41 |
|
|
|
42 |
|
|
?> |