You are here

public function SkinEditForm::updateElement in Skinr 8.2

Handles switching the available elements based on the selected theme and element type.

File

skinr_ui/src/Form/SkinEditForm.php, line 60
Contains Drupal\skinr_ui\Form\SkinEditForm.

Class

SkinEditForm

Namespace

Drupal\skinr_ui\Form

Code

public function updateElement($form, FormStateInterface $form_state) {
  $theme_name = $form_state
    ->getValue('theme');
  $element_type = $form_state
    ->getValue('element_type');
  $form['element']['#options'] = self::elementOptions($theme_name, $element_type);
  Select::processSelect($form['element'], $form_state, $form);
  return $form['element'];
}