Ejemplo n.º 1
0
 /**
  * Get list of themes
  *
  * @return array
  */
 public static function get_themes()
 {
     //get from preload object
     $themes = T3Preload::getObject('themes');
     if ($themes) {
         return $themes;
     }
     $path = T3Path::path(T3_TEMPLATE) . DS . 'themes';
     // Check if template use newest folder structure or not
     // If themes exists in template folder, considered as template use newest folder structure
     if (@is_dir($path)) {
         $themes['engine.default'] = array('engine', 'default');
         $themes['template.default'] = array('template', 'default');
         $theme_list = JFolder::folders($path);
         if (!empty($theme_list)) {
             foreach ($theme_list as $folder) {
                 $themes['core' . $folder] = array('core', $folder);
             }
         }
     } else {
         // Compatible: if template still use older folder structure, try to use it.
         $themes["engine.default"] = array('engine', 'default');
         $themes["template.default"] = array('template', 'default');
         $core_themes = is_dir(T3Path::path(T3_TEMPLATE_CORE) . DS . 'themes') ? @JFolder::folders(T3Path::path(T3_TEMPLATE_CORE) . DS . 'themes') : null;
         if ($core_themes) {
             foreach ($core_themes as $theme) {
                 $themes["core.{$theme}"] = array('core', $theme);
             }
         }
         $local_themes = is_dir(T3Path::path(T3_TEMPLATE_LOCAL) . DS . 'themes') ? @JFolder::folders(T3Path::path(T3_TEMPLATE_LOCAL) . DS . 'themes') : null;
         if ($local_themes) {
             foreach ($local_themes as $theme) {
                 $themes["local.{$theme}"] = array('local', $theme);
             }
         }
     }
     return $themes;
 }
Ejemplo n.º 2
0
 function get_themes()
 {
     //get from preload object
     $themes = T3Preload::getObject('themes');
     if ($themes) {
         return $themes;
     }
     $themes["engine.default"] = array('engine', 'default');
     $themes["template.default"] = array('template', 'default');
     $core_themes = is_dir(T3Path::path(T3_TEMPLATE_CORE) . DS . 'themes') ? @JFolder::folders(T3Path::path(T3_TEMPLATE_CORE) . DS . 'themes') : null;
     if ($core_themes) {
         foreach ($core_themes as $theme) {
             $themes["core.{$theme}"] = array('core', $theme);
         }
     }
     $local_themes = is_dir(T3Path::path(T3_TEMPLATE_LOCAL) . DS . 'themes') ? @JFolder::folders(T3Path::path(T3_TEMPLATE_LOCAL) . DS . 'themes') : null;
     if ($local_themes) {
         foreach ($local_themes as $theme) {
             $themes["local.{$theme}"] = array('local', $theme);
         }
     }
     return $themes;
 }