ThemeHandler::refreshInfo

public ThemeHandler::refreshInfo()

Refreshes the theme info data of currently installed themes.

Modules can alter theme info, so this is typically called after a module has been installed or uninstalled.

Overrides ThemeHandlerInterface::refreshInfo

File

core/lib/Drupal/Core/Extension/ThemeHandler.php, line 218

Class

ThemeHandler
Default theme handler using the config system to store installation statuses.

Namespace

Drupal\Core\Extension

Code

public function refreshInfo() {
  $this->reset();
  $extension_config = $this->configFactory->get('core.extension');
  $installed = $extension_config->get('theme');

  // @todo Avoid re-scanning all themes by retaining the original (unaltered)
  //   theme info somewhere.
  $list = $this->rebuildThemeData();
  foreach ($list as $name => $theme) {
    if (isset($installed[$name])) {
      $this->addTheme($theme);
    }
  }
  $this->state->set('system.theme.data', $this->list);
}
doc_Drupal
2016-10-29 09:47:59
Comments
Leave a Comment

Please login to continue.