1. 8.2.x core/modules/book/book.module
  2. 8.0.x core/modules/book/book.module
  3. 8.1.x core/modules/book/book.module
  4. 8.3.x core/modules/book/book.module
  5. 4.6.x modules/book.module
  6. 4.7.x modules/book.module
  7. 5.x modules/book/book.module
  8. 6.x modules/book/book.module
  9. 7.x modules/book/book.module

Allows users to create and organize related content in an outline.

File

core/modules/book/book.module
View source
  1. <?php
  2. /**
  3. * @file
  4. * Allows users to create and organize related content in an outline.
  5. */
  6. use Drupal\book\BookManager;
  7. use Drupal\Core\Entity\EntityInterface;
  8. use Drupal\Core\Form\FormStateInterface;
  9. use Drupal\Core\Render\Element;
  10. use Drupal\Core\Routing\RouteMatchInterface;
  11. use Drupal\Core\Url;
  12. use Drupal\node\NodeInterface;
  13. use Drupal\node\NodeTypeInterface;
  14. use Drupal\node\Entity\Node;
  15. use Drupal\Core\Language\LanguageInterface;
  16. use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
  17. use Drupal\Core\Template\Attribute;
  18. /**
  19. * Implements hook_help().
  20. */
  21. function book_help($route_name, RouteMatchInterface $route_match) {
  22. switch ($route_name) {
  23. case 'help.page.book':
  24. $output = '<h3>' . t('About') . '</h3>';
  25. $output .= '<p>' . t('The Book module is used for creating structured, multi-page content, such as site resource guides, manuals, and wikis. It allows you to create content that has chapters, sections, subsections, or any similarly-tiered structure. Enabling the module creates a new content type <em>Book page</em>. For more information, see the <a href=":book">online documentation for the Book module</a>.', array(':book' => 'https://www.drupal.org/documentation/modules/book')) . '</p>';
  26. $output .= '<h3>' . t('Uses') . '</h3>';
  27. $output .= '<dl>';
  28. $output .= '<dt>' . t('Adding and managing book content') . '</dt>';
  29. $output .= '<dd>' . t('Books have a hierarchical structure, called a <em>book outline</em>. Each book outline can have nested pages up to nine levels deep. Multiple content types can be configured to behave as a book outline. From the content edit form, it is possible to add a page to a book outline or create a new book.') . '</dd>';
  30. $output .= '<dd>' . t('You can assign separate permissions for <em>creating new books</em> as well as <em>creating</em>, <em>editing</em> and <em>deleting</em> book content. Users with the <em>Administer book outlines</em> permission can add <em>any</em> type of content to a book by selecting the appropriate book outline while editing the content. They can also view a list of all books, and edit and rearrange section titles on the <a href=":admin-book">Book list page</a>.', array(':admin-book' => \Drupal::url('book.admin'))) . '</dd>';
  31. $output .= '<dt>' . t('Configuring content types for books') . '</dt>';
  32. $output .= '<dd>' . t('The <em>Book page</em> content type is the initial content type enabled for book outlines. On the <a href=":admin-settings">Book settings page</a> you can configure content types that can used in book outlines.', array(':admin-settings' => \Drupal::url('book.settings'))) . '</dd>';
  33. $output .= '<dd>' . t('Users with the <em>Add content and child pages to books</em> permission will see a link to <em>Add child page</em> when viewing a content item that is part of a book outline. This link will allow users to create a new content item of the content type you select on the <a href=":admin-settings">Book settings page</a>. By default this is the <em>Book page</em> content type.', array(':admin-settings' => \Drupal::url('book.settings'))) . '</dd>';
  34. $output .= '<dt>' . t('Book navigation') . '</dt>';
  35. $output .= '<dd>' . t("Book pages have a default book-specific navigation block. This navigation block contains links that lead to the previous and next pages in the book, and to the level above the current page in the book's structure. This block can be enabled on the <a href=':admin-block'>Blocks layout page</a>. For book pages to show up in the book navigation, they must be added to a book outline.", array(':admin-block' => (\Drupal::moduleHandler()->moduleExists('block')) ? \Drupal::url('block.admin_display') : '#')) . '</dd>';
  36. $output .= '<dt>' . t('Collaboration') . '</dt>';
  37. $output .= '<dd>' . t('Books can be created collaboratively, as they allow users with appropriate permissions to add pages into existing books, and add those pages to a custom table of contents.') . '</dd>';
  38. $output .= '<dt>' . t('Printing books') . '</dt>';
  39. $output .= '<dd>' . t("Users with the <em>View printer-friendly books</em> permission can select the <em>printer-friendly version</em> link visible at the bottom of a book page's content to generate a printer-friendly display of the page and all of its subsections.") . '</dd>';
  40. $output .= '</dl>';
  41. return $output;
  42. case 'book.admin':
  43. return '<p>' . t('The book module offers a means to organize a collection of related content pages, collectively known as a book. When viewed, this content automatically displays links to adjacent book pages, providing a simple navigation system for creating and reviewing structured content.') . '</p>';
  44. case 'entity.node.book_outline_form':
  45. return '<p>' . t('The outline feature allows you to include pages in the <a href=":book">Book hierarchy</a>, as well as move them within the hierarchy or to <a href=":book-admin">reorder an entire book</a>.', array(':book' => \Drupal::url('book.render'), ':book-admin' => \Drupal::url('book.admin'))) . '</p>';
  46. }
  47. }
  48. /**
  49. * Implements hook_theme().
  50. */
  51. function book_theme() {
  52. return array(
  53. 'book_navigation' => array(
  54. 'variables' => array('book_link' => NULL),
  55. ),
  56. 'book_tree' => array(
  57. 'variables' => array('items' => array(), 'attributes' => array()),
  58. ),
  59. 'book_export_html' => array(
  60. 'variables' => array('title' => NULL, 'contents' => NULL, 'depth' => NULL),
  61. ),
  62. 'book_all_books_block' => array(
  63. 'render element' => 'book_menus',
  64. ),
  65. 'book_node_export_html' => array(
  66. 'variables' => array('node' => NULL, 'content' => NULL, 'children' => NULL),
  67. ),
  68. );
  69. }
  70. /**
  71. * Implements hook_entity_type_build().
  72. */
  73. function book_entity_type_build(array &$entity_types) {
  74. /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
  75. $entity_types['node']
  76. ->setFormClass('book_outline', 'Drupal\book\Form\BookOutlineForm')
  77. ->setLinkTemplate('book-outline-form', '/node/{node}/outline')
  78. ->setLinkTemplate('book-remove-form', '/node/{node}/outline/remove');
  79. }
  80. /**
  81. * Implements hook_node_links_alter().
  82. */
  83. function book_node_links_alter(array &$links, NodeInterface $node, array &$context) {
  84. if ($context['view_mode'] != 'rss') {
  85. $account = \Drupal::currentUser();
  86. if (isset($node->book['depth'])) {
  87. if ($context['view_mode'] == 'full' && node_is_page($node)) {
  88. $child_type = \Drupal::config('book.settings')->get('child_type');
  89. $access_control_handler = \Drupal::entityManager()->getAccessControlHandler('node');
  90. if (($account->hasPermission('add content to books') || $account->hasPermission('administer book outlines')) && $access_control_handler->createAccess($child_type) && $node->isPublished() && $node->book['depth'] < BookManager::BOOK_MAX_DEPTH) {
  91. $book_links['book_add_child'] = array(
  92. 'title' => t('Add child page'),
  93. 'url' => Url::fromRoute('node.add', ['node_type' => $child_type], ['query' => ['parent' => $node->id()]]),
  94. );
  95. }
  96. if ($account->hasPermission('access printer-friendly version')) {
  97. $book_links['book_printer'] = array(
  98. 'title' => t('Printer-friendly version'),
  99. 'url' => Url::fromRoute('book.export', [
  100. 'type' => 'html',
  101. 'node' => $node->id(),
  102. ]),
  103. 'attributes' => array('title' => t('Show a printer-friendly version of this book page and its sub-pages.'))
  104. );
  105. }
  106. }
  107. }
  108. if (!empty($book_links)) {
  109. $links['book'] = array(
  110. '#theme' => 'links__node__book',
  111. '#links' => $book_links,
  112. '#attributes' => array('class' => array('links', 'inline')),
  113. );
  114. }
  115. }
  116. }
  117. /**
  118. * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm.
  119. *
  120. * Adds the book form element to the node form.
  121. *
  122. * @see book_pick_book_nojs_submit()
  123. */
  124. function book_form_node_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  125. $node = $form_state->getFormObject()->getEntity();
  126. $account = \Drupal::currentUser();
  127. $access = $account->hasPermission('administer book outlines');
  128. if (!$access) {
  129. if ($account->hasPermission('add content to books') && ((!empty($node->book['bid']) && !$node->isNew()) || book_type_is_allowed($node->getType()))) {
  130. // Already in the book hierarchy, or this node type is allowed.
  131. $access = TRUE;
  132. }
  133. }
  134. if ($access) {
  135. $collapsed = !($node->isNew() && !empty($node->book['pid']));
  136. $form = \Drupal::service('book.manager')->addFormElements($form, $form_state, $node, $account, $collapsed);
  137. // The "js-hide" class hides submit button when Javascript is enabled.
  138. $form['book']['pick-book'] = array(
  139. '#type' => 'submit',
  140. '#value' => t('Change book (update list of parents)'),
  141. '#submit' => array('book_pick_book_nojs_submit'),
  142. '#weight' => 20,
  143. '#attributes' => array(
  144. 'class' => array(
  145. 'js-hide',
  146. ),
  147. ),
  148. );
  149. $form['#entity_builders'][] = 'book_node_builder';
  150. }
  151. }
  152. /**
  153. * Entity form builder to add the book information to the node.
  154. *
  155. * @todo: Remove this in favor of an entity field.
  156. */
  157. function book_node_builder($entity_type, NodeInterface $entity, &$form, FormStateInterface $form_state) {
  158. $entity->book = $form_state->getValue('book');
  159. // Always save a revision for non-administrators.
  160. if (!empty($entity->book['bid']) && !\Drupal::currentUser()->hasPermission('administer nodes')) {
  161. $entity->setNewRevision();
  162. }
  163. }
  164. /**
  165. * Form submission handler for node_form().
  166. *
  167. * This handler is run when JavaScript is disabled. It triggers the form to
  168. * rebuild so that the "Parent item" options are changed to reflect the newly
  169. * selected book. When JavaScript is enabled, the submit button that triggers
  170. * this handler is hidden, and the "Book" dropdown directly triggers the
  171. * book_form_update() Ajax callback instead.
  172. *
  173. * @see book_form_update()
  174. * @see book_form_node_form_alter()
  175. */
  176. function book_pick_book_nojs_submit($form, FormStateInterface $form_state) {
  177. $node = $form_state->getFormObject()->getEntity();
  178. $node->book = $form_state->getValue('book');
  179. $form_state->setRebuild();
  180. }
  181. /**
  182. * Renders a new parent page select element when the book selection changes.
  183. *
  184. * This function is called via Ajax when the selected book is changed on a node
  185. * or book outline form.
  186. *
  187. * @return
  188. * The rendered parent page select element.
  189. */
  190. function book_form_update($form, FormStateInterface $form_state) {
  191. return $form['book']['pid'];
  192. }
  193. /**
  194. * Implements hook_ENTITY_TYPE_load() for node entities.
  195. */
  196. function book_node_load($nodes) {
  197. /** @var \Drupal\book\BookManagerInterface $book_manager */
  198. $book_manager = \Drupal::service('book.manager');
  199. $links = $book_manager->loadBookLinks(array_keys($nodes), FALSE);
  200. foreach ($links as $record) {
  201. $nodes[$record['nid']]->book = $record;
  202. $nodes[$record['nid']]->book['link_path'] = 'node/' . $record['nid'];
  203. $nodes[$record['nid']]->book['link_title'] = $nodes[$record['nid']]->label();
  204. }
  205. }
  206. /**
  207. * Implements hook_ENTITY_TYPE_view() for node entities.
  208. */
  209. function book_node_view(array &$build, EntityInterface $node, EntityViewDisplayInterface $display, $view_mode) {
  210. if ($view_mode == 'full') {
  211. if (!empty($node->book['bid']) && empty($node->in_preview)) {
  212. $book_node = Node::load($node->book['bid']);
  213. if (!$book_node->access()) {
  214. return;
  215. }
  216. $build['book_navigation'] = array(
  217. '#theme' => 'book_navigation',
  218. '#book_link' => $node->book,
  219. '#weight' => 100,
  220. // The book navigation is a listing of Node entities, so associate its
  221. // list cache tag for correct invalidation.
  222. '#cache' => [
  223. 'tags' => $node->getEntityType()->getListCacheTags(),
  224. ],
  225. );
  226. }
  227. }
  228. }
  229. /**
  230. * Implements hook_ENTITY_TYPE_presave() for node entities.
  231. */
  232. function book_node_presave(EntityInterface $node) {
  233. // Make sure a new node gets a new menu link.
  234. if ($node->isNew()) {
  235. $node->book['nid'] = NULL;
  236. }
  237. }
  238. /**
  239. * Implements hook_ENTITY_TYPE_insert() for node entities.
  240. */
  241. function book_node_insert(EntityInterface $node) {
  242. /** @var \Drupal\book\BookManagerInterface $book_manager */
  243. $book_manager = \Drupal::service('book.manager');
  244. $book_manager->updateOutline($node);
  245. }
  246. /**
  247. * Implements hook_ENTITY_TYPE_update() for node entities.
  248. */
  249. function book_node_update(EntityInterface $node) {
  250. /** @var \Drupal\book\BookManagerInterface $book_manager */
  251. $book_manager = \Drupal::service('book.manager');
  252. $book_manager->updateOutline($node);
  253. }
  254. /**
  255. * Implements hook_ENTITY_TYPE_predelete() for node entities.
  256. */
  257. function book_node_predelete(EntityInterface $node) {
  258. if (!empty($node->book['bid'])) {
  259. /** @var \Drupal\book\BookManagerInterface $book_manager */
  260. $book_manager = \Drupal::service('book.manager');
  261. $book_manager->deleteFromBook($node->book['nid']);
  262. }
  263. }
  264. /**
  265. * Implements hook_ENTITY_TYPE_prepare_form() for node entities.
  266. */
  267. function book_node_prepare_form(NodeInterface $node, $operation, FormStateInterface $form_state) {
  268. /** @var \Drupal\book\BookManagerInterface $book_manager */
  269. $book_manager = \Drupal::service('book.manager');
  270. // Prepare defaults for the add/edit form.
  271. $account = \Drupal::currentUser();
  272. if (empty($node->book) && ($account->hasPermission('add content to books') || $account->hasPermission('administer book outlines'))) {
  273. $node->book = array();
  274. $query = \Drupal::request()->query;
  275. if ($node->isNew() && !is_null($query->get('parent')) && is_numeric($query->get('parent'))) {
  276. // Handle "Add child page" links:
  277. $parent = $book_manager->loadBookLink($query->get('parent'), TRUE);
  278. if ($parent && $parent['access']) {
  279. $node->book['bid'] = $parent['bid'];
  280. $node->book['pid'] = $parent['nid'];
  281. }
  282. }
  283. // Set defaults.
  284. $node_ref = !$node->isNew() ? $node->id() : 'new';
  285. $node->book += $book_manager->getLinkDefaults($node_ref);
  286. }
  287. else {
  288. if (isset($node->book['bid']) && !isset($node->book['original_bid'])) {
  289. $node->book['original_bid'] = $node->book['bid'];
  290. }
  291. }
  292. // Find the depth limit for the parent select.
  293. if (isset($node->book['bid']) && !isset($node->book['parent_depth_limit'])) {
  294. $node->book['parent_depth_limit'] = $book_manager->getParentDepthLimit($node->book);
  295. }
  296. }
  297. /**
  298. * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\Form\NodeDeleteForm.
  299. *
  300. * Alters the confirm form for a single node deletion.
  301. */
  302. function book_form_node_confirm_form_alter(&$form, FormStateInterface $form_state) {
  303. // Only need to alter the delete operation form.
  304. if ($form_state->getFormObject()->getOperation() !== 'delete') {
  305. return;
  306. }
  307. /** @var \Drupal\node\NodeInterface $node */
  308. $node = $form_state->getFormObject()->getEntity();
  309. if (!book_type_is_allowed($node->getType())) {
  310. // Not a book node.
  311. return;
  312. }
  313. if (isset($node->book) && $node->book['has_children']) {
  314. $form['book_warning'] = array(
  315. '#markup' => '<p>' . t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.', array('%title' => $node->label())) . '</p>',
  316. '#weight' => -10,
  317. );
  318. }
  319. }
  320. /**
  321. * Prepares variables for book listing block templates.
  322. *
  323. * Default template: book-all-books-block.html.twig.
  324. *
  325. * All non-renderable elements are removed so that the template has full access
  326. * to the structured data but can also simply iterate over all elements and
  327. * render them (as in the default template).
  328. *
  329. * @param array $variables
  330. * An associative array containing the following key:
  331. * - book_menus: An associative array containing renderable menu links for all
  332. * book menus.
  333. */
  334. function template_preprocess_book_all_books_block(&$variables) {
  335. // Remove all non-renderable elements.
  336. $elements = $variables['book_menus'];
  337. $variables['book_menus'] = array();
  338. foreach (Element::children($elements) as $index) {
  339. $variables['book_menus'][] = array(
  340. 'id' => $index,
  341. 'menu' => $elements[$index],
  342. 'title' => $elements[$index]['#book_title'],
  343. );
  344. }
  345. }
  346. /**
  347. * Prepares variables for book navigation templates.
  348. *
  349. * Default template: book-navigation.html.twig.
  350. *
  351. * @param array $variables
  352. * An associative array containing the following key:
  353. * - book_link: An associative array of book link properties.
  354. * Properties used: bid, link_title, depth, pid, nid.
  355. */
  356. function template_preprocess_book_navigation(&$variables) {
  357. $book_link = $variables['book_link'];
  358. // Provide extra variables for themers. Not needed by default.
  359. $variables['book_id'] = $book_link['bid'];
  360. $variables['book_title'] = $book_link['link_title'];
  361. $variables['book_url'] = \Drupal::url('entity.node.canonical', array('node' => $book_link['bid']));
  362. $variables['current_depth'] = $book_link['depth'];
  363. $variables['tree'] = '';
  364. /** @var \Drupal\book\BookOutline $book_outline */
  365. $book_outline = \Drupal::service('book.outline');
  366. if ($book_link['nid']) {
  367. $variables['tree'] = $book_outline->childrenLinks($book_link);
  368. $build = array();
  369. if ($prev = $book_outline->prevLink($book_link)) {
  370. $prev_href = \Drupal::url('entity.node.canonical', array('node' => $prev['nid']));
  371. $build['#attached']['html_head_link'][][] = array(
  372. 'rel' => 'prev',
  373. 'href' => $prev_href,
  374. );
  375. $variables['prev_url'] = $prev_href;
  376. $variables['prev_title'] = $prev['title'];
  377. }
  378. /** @var \Drupal\book\BookManagerInterface $book_manager */
  379. $book_manager = \Drupal::service('book.manager');
  380. if ($book_link['pid'] && $parent = $book_manager->loadBookLink($book_link['pid'])) {
  381. $parent_href = \Drupal::url('entity.node.canonical', array('node' => $book_link['pid']));
  382. $build['#attached']['html_head_link'][][] = array(
  383. 'rel' => 'up',
  384. 'href' => $parent_href,
  385. );
  386. $variables['parent_url'] = $parent_href;
  387. $variables['parent_title'] = $parent['title'];
  388. }
  389. if ($next = $book_outline->nextLink($book_link)) {
  390. $next_href = \Drupal::url('entity.node.canonical', array('node' => $next['nid']));
  391. $build['#attached']['html_head_link'][][] = array(
  392. 'rel' => 'next',
  393. 'href' => $next_href,
  394. );
  395. $variables['next_url'] = $next_href;
  396. $variables['next_title'] = $next['title'];
  397. }
  398. }
  399. if (!empty($build)) {
  400. drupal_render($build);
  401. }
  402. $variables['has_links'] = FALSE;
  403. // Link variables to filter for values and set state of the flag variable.
  404. $links = array('prev_url', 'prev_title', 'parent_url', 'parent_title', 'next_url', 'next_title');
  405. foreach ($links as $link) {
  406. if (isset($variables[$link])) {
  407. // Flag when there is a value.
  408. $variables['has_links'] = TRUE;
  409. }
  410. else {
  411. // Set empty to prevent notices.
  412. $variables[$link] = '';
  413. }
  414. }
  415. }
  416. /**
  417. * Prepares variables for book export templates.
  418. *
  419. * Default template: book-export-html.html.twig.
  420. *
  421. * @param array $variables
  422. * An associative array containing:
  423. * - title: The title of the book.
  424. * - contents: Output of each book page.
  425. * - depth: The max depth of the book.
  426. */
  427. function template_preprocess_book_export_html(&$variables) {
  428. global $base_url;
  429. $language_interface = \Drupal::languageManager()->getCurrentLanguage();
  430. $variables['base_url'] = $base_url;
  431. $variables['language'] = $language_interface;
  432. $variables['language_rtl'] = ($language_interface->getDirection() == LanguageInterface::DIRECTION_RTL);
  433. // HTML element attributes.
  434. $attributes = array();
  435. $attributes['lang'] = $language_interface->getId();
  436. $attributes['dir'] = $language_interface->getDirection();
  437. $variables['html_attributes'] = new Attribute($attributes);
  438. }
  439. /**
  440. * Prepares variables for single node export templates.
  441. *
  442. * Default template: book-node-export-html.html.twig.
  443. *
  444. * @param array $variables
  445. * An associative array containing the following keys:
  446. * - node: The node that will be output.
  447. * - children: All the rendered child nodes within the current node. Defaults
  448. * to an empty string.
  449. */
  450. function template_preprocess_book_node_export_html(&$variables) {
  451. $variables['depth'] = $variables['node']->book['depth'];
  452. $variables['title'] = $variables['node']->label();
  453. }
  454. /**
  455. * Determines if a given node type is in the list of types allowed for books.
  456. *
  457. * @param string $type
  458. * A node type.
  459. *
  460. * @return bool
  461. * A Boolean TRUE if the node type can be included in books; otherwise, FALSE.
  462. */
  463. function book_type_is_allowed($type) {
  464. return in_array($type, \Drupal::config('book.settings')->get('allowed_types'));
  465. }
  466. /**
  467. * Implements hook_ENTITY_TYPE_update() for node_type entities.
  468. *
  469. * Updates book.settings configuration object if the machine-readable name of a
  470. * node type is changed.
  471. */
  472. function book_node_type_update(NodeTypeInterface $type) {
  473. if ($type->getOriginalId() != $type->id()) {
  474. $config = \Drupal::configFactory()->getEditable('book.settings');
  475. // Update the list of node types that are allowed to be added to books.
  476. $allowed_types = $config->get('allowed_types');
  477. $old_key = array_search($type->getOriginalId(), $allowed_types);
  478. if ($old_key !== FALSE) {
  479. $allowed_types[$old_key] = $type->id();
  480. // Ensure that the allowed_types array is sorted consistently.
  481. // @see BookSettingsForm::submitForm()
  482. sort($allowed_types);
  483. $config->set('allowed_types', $allowed_types);
  484. }
  485. // Update the setting for the "Add child page" link.
  486. if ($config->get('child_type') == $type->getOriginalId()) {
  487. $config->set('child_type', $type->id());
  488. }
  489. $config->save();
  490. }
  491. }

