function book_outline_form

7.x 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.


$node: The book node for which to show the outline.

See also



Related topics

1 string reference to 'book_outline_form'
book_outline in drupal/modules/book/
Menu callback: Shows the outline form for a single node.


drupal/modules/book/, line 132
User page callbacks for the book module.


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;