Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cSmartyBackend
  • cSmartyFrontend
  • cSmartyWrapper
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
 1: <?php
 2: /**
 3:  * This file contains the wrapper class for smarty wrapper plugin.
 4:  *
 5:  * @package Plugin
 6:  * @subpackage SmartyWrapper
 7:  * @author Andreas Dieter
 8:  * @copyright four for business AG <www.4fb.de>
 9:  * @license http://www.contenido.org/license/LIZENZ.txt
10:  * @link http://www.4fb.de
11:  * @link http://www.contenido.org
12:  */
13: 
14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
15: 
16: /**
17:  * Wrapper class for Integration of smarty.
18:  *
19:  * @package Plugin
20:  * @subpackage SmartyWrapper
21:  */
22: class cSmartyWrapper extends Smarty {
23: 
24:     /**
25:      *
26:      * @see Smarty_Internal_TemplateBase::fetch()
27:      */
28:     public function fetch($template = NULL, $cache_id = NULL, $compile_id = NULL, $parent = NULL, $display = false, $merge_tpl_vars = true, $no_output_filter = false) {
29:         if ($this->templateExists($template) === false) {
30:             $moduleId = (int) cRegistry::getCurrentModuleId();
31:             if ($moduleId > 0) {
32:                 $module = new cModuleHandler($moduleId);
33:                 $template = $module->getTemplatePath($template);
34:             }
35:         }
36: 
37:         return parent::fetch($template, $cache_id, $compile_id, $parent, $display, $merge_tpl_vars, $no_output_filter);
38:     }
39: 
40:     /**
41:      *
42:      * @see Smarty_Internal_TemplateBase::fetch()
43:      */
44:     public function fetchGeneral($template = NULL, $cache_id = NULL, $compile_id = NULL, $parent = NULL, $display = false, $merge_tpl_vars = true, $no_output_filter = false) {
45:         $template = cRegistry::getFrontendPath() . 'templates/' . $template;
46: 
47:         return parent::fetch($template, $cache_id, $compile_id, $parent, $display, $merge_tpl_vars, $no_output_filter);
48:     }
49: 
50:     public function display($template = NULL, $cache_id = NULL, $compile_id = NULL, $parent = NULL) {
51:         global $frontend_debug;
52: 
53:         if ($this->templateExists($template) === false) {
54:             $moduleId = (int) cRegistry::getCurrentModuleId();
55:             if ($moduleId > 0) {
56:                 $module = new cModuleHandler($moduleId);
57:                 $template = $module->getTemplatePath($template);
58:             }
59:         }
60: 
61:         if ($frontend_debug['template_display']) {
62:             echo("<!-- SMARTY TEMPLATE " . $template . " -->");
63:         }
64: 
65:         return parent::display($template, $cache_id, $compile_id, $parent);
66:     }
67: 
68:     /**
69:      *
70:      * @see Smarty_Internal_TemplateBase::display()
71:      */
72:     public function displayGeneral($template = NULL, $cache_id = NULL, $compile_id = NULL, $parent = NULL) {
73:         $this->fetchGeneral($template, $cache_id, $compile_id, $parent, true);
74:     }
75: 
76:     /**
77:      * Empty cache for a specific template
78:      *
79:      * @param string  $template_name template name
80:      * @param string  $cache_id      cache id
81:      * @param string  $compile_id    compile id
82:      * @param integer $exp_time      expiration time
83:      * @param string  $type          resource type
84:      * @return integer number of cache files deleted
85:      */
86:     public function clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null) {
87:         if ($this->templateExists($template_name) === false) {
88:             $moduleId = (int) cRegistry::getCurrentModuleId();
89:             if ($moduleId > 0) {
90:                 $module = new cModuleHandler($moduleId);
91:                 $template_name = $module->getTemplatePath($template_name);
92:             }
93:         }
94: 
95:         return parent::clearCache($template_name, $cache_id, $compile_id, $exp_time, $type);
96:     }
97: 
98: }
CMS CONTENIDO 4.10.0 API documentation generated by ApiGen 2.8.0