| 1: | <?php
|
| 2: | |
| 3: | |
| 4: | |
| 5: | |
| 6: | |
| 7: | |
| 8: | |
| 9: |
|
| 10: |
|
| 11: | |
| 12: | |
| 13: | |
| 14: | |
| 15: | |
| 16: |
|
| 17: | class Smarty_Internal_Nocache_Insert
|
| 18: | {
|
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | |
| 24: | |
| 25: | |
| 26: | |
| 27: | |
| 28: | |
| 29: |
|
| 30: | public static function compile($_function, $_attr, $_template, $_script, $_assign = null)
|
| 31: | {
|
| 32: | $_output = '<?php ';
|
| 33: | if ($_script !== 'null') {
|
| 34: |
|
| 35: |
|
| 36: | $_output .= "require_once '{$_script}';";
|
| 37: | }
|
| 38: |
|
| 39: | if (isset($_assign)) {
|
| 40: | $_output .= "\$_smarty_tpl->assign('{$_assign}' , {$_function} (" . var_export($_attr, true) .
|
| 41: | ',\$_smarty_tpl), true);?>';
|
| 42: | } else {
|
| 43: | $_output .= "echo {$_function}(" . var_export($_attr, true) . ',$_smarty_tpl);?>';
|
| 44: | }
|
| 45: | $_tpl = $_template;
|
| 46: | while ($_tpl->_isSubTpl()) {
|
| 47: | $_tpl = $_tpl->parent;
|
| 48: | }
|
| 49: | return "/*%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/{$_output}/*/%%SmartyNocache:{$_tpl->compiled->nocache_hash}%%*/";
|
| 50: | }
|
| 51: | }
|
| 52: | |