1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
15:
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17:
18: 19: 20: 21: 22: 23:
24: class cSmartyWrapper extends Smarty {
25:
26: 27: 28: 29:
30: public function fetch($template = NULL, $cache_id = NULL, $compile_id = NULL, $parent = NULL, $display = false, $merge_tpl_vars = true, $no_output_filter = false) {
31: if ($this->templateExists($template) === false) {
32: $moduleId = (int) cRegistry::getCurrentModuleId();
33: if ($moduleId > 0) {
34: $module = new cModuleHandler($moduleId);
35: $template = $module->getTemplatePath($template);
36: }
37: }
38:
39: return parent::fetch($template, $cache_id, $compile_id, $parent, $display, $merge_tpl_vars, $no_output_filter);
40: }
41:
42: 43: 44: 45:
46: public function fetchGeneral($template = NULL, $cache_id = NULL, $compile_id = NULL, $parent = NULL, $display = false, $merge_tpl_vars = true, $no_output_filter = false) {
47: $template = cRegistry::getFrontendPath() . 'templates/' . $template;
48:
49: return parent::fetch($template, $cache_id, $compile_id, $parent, $display, $merge_tpl_vars, $no_output_filter);
50: }
51:
52: 53: 54: 55:
56: public function displayGeneral($template = NULL, $cache_id = NULL, $compile_id = NULL, $parent = NULL) {
57: $this->fetchGeneral($template, $cache_id, $compile_id, $parent, true);
58: }
59:
60: }