function ViewEditForm::actions

Same name in other branches
  1. 8.9.x core/modules/views_ui/src/ViewEditForm.php \Drupal\views_ui\ViewEditForm::actions()
  2. 10 core/modules/views_ui/src/ViewEditForm.php \Drupal\views_ui\ViewEditForm::actions()
  3. 11.x core/modules/views_ui/src/ViewEditForm.php \Drupal\views_ui\ViewEditForm::actions()

Overrides EntityForm::actions

File

core/modules/views_ui/src/ViewEditForm.php, line 230

Class

ViewEditForm
Form controller for the Views edit form.

Namespace

Drupal\views_ui

Code

protected function actions(array $form, FormStateInterface $form_state) {
    $actions = parent::actions($form, $form_state);
    unset($actions['delete']);
    $actions['cancel'] = [
        '#type' => 'submit',
        '#value' => $this->t('Cancel'),
        '#submit' => [
            '::cancel',
        ],
        '#limit_validation_errors' => [],
    ];
    if ($this->entity
        ->isLocked()) {
        $actions['submit']['#access'] = FALSE;
        $actions['cancel']['#access'] = FALSE;
    }
    return $actions;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.