function list_themes in Drupal 5
Same name and namespace in other branches
- 4 includes/theme.inc \list_themes()
- 6 includes/theme.inc \list_themes()
- 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.
8 calls to list_themes()
- block_menu in modules/
block/ block.module - Implementation of hook_menu().
- color_form_alter in modules/
color/ color.module - Implementation of hook_form_alter().
- 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/ system.module - Implementation of hook_menu().
File
- includes/
theme.inc, line 94 - 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;
}