Beispiel #1
0
 function load($template = '')
 {
     if (!$template) {
         $template = T3_ACTIVE_TEMPLATE;
     }
     if (isset($this->data[$template])) {
         return $this->data[$template];
     }
     //$key = T3Parameter::getKey ('preload-'.$template, 0);
     $key = T3Cache::getPreloadKey($template);
     $this->data[$template] = T3Cache::get_object($key);
     if (!$this->data[$template]) {
         $this->data[$template] = array();
         $themes = $this->getT3Themes($template);
         foreach ($themes as $theme => $path) {
             $this->scanFiles(JPATH_SITE . DS . $path, '\\.php|\\.js|\\.css|\\.bmp|\\.gif|\\.jpg|\\.png', $template);
         }
         /*			
         			//create fake html, css, image for template
         			foreach ($this->data[$template] as $f=>$file) {
         				if (preg_match ('/^html/', $f)) {
         					$this->buildLayoutFile ($f, $template);
         				} else if (preg_match ('/^css/', $f)) {
         					$this->buildCSSFile ($f, $template);
         				} else if (preg_match ('/^images/', $f)) {
         					$this->buildImageFile ($f, $template);
         				}
         			}
         */
         $this->data[$template]['themes'] = T3Common::get_themes();
         $this->data[$template]['layouts'] = T3Common::get_layouts();
         $this->data[$template]['profiles'] = T3Common::get_profiles();
         //store in cache
         T3Cache::store_object($this->data[$template], $key);
     }
 }
Beispiel #2
0
 function get_active_themes_info()
 {
     global $mainframe;
     //$key = T3Parameter::getKey ('themes-info',2);
     $key = T3Cache::getThemeKey();
     $themes_info = T3Cache::get_object($key);
     //force cache
     if ($themes_info && isset($themes_info['layout']) && $themes_info['layout']) {
         return $themes_info;
     }
     $themes = T3Common::get_active_themes();
     $themes[] = array('engine', 'default');
     $themes_info = null;
     foreach ($themes as $theme) {
         //$theme_info = T3Common::get_themes (implode('.', $theme));
         $theme_info = T3Common::get_theme_info($theme);
         if (!$theme_info) {
             continue;
         }
         if (!$themes_info) {
             $themes_info = $theme_info;
         } else {
             //merge info
             $themes_info = T3Common::merge_info($theme_info, $themes_info);
         }
     }
     //Get layout if tmpl is not component
     $themes_info['layout'] = null;
     $tmpl = JRequest::getCmd('tmpl');
     if ($tmpl != 'component') {
         $themes_info['layout'] = T3Common::get_layout_info();
     }
     T3Cache::store_object($themes_info, $key);
     return $themes_info;
 }