summaryrefslogtreecommitdiff
path: root/libs/sysplugins/smarty_internal_compile_private_print_expression.php
diff options
context:
space:
mode:
authoruwetews <uwe.tews@googlemail.com>2016-02-09 01:27:15 +0100
committeruwetews <uwe.tews@googlemail.com>2016-02-09 01:27:15 +0100
commitb04486a091558a2b1280e3ee7fb90758e9a32230 (patch)
treeddb15a12dba78e6873a348acd25f872429e210d2 /libs/sysplugins/smarty_internal_compile_private_print_expression.php
parentc59ca44b9ff62a7f54e30409514834a8529780ca (diff)
downloadsmarty-b04486a091558a2b1280e3ee7fb90758e9a32230.tar.gz
smarty-b04486a091558a2b1280e3ee7fb90758e9a32230.tar.bz2
smarty-b04486a091558a2b1280e3ee7fb90758e9a32230.zip
- reformat all code for unique style
Diffstat (limited to 'libs/sysplugins/smarty_internal_compile_private_print_expression.php')
-rw-r--r--libs/sysplugins/smarty_internal_compile_private_print_expression.php61
1 files changed, 35 insertions, 26 deletions
diff --git a/libs/sysplugins/smarty_internal_compile_private_print_expression.php b/libs/sysplugins/smarty_internal_compile_private_print_expression.php
index c0c089bf..13b1e855 100644
--- a/libs/sysplugins/smarty_internal_compile_private_print_expression.php
+++ b/libs/sysplugins/smarty_internal_compile_private_print_expression.php
@@ -47,58 +47,63 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C
// check and get attributes
$_attr = $this->getAttributes($compiler, $args);
// nocache option
- if ($_attr['nocache'] === true) {
+ if ($_attr[ 'nocache' ] === true) {
$compiler->tag_nocache = true;
}
- if (isset($_attr['assign'])) {
+ if (isset($_attr[ 'assign' ])) {
// assign output to variable
$output = "<?php \$_smarty_tpl->assign({$_attr['assign']},{$parameter['value']});?>";
} else {
// display value
- $output = $parameter['value'];
+ $output = $parameter[ 'value' ];
// tag modifier
- if (!empty($parameter['modifierlist'])) {
- $output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifierlist'],
- 'value' => $output));
+ if (!empty($parameter[ 'modifierlist' ])) {
+ $output = $compiler->compileTag('private_modifier', array(),
+ array('modifierlist' => $parameter[ 'modifierlist' ],
+ 'value' => $output));
}
- if (!$_attr['nofilter']) {
+ if (!$_attr[ 'nofilter' ]) {
// default modifier
if (!empty($compiler->smarty->default_modifiers)) {
if (empty($compiler->default_modifier_list)) {
$modifierlist = array();
foreach ($compiler->smarty->default_modifiers as $key => $single_default_modifier) {
- preg_match_all('/(\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'|"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|:|[^:]+)/', $single_default_modifier, $mod_array);
- for ($i = 0, $count = count($mod_array[0]); $i < $count; $i ++) {
- if ($mod_array[0][$i] != ':') {
- $modifierlist[$key][] = $mod_array[0][$i];
+ preg_match_all('/(\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'|"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|:|[^:]+)/',
+ $single_default_modifier, $mod_array);
+ for ($i = 0, $count = count($mod_array[ 0 ]); $i < $count; $i ++) {
+ if ($mod_array[ 0 ][ $i ] != ':') {
+ $modifierlist[ $key ][] = $mod_array[ 0 ][ $i ];
}
}
}
$compiler->default_modifier_list = $modifierlist;
}
- $output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => $compiler->default_modifier_list,
- 'value' => $output));
+ $output = $compiler->compileTag('private_modifier', array(),
+ array('modifierlist' => $compiler->default_modifier_list,
+ 'value' => $output));
}
// autoescape html
if ($compiler->template->smarty->escape_html) {
$output = "htmlspecialchars({$output}, ENT_QUOTES, '" . addslashes(Smarty::$_CHARSET) . "')";
}
// loop over registered filters
- if (!empty($compiler->template->smarty->registered_filters[Smarty::FILTER_VARIABLE])) {
- foreach ($compiler->template->smarty->registered_filters[Smarty::FILTER_VARIABLE] as $key =>
+ if (!empty($compiler->template->smarty->registered_filters[ Smarty::FILTER_VARIABLE ])) {
+ foreach ($compiler->template->smarty->registered_filters[ Smarty::FILTER_VARIABLE ] as $key =>
$function) {
if (!is_array($function)) {
$output = "{$function}({$output},\$_smarty_tpl)";
- } elseif (is_object($function[0])) {
- $output = "\$_smarty_tpl->smarty->registered_filters[Smarty::FILTER_VARIABLE]['{$key}'][0]->{$function[1]}({$output},\$_smarty_tpl)";
+ } elseif (is_object($function[ 0 ])) {
+ $output =
+ "\$_smarty_tpl->smarty->registered_filters[Smarty::FILTER_VARIABLE]['{$key}'][0]->{$function[1]}({$output},\$_smarty_tpl)";
} else {
$output = "{$function[0]}::{$function[1]}({$output},\$_smarty_tpl)";
}
}
}
// auto loaded filters
- if (isset($compiler->smarty->autoload_filters[Smarty::FILTER_VARIABLE])) {
- foreach ((array) $compiler->template->smarty->autoload_filters[Smarty::FILTER_VARIABLE] as $name) {
+ if (isset($compiler->smarty->autoload_filters[ Smarty::FILTER_VARIABLE ])) {
+ foreach ((array) $compiler->template->smarty->autoload_filters[ Smarty::FILTER_VARIABLE ] as $name)
+ {
$result = $this->compile_output_filter($compiler, $name, $output);
if ($result !== false) {
$output = $result;
@@ -110,12 +115,12 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C
}
foreach ($compiler->variable_filters as $filter) {
if (count($filter) == 1 &&
- ($result = $this->compile_output_filter($compiler, $filter[0], $output)) !== false
+ ($result = $this->compile_output_filter($compiler, $filter[ 0 ], $output)) !== false
) {
$output = $result;
} else {
- $output = $compiler->compileTag('private_modifier', array(), array('modifierlist' => array($filter),
- 'value' => $output));
+ $output = $compiler->compileTag('private_modifier', array(),
+ array('modifierlist' => array($filter), 'value' => $output));
}
}
}
@@ -140,11 +145,15 @@ class Smarty_Internal_Compile_Private_Print_Expression extends Smarty_Internal_C
$path = $compiler->smarty->loadPlugin($plugin_name, false);
if ($path) {
if ($compiler->template->caching) {
- $compiler->parent_compiler->template->compiled->required_plugins['nocache'][$name][Smarty::FILTER_VARIABLE]['file'] = $path;
- $compiler->parent_compiler->template->compiled->required_plugins['nocache'][$name][Smarty::FILTER_VARIABLE]['function'] = $plugin_name;
+ $compiler->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $name ][ Smarty::FILTER_VARIABLE ][ 'file' ] =
+ $path;
+ $compiler->parent_compiler->template->compiled->required_plugins[ 'nocache' ][ $name ][ Smarty::FILTER_VARIABLE ][ 'function' ] =
+ $plugin_name;
} else {
- $compiler->parent_compiler->template->compiled->required_plugins['compiled'][$name][Smarty::FILTER_VARIABLE]['file'] = $path;
- $compiler->parent_compiler->template->compiled->required_plugins['compiled'][$name][Smarty::FILTER_VARIABLE]['function'] = $plugin_name;
+ $compiler->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $name ][ Smarty::FILTER_VARIABLE ][ 'file' ] =
+ $path;
+ $compiler->parent_compiler->template->compiled->required_plugins[ 'compiled' ][ $name ][ Smarty::FILTER_VARIABLE ][ 'function' ] =
+ $plugin_name;
}
} else {
// not found