BookManager::getLinkDefaults

public BookManager::getLinkDefaults($nid) Returns an array with default values for a book page's menu link. Parameters string|int $nid: The ID of the node whose menu link is being created. Return value array The default values for the menu link. Overrides BookManagerInterface::getLinkDefaults File core/modules/book/src/BookManager.php, line 119 Class BookManager Defines a book manager. Namespace Drupal\book Code public function getLinkDefaults($nid) { return array( 'original_bi

BookManager::getBookParents

public BookManager::getBookParents(array $item, array $parent = array()) Overrides BookManagerInterface::getBookParents File core/modules/book/src/BookManager.php, line 284 Class BookManager Defines a book manager. Namespace Drupal\book Code public function getBookParents(array $item, array $parent = array()) { $book = array(); if ($item['pid'] == 0) { $book['p1'] = $item['nid']; for ($i = 2; $i <= static::BOOK_MAX_DEPTH; $i++) { $parent_property = "p$i"; $bo

BookManager::getAllBooks

public BookManager::getAllBooks() Returns an array of all books. This list may be used for generating a list of all the books, or for building the options for a form select. Return value array An array of all books. Overrides BookManagerInterface::getAllBooks File core/modules/book/src/BookManager.php, line 84 Class BookManager Defines a book manager. Namespace Drupal\book Code public function getAllBooks() { if (!isset($this->books)) { $this->loadBooks(); } return $th

BookManager::getActiveTrailIds

public BookManager::getActiveTrailIds($bid, $link) Gets the active trail IDs for the specified book at the provided path. Parameters string $bid: The Book ID to find links for. array $link: A fully loaded menu link. Return value array An array containing the active trail: a list of mlids. Overrides BookManagerInterface::getActiveTrailIds File core/modules/book/src/BookManager.php, line 486 Class BookManager Defines a book manager. Namespace Drupal\book Code public function getActiveT

BookManager::flatBookTree

protected BookManager::flatBookTree(array $tree, array &$flat) Recursively converts a tree of menu links to a flat array. Parameters array $tree: A tree of menu links in an array. array $flat: A flat array of the menu links from $tree, passed by reference. See also static::bookTreeGetFlat() File core/modules/book/src/BookManager.php, line 725 Class BookManager Defines a book manager. Namespace Drupal\book Code protected function flatBookTree(array $tree, array &$flat) { for

BookManager::findChildrenRelativeDepth

protected BookManager::findChildrenRelativeDepth(array $book_link) Determine the relative depth of the children of a given book link. Parameters array $book_link: The book link. Return value int The difference between the max depth in the book tree and the depth of the passed book link. File core/modules/book/src/BookManager.php, line 148 Class BookManager Defines a book manager. Namespace Drupal\book Code protected function findChildrenRelativeDepth(array $book_link) { $max_depth

BookManager::doBookTreeCheckAccess

protected BookManager::doBookTreeCheckAccess(&$tree) Sorts the menu tree and recursively checks access for each item. Parameters array $tree: The book tree to operate on. File core/modules/book/src/BookManager.php, line 956 Class BookManager Defines a book manager. Namespace Drupal\book Code protected function doBookTreeCheckAccess(&$tree) { $new_tree = array(); foreach ($tree as $key => $v) { $item = &$tree[$key]['link']; $this->bookLinkTranslate($item);

BookManager::doBookTreeBuild

protected BookManager::doBookTreeBuild($bid, array $parameters = array()) Builds a book tree. This function may be used build the data for a menu tree only, for example to further massage the data manually before further processing happens. _menu_tree_check_access() needs to be invoked afterwards. Parameters int $bid: The book ID to find links for. array $parameters: (optional) An associative array of build parameters. Possible keys: expanded: An array of parent link IDs to return only book l

BookManager::deleteFromBook

public BookManager::deleteFromBook($nid) Deletes node's entry from book table. Parameters int $nid: The nid to delete. Overrides BookManagerInterface::deleteFromBook File core/modules/book/src/BookManager.php, line 431 Class BookManager Defines a book manager. Namespace Drupal\book Code public function deleteFromBook($nid) { $original = $this->loadBookLink($nid, FALSE); $this->bookOutlineStorage->delete($nid); if ($nid == $original['bid']) { // Handle deletion of a

BookManager::checkNodeIsRemovable

public BookManager::checkNodeIsRemovable(NodeInterface $node) Determines if a node can be removed from the book. A node can be removed from a book if it is actually in a book and it either is not a top-level page or is a top-level page with no children. Parameters \Drupal\node\NodeInterface $node: The node to remove from the outline. Return value bool TRUE if a node can be removed from the book, FALSE otherwise. Overrides BookManagerInterface::checkNodeIsRemovable File core/modules/book/src/B