Esempio n. 1
0
 /**
  *	Load Language Files
  *
  *	@param	string|array	File(s)
  *	@param	boolean			Force Reload
  *	@return	void
  */
 public function loadLanguageFile($files, $app = CTM_BOARD_APP, $forceReload = FALSE)
 {
     $app = strtolower($app) == "core" && CTM_ROOT_AREA == "admin" ? "admin_core" : strtolower($app);
     if ($forceReload == true) {
         $this->words = array();
     }
     if (is_string($files)) {
         if (!in_array($app . "::" . $files, $this->loadedLangs)) {
             if (file_exists(CTM_CACHE_PATH . "lang_cache/" . $this->language . "/" . $app . "/" . CTM_ROOT_AREA . "_" . $files . ".php")) {
                 require_once CTM_CACHE_PATH . "lang_cache/" . $this->language . "/" . $app . "/" . CTM_ROOT_AREA . "_" . $files . ".php";
                 $this->words = array_merge($this->words, $CTM_LANG);
                 $this->loadedLangs[] = $app . "::" . $files;
             } else {
                 CTM_Controller::DebugLog("Can not to open the language cache {" . CTM_ROOT_AREA . "::" . $files . "}");
             }
         }
     } else {
         foreach ($files as $file) {
             if (!in_array($app . "::" . $file, $this->loadedLangs)) {
                 if (file_exists(CTM_CACHE_PATH . "lang_file/" . $this->language . "/" . $app . "/" . CTM_ROOT_AREA . "_" . $file . ".php")) {
                     require_once CTM_CACHE_PATH . "lang_file/" . $this->language . "/" . $app . "/" . CTM_ROOT_AREA . "_" . $file . ".php";
                     $this->words = array_merge($this->words, $CTM_LANG);
                     $this->loadedLangs[] = $app . "::" . $file;
                 } else {
                     CTM_Controller::DebugLog("Can not to open the language cache {" . CTM_ROOT_AREA . "::" . $file . "}");
                 }
             }
         }
     }
 }
Esempio n. 2
0
 /**
  *	Load Skin Cache
  *
  *	@param	string	Skin file
  *	@param	string	Skin name
  *	@param	boolean	Set Global Content
  *	@param	string	Set Content
  *	@return	string	Skin content
  */
 public function loadSkinCache($category, $cache, $setGlobalContent = FALSE, $setContent = "subContent")
 {
     if ($this->noSetTemp == false) {
         if (file_exists(CTM_CACHE_PATH . "skin_cache/templates/" . $this->template . "/skin_" . $category . ".php")) {
             if (!$this->loadedCaches[$category]) {
                 require_once CTM_CACHE_PATH . "skin_cache/templates/" . $this->template . "/skin_" . $category . ".php";
                 $this->cacheClass[$category] = $callSkinCache;
                 $this->loadedCaches[$category] = array();
             }
             if (method_exists($this->cacheClass[$category], $cache)) {
                 if (!in_array($cache, $this->loadedCaches[$category])) {
                     $this->loadedCaches[$category][$cache] = $this->cacheClass[$category]->{$cache}();
                 }
                 $return = $this->loadedCaches[$category][$cache];
                 return $this->content[$setGlobalContent == true ? 'global' : $setContent] = $return;
             }
         } else {
             CTM_Controller::DebugLog("Can not to open the skin cache {" . $category . "::" . $cache . "}");
         }
     }
 }