28 public function compile($args, $compiler, $parameter)
31 $this->required_attributes = array(
'var',
'value');
32 $this->shorttag_order = array(
'var',
'value');
33 $this->optional_attributes = array(
'scope');
39 if ($compiler->tag_nocache || $compiler->nocache) {
42 if (isset($compiler->template->tpl_vars[trim($_attr[
'var'],
"'")])) {
43 $compiler->template->tpl_vars[trim($_attr[
'var'],
"'")]->nocache =
true;
45 $compiler->template->tpl_vars[trim($_attr[
'var'],
"'")] =
new Smarty_variable(null,
true);
49 if (isset($_attr[
'scope'])) {
50 $_attr[
'scope'] = trim($_attr[
'scope'],
"'\"");
51 if ($_attr[
'scope'] ==
'parent') {
53 }
elseif ($_attr[
'scope'] ==
'root') {
55 }
elseif ($_attr[
'scope'] ==
'global') {
58 $compiler->trigger_template_error(
'illegal value for "scope" attribute', $compiler->lex->taglineno);
62 if (isset($parameter[
'smarty_internal_index'])) {
63 $output =
"<?php \$_smarty_tpl->createLocalArrayVariable($_attr[var], $_nocache, $_scope);\n\$_smarty_tpl->tpl_vars[$_attr[var]]->value$parameter[smarty_internal_index] = $_attr[value];";
66 if ($compiler->template->smarty instanceof SmartyBC) {
67 $output =
"<?php if (isset(\$_smarty_tpl->tpl_vars[$_attr[var]])) {\$_smarty_tpl->tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]];";
68 $output .=
"\n\$_smarty_tpl->tpl_vars[$_attr[var]]->value = $_attr[value]; \$_smarty_tpl->tpl_vars[$_attr[var]]->nocache = $_nocache; \$_smarty_tpl->tpl_vars[$_attr[var]]->scope = $_scope;";
69 $output .=
"\n} else \$_smarty_tpl->tpl_vars[$_attr[var]] = new Smarty_variable($_attr[value], $_nocache, $_scope);";
71 $output =
"<?php \$_smarty_tpl->tpl_vars[$_attr[var]] = new Smarty_variable($_attr[value], $_nocache, $_scope);";
75 $output .=
"\nif (\$_smarty_tpl->parent != null) \$_smarty_tpl->parent->tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]];";
77 $output .=
"\n\$_ptr = \$_smarty_tpl->parent; while (\$_ptr != null) {\$_ptr->tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]]; \$_ptr = \$_ptr->parent; }";
80 $output .=
"\nSmarty::\$global_tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]];";
compile($args, $compiler, $parameter)
Compiles code for the {assign} tag.
getAttributes($compiler, $attributes)
This function checks if the attributes passed are valid.
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))
const SCOPE_LOCAL
define variable scopes