Functions

Namesort descending Description
book_entity_type_build Implements hook_entity_type_build().
book_form_node_confirm_form_alter Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\Form\NodeDeleteForm.
book_form_node_form_alter Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm.
book_form_update Renders a new parent page select element when the book selection changes.
book_help Implements hook_help().
book_node_builder Entity form builder to add the book information to the node.
book_node_insert Implements hook_ENTITY_TYPE_insert() for node entities.
book_node_links_alter Implements hook_node_links_alter().
book_node_load Implements hook_ENTITY_TYPE_load() for node entities.
book_node_predelete Implements hook_ENTITY_TYPE_predelete() for node entities.
book_node_prepare_form Implements hook_ENTITY_TYPE_prepare_form() for node entities.
book_node_presave Implements hook_ENTITY_TYPE_presave() for node entities.
book_node_type_update Implements hook_ENTITY_TYPE_update() for node_type entities.
book_node_update Implements hook_ENTITY_TYPE_update() for node entities.
book_node_view Implements hook_ENTITY_TYPE_view() for node entities.
book_pick_book_nojs_submit Form submission handler for node_form().
book_theme Implements hook_theme().
book_type_is_allowed Determines if a given node type is in the list of types allowed for books.
template_preprocess_book_all_books_block Prepares variables for book listing block templates.
template_preprocess_book_export_html Prepares variables for book export templates.
template_preprocess_book_navigation Prepares variables for book navigation templates.
template_preprocess_book_node_export_html Prepares variables for single node export templates.