You are here

protected function ThemeController::willInstallExperimentalTheme in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/src/Controller/ThemeController.php \Drupal\system\Controller\ThemeController::willInstallExperimentalTheme()

Checks if the given theme requires the installation of experimental themes.

Parameters

string $theme: The name of the theme to check.

Return value

bool Whether experimental themes will be installed.

2 calls to ThemeController::willInstallExperimentalTheme()
ThemeController::install in core/modules/system/src/Controller/ThemeController.php
Installs a theme.
ThemeController::setDefaultTheme in core/modules/system/src/Controller/ThemeController.php
Set the default theme.

File

core/modules/system/src/Controller/ThemeController.php, line 184

Class

ThemeController
Controller for theme handling.

Namespace

Drupal\system\Controller

Code

protected function willInstallExperimentalTheme($theme) {
  $all_themes = $this->themeList
    ->getList();
  $dependencies = array_keys($all_themes[$theme]->requires);
  $themes_to_enable = array_merge([
    $theme,
  ], $dependencies);
  foreach ($themes_to_enable as $name) {
    if (!empty($all_themes[$name]->info['experimental']) && $all_themes[$name]->status === 0) {
      return TRUE;
    }
  }
  return FALSE;
}