You are here

protected function ViewEditForm::actions in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views_ui/src/ViewEditForm.php \Drupal\views_ui\ViewEditForm::actions()
  2. 9 core/modules/views_ui/src/ViewEditForm.php \Drupal\views_ui\ViewEditForm::actions()

File

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

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;
}