summaryrefslogtreecommitdiff
path: root/lib/smarty/sysplugins/smarty_internal_compile_private_function_plugin.php
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2018-10-18 02:39:34 +0200
committeremkael <emkael@tlen.pl>2018-10-18 02:39:42 +0200
commitab5d8d4e07bb3c8230d0285ef8902ef1979fce51 (patch)
tree0b955e585cb2fdbc7207392a5f2c97d610b6a5bc /lib/smarty/sysplugins/smarty_internal_compile_private_function_plugin.php
parentc055ce2ab60c6582bad3e5babcb1d00384fde78a (diff)
Updating Smarty
Diffstat (limited to 'lib/smarty/sysplugins/smarty_internal_compile_private_function_plugin.php')
-rw-r--r--lib/smarty/sysplugins/smarty_internal_compile_private_function_plugin.php53
1 files changed, 29 insertions, 24 deletions
diff --git a/lib/smarty/sysplugins/smarty_internal_compile_private_function_plugin.php b/lib/smarty/sysplugins/smarty_internal_compile_private_function_plugin.php
index 70e7643..0558234 100644
--- a/lib/smarty/sysplugins/smarty_internal_compile_private_function_plugin.php
+++ b/lib/smarty/sysplugins/smarty_internal_compile_private_function_plugin.php
@@ -1,22 +1,21 @@
<?php
/**
* Smarty Internal Plugin Compile Function Plugin
- *
* Compiles code for the execution of function plugin
*
- * @package Smarty
+ * @package Smarty
* @subpackage Compiler
- * @author Uwe Tews
+ * @author Uwe Tews
*/
/**
* Smarty Internal Plugin Compile Function Plugin Class
*
- * @package Smarty
+ * @package Smarty
* @subpackage Compiler
*/
-class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_CompileBase {
-
+class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_CompileBase
+{
/**
* Attribute definition: Overwrites base class.
*
@@ -24,6 +23,7 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co
* @see Smarty_Internal_CompileBase
*/
public $required_attributes = array();
+
/**
* Attribute definition: Overwrites base class.
*
@@ -35,24 +35,21 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co
/**
* Compiles code for the execution of function plugin
*
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @param array $parameter array with compilation parameter
- * @param string $tag name of function plugin
- * @param string $function PHP function name
+ * @param array $args array with attributes from parser
+ * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
+ * @param array $parameter array with compilation parameter
+ * @param string $tag name of function plugin
+ * @param string $function PHP function name
+ *
* @return string compiled code
+ * @throws \SmartyCompilerException
+ * @throws \SmartyException
*/
- public function compile($args, $compiler, $parameter, $tag, $function)
+ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $function)
{
- // This tag does create output
- $compiler->has_output = true;
-
// check and get attributes
$_attr = $this->getAttributes($compiler, $args);
- if ($_attr['nocache'] === true) {
- $compiler->tag_nocache = true;
- }
- unset($_attr['nocache']);
+ unset($_attr[ 'nocache' ]);
// convert attributes into parameter array string
$_paramsArray = array();
foreach ($_attr as $_key => $_value) {
@@ -62,12 +59,20 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co
$_paramsArray[] = "'$_key'=>$_value";
}
}
- $_params = 'array(' . implode(",", $_paramsArray) . ')';
+ $_params = 'array(' . implode(',', $_paramsArray) . ')';
// compile code
- $output = "<?php echo {$function}({$_params},\$_smarty_tpl);?>\n";
+ $output = "{$function}({$_params},\$_smarty_tpl)";
+ if (!empty($parameter[ 'modifierlist' ])) {
+ $output = $compiler->compileTag(
+ 'private_modifier',
+ array(),
+ array(
+ 'modifierlist' => $parameter[ 'modifierlist' ],
+ 'value' => $output
+ )
+ );
+ }
+ $output = "<?php echo {$output};?>\n";
return $output;
}
-
}
-
-?> \ No newline at end of file