list_themes

Versions
4.6 – 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.

▾ 8 functions call 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().
system_theme_select_form in modules/system/system.module
Returns a fieldset containing the theme select form.
system_update_145 in modules/system/system.install
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;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.