PEEL Shopping
Open source ecommerce : PEEL Shopping
modifier.debug_print_var.php
Go to the documentation of this file.
1 <?php
22 function smarty_modifier_debug_print_var ($var, $depth = 0, $length = 40)
23 {
24  $_replace = array("\n" => '<i>\n</i>',
25  "\r" => '<i>\r</i>',
26  "\t" => '<i>\t</i>'
27  );
28 
29  switch (gettype($var)) {
30  case 'array' :
31  $results = '<b>Array (' . count($var) . ')</b>';
32  foreach ($var as $curr_key => $curr_val) {
33  $results .= '<br>' . str_repeat('&nbsp;', $depth * 2)
34  . '<b>' . strtr($curr_key, $_replace) . '</b> =&gt; '
35  . smarty_modifier_debug_print_var($curr_val, ++$depth, $length);
36  $depth--;
37  }
38  break;
39 
40  case 'object' :
41  $object_vars = get_object_vars($var);
42  $results = '<b>' . get_class($var) . ' Object (' . count($object_vars) . ')</b>';
43  foreach ($object_vars as $curr_key => $curr_val) {
44  $results .= '<br>' . str_repeat('&nbsp;', $depth * 2)
45  . '<b> -&gt;' . strtr($curr_key, $_replace) . '</b> = '
46  . smarty_modifier_debug_print_var($curr_val, ++$depth, $length);
47  $depth--;
48  }
49  break;
50 
51  case 'boolean' :
52  case 'NULL' :
53  case 'resource' :
54  if (true === $var) {
55  $results = 'true';
56  } elseif (false === $var) {
57  $results = 'false';
58  } elseif (null === $var) {
59  $results = 'null';
60  } else {
61  $results = htmlspecialchars((string) $var);
62  }
63  $results = '<i>' . $results . '</i>';
64  break;
65 
66  case 'integer' :
67  case 'float' :
68  $results = htmlspecialchars((string) $var);
69  break;
70 
71  case 'string' :
72  $results = strtr($var, $_replace);
73  if (Smarty::$_MBSTRING) {
74  if (mb_strlen($var, Smarty::$_CHARSET) > $length) {
75  $results = mb_substr($var, 0, $length - 3, Smarty::$_CHARSET) . '...';
76  }
77  } else {
78  if (isset($var[$length])) {
79  $results = substr($var, 0, $length - 3) . '...';
80  }
81  }
82 
83  $results = htmlspecialchars('"' . $results . '"');
84  break;
85 
86  case 'unknown type' :
87  default :
88  $results = strtr((string) $var, $_replace);
89  if (Smarty::$_MBSTRING) {
90  if (mb_strlen($results, Smarty::$_CHARSET) > $length) {
91  $results = mb_substr($results, 0, $length - 3, Smarty::$_CHARSET) . '...';
92  }
93  } else {
94  if (strlen($results) > $length) {
95  $results = substr($results, 0, $length - 3) . '...';
96  }
97  }
98 
99  $results = htmlspecialchars($results);
100  }
101 
102  return $results;
103 }
104 
105 ?>
static $_MBSTRING
Flag denoting if Multibyte String functions are available.
smarty_modifier_debug_print_var($var, $depth=0, $length=40)
Smarty debug_print_var modifier 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
static $_CHARSET
The character set to adhere to (e.g.

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.