You are here

public function WebformThemeManager::getThemeNames in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/WebformThemeManager.php \Drupal\webform\WebformThemeManager::getThemeNames()

Get themes as associative array.

Return value

array An associative array containing theme name.

Overrides WebformThemeManagerInterface::getThemeNames

File

src/WebformThemeManager.php, line 110

Class

WebformThemeManager
Defines a class to manage webform theming.

Namespace

Drupal\webform

Code

public function getThemeNames() {
  $themes = [];
  foreach ($this->themeHandler
    ->listInfo() as $name => $theme) {
    if ($theme->status === 1) {
      $themes[$name] = $theme->info['name'];
    }
  }
  asort($themes);
  return [
    '' => $this
      ->t('Default'),
  ] + $themes;
}