function BookOutlineForm::actions

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

Overrides EntityForm::actions

File

core/modules/book/src/Form/BookOutlineForm.php, line 97

Class

BookOutlineForm
Displays the book outline form.

Namespace

Drupal\book\Form

Code

protected function actions(array $form, FormStateInterface $form_state) {
    $actions = parent::actions($form, $form_state);
    $actions['submit']['#value'] = $this->entity->book['original_bid'] ? $this->t('Update book outline') : $this->t('Add to book outline');
    $actions['delete']['#title'] = $this->t('Remove from book outline');
    $actions['delete']['#url'] = new Url('entity.node.book_remove_form', [
        'node' => $this->entity->book['nid'],
    ]);
    $actions['delete']['#access'] = $this->bookManager
        ->checkNodeIsRemovable($this->entity);
    return $actions;
}

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