You are here

public function CurrentThemeCondition::buildConfigurationForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php \Drupal\system\Plugin\Condition\CurrentThemeCondition::buildConfigurationForm()
  2. 9 core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php \Drupal\system\Plugin\Condition\CurrentThemeCondition::buildConfigurationForm()

File

core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php, line 79

Class

CurrentThemeCondition
Provides a 'Current Theme' condition.

Namespace

Drupal\system\Plugin\Condition

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
  $form['theme'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Theme'),
    '#default_value' => $this->configuration['theme'],
    '#options' => array_map(function ($theme_info) {
      return $theme_info->info['name'];
    }, $this->themeHandler
      ->listInfo()),
  ];
  return parent::buildConfigurationForm($form, $form_state);
}