function book_outline_form
book_outline_form($form, &$form_state, $node)
Form constructor for the book outline form.
Allows handling of all book outline operations via the outline tab.
Parameters
$node: The book node for which to show the outline.
See also
Related topics
File
- modules/book/book.pages.inc, line 132
- User page callbacks for the book module.
Code
function book_outline_form($form, &$form_state, $node) { if (!isset($node->book)) { // The node is not part of any book yet - set default options. $node->book = _book_link_defaults($node->nid); } else { $node->book['original_bid'] = $node->book['bid']; } // Find the depth limit for the parent select. if (!isset($node->book['parent_depth_limit'])) { $node->book['parent_depth_limit'] = _book_parent_depth_limit($node->book); } $form['#node'] = $node; $form['#id'] = 'book-outline'; _book_add_form_elements($form, $form_state, $node); $form['book']['#collapsible'] = FALSE; $form['update'] = array( '#type' => 'submit', '#value' => $node->book['original_bid'] ? t('Update book outline') : t('Add to book outline'), '#weight' => 15, ); $form['remove'] = array( '#type' => 'submit', '#value' => t('Remove from book outline'), '#access' => _book_node_is_removable($node), '#weight' => 20, '#submit' => array('book_remove_button_submit'), ); return $form; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!book!book.pages.inc/function/book_outline_form/7.x