function system_rebuild_theme_data

Rebuild, save, and return data about all currently available themes.

Return value

Array of all available themes and their data.

9 calls to system_rebuild_theme_data()
drupal_flush_all_caches in drupal/core/includes/common.inc
Flushes all persistent caches, resets all variables, and rebuilds all data structures.
locale_translation_project_list in drupal/core/modules/locale/locale.compare.inc
Fetch an array of projects for translation update.
ModuleApiTest::testThemeMetaData in drupal/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php
Tests whether the correct theme metadata is returned.
simpletest_test_get_all in drupal/core/modules/simpletest/simpletest.module
Get a list of all of the tests provided by the system.
system_list in drupal/core/includes/module.inc
Builds a list of bootstrap modules and enabled modules and themes.

... See full list

File

drupal/core/modules/system/system.module, line 2994
Configuration system that lets administrators modify the workings of the site.

Code

function system_rebuild_theme_data() {
  $themes = _system_rebuild_theme_data();
  ksort($themes);

  // @todo This function has no business in determining/setting the status of
  //   a theme, but various other functions expect it to return themes with a
  //   $status property. system_list() stores the return value of this function
  //   in state, and ensures to set/override the $status property for each theme
  //   based on the current config. Remove this code when themes have a proper
  //   installation status.
  // @see http://drupal.org/node/1067408
  $enabled_themes = (array) config('system.theme')
    ->get('enabled');
  $files = array();
  foreach ($themes as $name => $theme) {
    $theme->status = (int) isset($enabled_themes[$name]);
    $files[$name] = $theme->filename;
  }

  // Replace last known theme data state.
  // @todo Obsolete with proper installation status for themes.
  state()
    ->set('system.theme.data', $themes);

  // Store filenames to allow system_list() and drupal_get_filename() to
  // retrieve them without having to rebuild or scan the filesystem.
  state()
    ->set('system.theme.files', $files);
  return $themes;
}