Definition

list_themes($refresh = FALSE)
drupal-5/includes/theme.inc, line 94

Description

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.

Code

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