You are here

protected function AddMediaFormBase::buildActions in Media Directories 8

Same name and namespace in other branches
  1. 2.x modules/media_directories_ui/src/Form/AddMediaFormBase.php \Drupal\media_directories_ui\Form\AddMediaFormBase::buildActions()

Returns an array of supported actions for the form.

Parameters

array $form: The complete form.

\Drupal\Core\Form\FormStateInterface $form_state: The current form state.

Return value

array An actions element containing the actions of the form.

1 call to AddMediaFormBase::buildActions()
AddMediaFormBase::buildForm in modules/media_directories_ui/src/Form/AddMediaFormBase.php
Form constructor.
1 method overrides AddMediaFormBase::buildActions()
MediaEditForm::buildActions in modules/media_directories_ui/src/Form/MediaEditForm.php
Returns an array of supported actions for the form.

File

modules/media_directories_ui/src/Form/AddMediaFormBase.php, line 641

Class

AddMediaFormBase
Class AddMediaFormBase.

Namespace

Drupal\media_directories_ui\Form

Code

protected function buildActions(array $form, FormStateInterface $form_state) {
  return [
    '#type' => 'actions',
    'save_select' => [
      '#type' => 'submit',
      '#button_type' => 'primary',
      '#value' => $this
        ->t('Save and select'),
      '#ajax' => [
        'callback' => '::updateLibrary',
        'wrapper' => 'media-library-add-form-wrapper',
      ],
    ],
  ];
}