| 1: | <?php
|
| 2: | |
| 3: | |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | |
| 9: |
|
| 10: |
|
| 11: | |
| 12: | |
| 13: | |
| 14: | |
| 15: | |
| 16: |
|
| 17: | class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_CompileBase
|
| 18: | {
|
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: |
|
| 25: | public $required_attributes = array();
|
| 26: |
|
| 27: | |
| 28: | |
| 29: | |
| 30: | |
| 31: | |
| 32: |
|
| 33: | public $optional_attributes = array('_any');
|
| 34: |
|
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | |
| 45: | |
| 46: | |
| 47: |
|
| 48: | public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $function)
|
| 49: | {
|
| 50: |
|
| 51: | $_attr = $this->getAttributes($compiler, $args);
|
| 52: | unset($_attr[ 'nocache' ]);
|
| 53: |
|
| 54: | $_paramsArray = array();
|
| 55: | foreach ($_attr as $_key => $_value) {
|
| 56: | if (is_int($_key)) {
|
| 57: | $_paramsArray[] = "$_key=>$_value";
|
| 58: | } else {
|
| 59: | $_paramsArray[] = "'$_key'=>$_value";
|
| 60: | }
|
| 61: | }
|
| 62: | $_params = 'array(' . implode(',', $_paramsArray) . ')';
|
| 63: |
|
| 64: | $output = "{$function}({$_params},\$_smarty_tpl)";
|
| 65: | if (!empty($parameter[ 'modifierlist' ])) {
|
| 66: | $output = $compiler->compileTag(
|
| 67: | 'private_modifier',
|
| 68: | array(),
|
| 69: | array(
|
| 70: | 'modifierlist' => $parameter[ 'modifierlist' ],
|
| 71: | 'value' => $output
|
| 72: | )
|
| 73: | );
|
| 74: | }
|
| 75: | $output = "<?php echo {$output};?>\n";
|
| 76: | return $output;
|
| 77: | }
|
| 78: | }
|
| 79: | |