1: | <?php
|
2: |
|
3: | |
4: | |
5: | |
6: | |
7: | |
8: | |
9: | |
10: | |
11: |
|
12: | class Smarty_Internal_Method_GetTags
|
13: | {
|
14: | |
15: | |
16: | |
17: | |
18: |
|
19: | public $objMap = 3;
|
20: |
|
21: | |
22: | |
23: | |
24: | |
25: | |
26: | |
27: | |
28: | |
29: | |
30: | |
31: | |
32: | |
33: |
|
34: | public function getTags(Smarty_Internal_TemplateBase $obj, $template = null)
|
35: | {
|
36: |
|
37: | $smarty = $obj->_getSmartyObj();
|
38: | if ($obj->_isTplObj() && !isset($template)) {
|
39: | $tpl = clone $obj;
|
40: | } elseif (isset($template) && $template->_isTplObj()) {
|
41: | $tpl = clone $template;
|
42: | } elseif (isset($template) && is_string($template)) {
|
43: |
|
44: | $tpl = new $smarty->template_class($template, $smarty);
|
45: |
|
46: | if (!$tpl->source->exists) {
|
47: | throw new SmartyException("Unable to load template {$tpl->source->type} '{$tpl->source->name}'");
|
48: | }
|
49: | }
|
50: | if (isset($tpl)) {
|
51: | $tpl->smarty = clone $tpl->smarty;
|
52: | $tpl->smarty->_cache[ 'get_used_tags' ] = true;
|
53: | $tpl->_cache[ 'used_tags' ] = array();
|
54: | $tpl->smarty->merge_compiled_includes = false;
|
55: | $tpl->smarty->disableSecurity();
|
56: | $tpl->caching = Smarty::CACHING_OFF;
|
57: | $tpl->loadCompiler();
|
58: | $tpl->compiler->compileTemplate($tpl);
|
59: | return $tpl->_cache[ 'used_tags' ];
|
60: | }
|
61: | throw new SmartyException('Missing template specification');
|
62: | }
|
63: | }
|
64: | |