You are here

function list_themes in Drupal 4

Same name and namespace in other branches
  1. 5 includes/theme.inc \list_themes()
  2. 6 includes/theme.inc \list_themes()
  3. 7 includes/theme.inc \list_themes()

Provides a list of currently available themes.

Parameters

$refresh: Whether to reload the list of themes from the database.

Return value

An array of the currently available themes.

7 calls to list_themes()
block_menu in modules/block.module
Implementation of hook_menu().
init_theme in includes/theme.inc
Initialize the theme system by loading the theme.
path_to_theme in includes/theme.inc
Return the path to the currently selected theme.
system_menu in modules/system.module
Implementation of hook_menu().
system_theme_select_form in modules/system.module
Returns a fieldset containing the theme select form.

... See full list

File

includes/theme.inc, line 93
The theme system, which controls the output of Drupal.

Code

function list_themes($refresh = FALSE) {
  static $list;
  if ($refresh) {
    unset($list);
  }
  if (!$list) {
    $list = array();
    $result = db_query("SELECT * FROM {system} WHERE type = 'theme'");
    while ($theme = db_fetch_object($result)) {
      if (file_exists($theme->filename)) {
        $list[$theme->name] = $theme;
      }
    }
  }
  return $list;
}