You are here

function book_outline in Drupal 4

Same name and namespace in other branches
  1. 5 modules/book/book.module \book_outline()
  2. 6 modules/book/book.pages.inc \book_outline()
  3. 7 modules/book/book.pages.inc \book_outline()

Implementation of function book_outline() Handles all book outline operations.

1 string reference to 'book_outline'
book_menu in modules/book.module
Implementation of hook_menu().

File

modules/book.module, line 278
Allows users to collaboratively author a book.

Code

function book_outline($nid) {
  $node = node_load($nid);
  $page = book_load($node);
  $form['parent'] = array(
    '#type' => 'select',
    '#title' => t('Parent'),
    '#default_value' => $page->parent,
    '#options' => book_toc($node->nid),
    '#description' => t('The parent page in the book.'),
  );
  $form['weight'] = array(
    '#type' => 'weight',
    '#title' => t('Weight'),
    '#default_value' => $page->weight,
    '#delta' => 15,
    '#description' => t('Pages at a given level are ordered first by weight and then by title.'),
  );
  $form['log'] = array(
    '#type' => 'textarea',
    '#title' => t('Log message'),
    '#description' => t('An explanation to help other authors understand your motivations to put this post into the book.'),
  );
  $form['nid'] = array(
    '#type' => 'value',
    '#value' => $nid,
  );
  if ($page->nid) {
    $form['update'] = array(
      '#type' => 'submit',
      '#value' => t('Update book outline'),
    );
    $form['remove'] = array(
      '#type' => 'submit',
      '#value' => t('Remove from book outline'),
    );
  }
  else {
    $form['add'] = array(
      '#type' => 'submit',
      '#value' => t('Add to book outline'),
    );
  }
  drupal_set_title(check_plain($node->title));
  return drupal_get_form('book_outline', $form);
}