PEEL Shopping
Open source ecommerce : PEEL Shopping
function.cycle.php
Go to the documentation of this file.
1 <?php
46 function smarty_function_cycle($params, $template)
47 {
48  static $cycle_vars;
49 
50  $name = (empty($params['name'])) ? 'default' : $params['name'];
51  $print = (isset($params['print'])) ? (bool)$params['print'] : true;
52  $advance = (isset($params['advance'])) ? (bool)$params['advance'] : true;
53  $reset = (isset($params['reset'])) ? (bool)$params['reset'] : false;
54 
55  if (!isset($params['values'])) {
56  if(!isset($cycle_vars[$name]['values'])) {
57  trigger_error("cycle: missing 'values' parameter");
58  return;
59  }
60  } else {
61  if(isset($cycle_vars[$name]['values'])
62  && $cycle_vars[$name]['values'] != $params['values'] ) {
63  $cycle_vars[$name]['index'] = 0;
64  }
65  $cycle_vars[$name]['values'] = $params['values'];
66  }
67 
68  if (isset($params['delimiter'])) {
69  $cycle_vars[$name]['delimiter'] = $params['delimiter'];
70  } elseif (!isset($cycle_vars[$name]['delimiter'])) {
71  $cycle_vars[$name]['delimiter'] = ',';
72  }
73 
74  if(is_array($cycle_vars[$name]['values'])) {
75  $cycle_array = $cycle_vars[$name]['values'];
76  } else {
77  $cycle_array = explode($cycle_vars[$name]['delimiter'],$cycle_vars[$name]['values']);
78  }
79 
80  if(!isset($cycle_vars[$name]['index']) || $reset ) {
81  $cycle_vars[$name]['index'] = 0;
82  }
83 
84  if (isset($params['assign'])) {
85  $print = false;
86  $template->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]);
87  }
88 
89  if($print) {
90  $retval = $cycle_array[$cycle_vars[$name]['index']];
91  } else {
92  $retval = null;
93  }
94 
95  if($advance) {
96  if ( $cycle_vars[$name]['index'] >= count($cycle_array) -1 ) {
97  $cycle_vars[$name]['index'] = 0;
98  } else {
99  $cycle_vars[$name]['index']++;
100  }
101  }
102 
103  return $retval;
104 }
105 
106 ?>
smarty_function_cycle($params, $template)
Smarty {cycle} function plugin.
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
Definition: chart-data.php:160

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:16 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.