34 $key = self::get_key($template);
35 self::$template_data[$key][
'start_time'] = microtime(
true);
45 $key = self::get_key($template);
46 self::$template_data[$key][
'compile_time'] += microtime(
true) - self::$template_data[$key][
'start_time'];
56 $key = self::get_key($template);
57 self::$template_data[$key][
'start_time'] = microtime(
true);
67 $key = self::get_key($template);
68 self::$template_data[$key][
'render_time'] += microtime(
true) - self::$template_data[$key][
'start_time'];
78 $key = self::get_key($template);
79 self::$template_data[$key][
'start_time'] = microtime(
true);
89 $key = self::get_key($template);
90 self::$template_data[$key][
'cache_time'] += microtime(
true) - self::$template_data[$key][
'start_time'];
101 $ptr = self::get_debug_vars($obj);
102 if ($obj instanceof
Smarty) {
103 $smarty = clone $obj;
105 $smarty = clone $obj->smarty;
107 $_assigned_vars = $ptr->tpl_vars;
108 ksort($_assigned_vars);
109 $_config_vars = $ptr->config_vars;
110 ksort($_config_vars);
111 $smarty->registered_filters = array();
112 $smarty->autoload_filters = array();
113 $smarty->default_modifiers = array();
114 $smarty->force_compile =
false;
115 $smarty->left_delimiter =
'{';
116 $smarty->right_delimiter =
'}';
117 $smarty->debugging =
false;
118 $smarty->force_compile =
false;
120 $_template->caching =
false;
121 $_template->disableSecurity();
122 $_template->cache_id = null;
123 $_template->compile_id = null;
125 $_template->assign(
'template_name', $obj->source->type .
':' . $obj->source->name);
127 if ($obj instanceof Smarty) {
128 $_template->assign(
'template_data', self::$template_data);
130 $_template->assign(
'template_data', null);
132 $_template->assign(
'assigned_vars', $_assigned_vars);
133 $_template->assign(
'config_vars', $_config_vars);
134 $_template->assign(
'execution_time', microtime(
true) - $smarty->start_time);
135 echo $_template->fetch();
148 foreach ($obj->tpl_vars as $key => $var) {
151 $tpl_vars[$key]->scope = $obj->source->type .
':' . $obj->source->name;
159 if (isset($obj->parent)) {
160 $parent = self::get_debug_vars($obj->parent);
165 if (!array_key_exists($name,
$tpl_vars)) {
167 $clone->scope =
'Global';
181 private static function get_key($template)
183 static $_is_stringy = array(
'string' =>
true,
'eval' =>
true);
185 if ($template->source->uid ==
'') {
186 $template->source->filepath;
188 $key = $template->source->uid;
189 if (isset(self::$template_data[$key])) {
192 if (isset($_is_stringy[$template->source->type])) {
193 self::$template_data[$key][
'name'] =
'\''.substr($template->source->name,0,25).
'...\'';
195 self::$template_data[$key][
'name'] = $template->source->filepath;
197 self::$template_data[$key][
'compile_time'] = 0;
198 self::$template_data[$key][
'render_time'] = 0;
199 self::$template_data[$key][
'cache_time'] = 0;
static end_compile($template)
End logging of compile time.
static start_cache($template)
Start logging of cache time.
static $global_tpl_vars
#@-
static end_cache($template)
End logging of cache time.
Smarty plugin to format text blocks.
static start_compile($template)
Start logging of compile time.
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))
static end_render($template)
End logging of compile time.
static display_debug($obj)
Opens a window for the Smarty Debugging Consol and display the data.
static get_debug_vars($obj)
Recursively gets variables from all template/data scopes.
static start_render($template)
Start logging of render time.