function CurrentThemeCondition::buildConfigurationForm

Same name in other branches
  1. 8.9.x core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php \Drupal\system\Plugin\Condition\CurrentThemeCondition::buildConfigurationForm()
  2. 10 core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php \Drupal\system\Plugin\Condition\CurrentThemeCondition::buildConfigurationForm()
  3. 11.x core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php \Drupal\system\Plugin\Condition\CurrentThemeCondition::buildConfigurationForm()

Overrides ConditionPluginBase::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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.