protected function VocabularyFormController::actions

Returns an array of supported actions for the current entity form.

Overrides EntityFormController::actions

File

drupal/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php, line 90
Definition of Drupal\taxonomy\VocabularyFormController.

Class

VocabularyFormController
Base form controller for vocabulary edit forms.

Namespace

Drupal\taxonomy

Code

protected function actions(array $form, array &$form_state) {

  // If we are displaying the delete confirmation skip the regular actions.
  if (empty($form_state['confirm_delete'])) {
    $actions = parent::actions($form, $form_state);
    array_unshift($actions['delete']['#submit'], array(
      $this,
      'submit',
    ));

    // Add the language configuration submit handler. This is needed because
    // the submit button has custom submit handlers.
    if (module_exists('language')) {
      array_unshift($actions['submit']['#submit'], 'language_configuration_element_submit');
      array_unshift($actions['submit']['#submit'], array(
        $this,
        'languageConfigurationSubmit',
      ));
    }

    // We cannot leverage the regular submit handler definition because we
    // have button-specific ones here. Hence we need to explicitly set it for
    // the submit action, otherwise it would be ignored.
    if (module_exists('translation_entity')) {
      array_unshift($actions['submit']['#submit'], 'translation_entity_language_configuration_element_submit');
    }
    return $actions;
  }
  else {
    return array();
  }
}