list_themes

  1. drupal
    1. 4.7
    2. 5
    3. 6 theme.inc
    4. 7 theme.inc
Versions
4.7 – 7 list_themes($refresh = FALSE)

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 functions call 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.
system_update_145 in database/updates.inc
theme_get_setting in includes/theme.inc
Retrieve a setting for the current theme. This function is designed for use from within themes & engines to determine theme settings made in the admin interface.

Code

includes/theme.inc, line 94

<?php
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;
}
?>