protected function ViewPreviewFormController::actions

Overrides Drupal\Core\Entity\EntityFormController::actions().

Overrides EntityFormController::actions

File

drupal/core/modules/views/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php, line 72
Contains Drupal\views_ui\ViewPreviewFormController.

Class

ViewPreviewFormController
Form controller for the Views preview form.

Namespace

Drupal\views_ui

Code

protected function actions(array $form, array &$form_state) {
  $view = $this
    ->getEntity($form_state);
  return array(
    '#attributes' => array(
      'id' => 'preview-submit-wrapper',
    ),
    'button' => array(
      '#type' => 'submit',
      '#value' => t('Update preview'),
      '#attributes' => array(
        'class' => array(
          'arguments-preview',
        ),
      ),
      '#submit' => array(
        array(
          $this,
          'submitPreview',
        ),
      ),
      '#id' => 'preview-submit',
      '#ajax' => array(
        'path' => 'admin/structure/views/view/' . $view
          ->get('name') . '/preview/' . $view->displayID . '/ajax',
        'wrapper' => 'views-preview-wrapper',
        'event' => 'click',
        'progress' => array(
          'type' => 'throbber',
        ),
        'method' => 'replace',
      ),
    ),
  );
}