You are here

private function AdminSettingsForm::getThemeList in Role Theme Switcher 8

Gets a list of active themes without hidden ones.

Return value

array[] An array with all compatible active themes.

1 call to AdminSettingsForm::getThemeList()
AdminSettingsForm::buildForm in src/Form/AdminSettingsForm.php
Form constructor.

File

src/Form/AdminSettingsForm.php, line 177

Class

AdminSettingsForm
Provides the theme switcher configuration form.

Namespace

Drupal\role_theme_switcher\Form

Code

private function getThemeList() {
  $themes_list = [];
  $themes = $this->themeHandler
    ->listInfo();
  foreach ($themes as $theme) {
    if (!empty($theme->info['hidden'])) {
      continue;
    }
    $themes_list[$theme
      ->getName()] = $theme->info['name'];
  }
  return $themes_list;
}