You are here

function sweaver_get_all_themes in Sweaver 6

Same name and namespace in other branches
  1. 7 sweaver.module \sweaver_get_all_themes()

Return all enabled themes.

4 calls to sweaver_get_all_themes()
sweaver_get_theme_info in ./sweaver.module
Get theme info.
sweaver_plugin_themesettings::sweaver_get_theme_settings_form in plugins/sweaver_plugin_themesettings/sweaver_plugin_themesettings.inc
Get theme settings form. We basically copy the form from system.admin.inc. This makes it easer to copy the uploads of the favicon & logo to revision versions of the style and getting the right settings for the theme.
sweaver_plugin_themeswitch::sweaver_form in plugins/sweaver_plugin_themeswitch/sweaver_plugin_themeswitch.inc
Frontend form.
sweaver_plugin_themeswitch::sweaver_menu_callback in plugins/sweaver_plugin_themeswitch/sweaver_plugin_themeswitch.inc
Frontend themeswitch.

File

./sweaver.module, line 374
Sweaver functions.

Code

function sweaver_get_all_themes() {
  $themes =& ctools_static('all_themes', array());
  if (empty($themes)) {
    $themes = array();
    $result = db_query("SELECT filename, name, status, info FROM {system} WHERE type = 'theme' AND status = '1' ORDER BY name ASC");
    while ($theme = db_fetch_object($result)) {
      if ($theme->status) {
        $theme->info = unserialize($theme->info);
        $theme->prefix = isset($theme->info['engine']) ? $theme->info['engine'] : NULL;
        $themes[$theme->name] = $theme;
      }
    }
  }
  return $themes;
}