You are here

public function WebformTranslationConfigManager::alterForm in Webform 6.x

Alter config translation form.

Parameters

$form: Nested array of form elements that comprise the form.

$form_state: The current state of the form.

Overrides WebformTranslationConfigManagerInterface::alterForm

File

src/WebformTranslationConfigManager.php, line 107

Class

WebformTranslationConfigManager
Defines a class to translate webform config.

Namespace

Drupal\webform

Code

public function alterForm(&$form, FormStateInterface $form_state) {
  foreach ($form['config_names'] as $config_name => &$config_element) {
    if ($config_name === 'webform.settings') {
      $this
        ->alterConfigSettingsForm($config_name, $config_element);
    }
    elseif ($config_name === 'block.block.webform') {
      $this
        ->alterConfigBlockForm($config_name, $config_element);
    }
    elseif (strpos($config_name, 'field.field.') === 0) {
      $this
        ->alterConfigFieldForm($config_name, $config_element);
    }
    elseif (strpos($config_name, 'webform.webform_options.') === 0) {
      $this
        ->alterConfigOptionsForm($config_name, $config_element);
    }
    elseif (strpos($config_name, 'webform_options_custom.webform_options_custom.') === 0) {
      $this
        ->alterConfigOptionsCustomForm($config_name, $config_element);
    }
    elseif (strpos($config_name, 'webform_image_select.webform_image_select_images.') === 0) {
      $this
        ->alterConfigImageSelectForm($config_name, $config_element);
    }
    elseif (strpos($config_name, 'webform.webform.') === 0) {
      $this
        ->alterConfigWebformForm($config_name, $config_element, $form, $form_state);
    }
  }
}