You are here

public function BookNavigationBlock::blockForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/book/src/Plugin/Block/BookNavigationBlock.php \Drupal\book\Plugin\Block\BookNavigationBlock::blockForm()
  2. 9 core/modules/book/src/Plugin/Block/BookNavigationBlock.php \Drupal\book\Plugin\Block\BookNavigationBlock::blockForm()

File

core/modules/book/src/Plugin/Block/BookNavigationBlock.php, line 97

Class

BookNavigationBlock
Provides a 'Book navigation' block.

Namespace

Drupal\book\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {
  $options = [
    'all pages' => $this
      ->t('Show block on all pages'),
    'book pages' => $this
      ->t('Show block only on book pages'),
  ];
  $form['book_block_mode'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Book navigation block display'),
    '#options' => $options,
    '#default_value' => $this->configuration['block_mode'],
    '#description' => $this
      ->t("If <em>Show block on all pages</em> is selected, the block will contain the automatically generated menus for all of the site's books. If <em>Show block only on book pages</em> is selected, the block will contain only the one menu corresponding to the current page's book. In this case, if the current page is not in a book, no block will be displayed. The <em>Page specific visibility settings</em> or other visibility settings can be used in addition to selectively display this block."),
  ];
  return $form;
}