コード例 #1
0
 public function __construct()
 {
     parent::__construct();
     $tpl = $this->templateLite;
     $tpl->register_prefilter('cacheLangs');
     $tpl->compile_check = Config::get("templateCompileCheckEnabled") ? true : false;
     if (Config::get("templateWhiteSpaceFilterEnabled")) {
         $tpl->load_filter("output", "trimwhitespace");
     }
     $tpl->register_modifier("action", array($this, "modifierAction"));
     $tpl->register_modifier("url", array($this, "modifierUrl"));
     $tpl->register_modifier("resurl", array($this, "modifierResUrl"));
     $tpl->register_modifier("objurl", array($this, "modifierObjUrl"));
     $tpl->register_modifier("realImgSrc", array($this, "realImgSrc"));
     $tpl->register_modifier("highlight", array($this, "highlight"));
     $tpl->register_modifier("domain", array($this, "domain"));
     $tpl->register_function("displayAd", array($this, "displayAd"));
     $tpl->register_function("display_time", array($this, "displayTime"));
     $tpl->register_function("saveReferrer", array($this, "saveReferrer"));
     $tpl->assign("session", new TemplateSession());
     if (!empty($_COOKIE['previewTemplateName']) && Session::getInstance()->get("role") == "administrator") {
         $this->templateName = basename($_COOKIE['previewTemplateName']);
     }
     if (Config::get("httpGzipCompressionEnabled") && !self::$gzipHandlerStarted) {
         @ob_start("ob_gzhandler");
         self::$gzipHandlerStarted = true;
     }
 }