| 1 | <?php | <?php | 
| 2 |  | /** | 
|  | /* |  | 
| 3 | * Smarty plugin | * Smarty plugin | 
| 4 | * ------------------------------------------------------------- | * @package Smarty | 
| 5 | * Type:     function | * @subpackage plugins | 
| 6 | * Name:     cycle | */ | 
| 7 | * Version:  1.3 |  | 
| 8 | * Date:     May 3, 2002 |  | 
| 9 | * Author:       Monte Ohrt <monte@ispi.net> | /** | 
| 10 | * Credits:  Mark Priatel <mpriatel@rogers.com> | * Smarty {debug} function plugin | 
|  | *           Gerard <gerard@interfold.com> |  | 
|  | *           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, |  | 
|  | *                    or an array of values to cycle |  | 
|  | *                    (this can be left out for subsequent calls) |  | 
| 11 | * | * | 
| 12 | *           reset = boolean - resets given var to true | * Type:     function<br> | 
| 13 | *                       print = boolean - print var or not. default is true | * Name:     debug<br> | 
| 14 | *           advance = boolean - whether or not to advance the cycle | * Date:     July 1, 2002<br> | 
| 15 | *           delimiter = the value delimiter, default is "," | * Purpose:  popup debug window | 
| 16 | *           assign = boolean, assigns to template var instead of | * @link http://smarty.php.net/manual/en/language.function.debug.php {debug} | 
| 17 | *                    printed. | *       (Smarty online manual) | 
| 18 | * | * @author   Monte Ohrt <monte@ispi.net> | 
| 19 | * Examples: {cycle values="#eeeeee,#d0d0d0d"} | * @version  1.0 | 
| 20 | *           {cycle name=row values="one,two,three" reset=true} | * @param array | 
| 21 | *           {cycle name=row} | * @param Smarty | 
| 22 | * ------------------------------------------------------------- | * @return string output from {@link Smarty::_generate_debug_output()} | 
| 23 | */ | */ | 
| 24 | function smarty_function_debug($params, &$smarty) | function smarty_function_debug($params, &$smarty) | 
| 25 | { | { | 
| 26 | if($params['output']) { | if($params['output']) { | 
| 27 | $smarty->assign('_smarty_debug_output',$params['output']); | $smarty->assign('_smarty_debug_output',$params['output']); | 
| 28 | } | } | 
| 29 | echo $smarty->_generate_debug_output(); | require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.display_debug_console.php'); | 
| 30 |  | return smarty_core_display_debug_console(null, $smarty); | 
| 31 | } | } | 
| 32 |  |  | 
| 33 | /* vim: set expandtab: */ | /* vim: set expandtab: */ |