You are here

function book_admin_edit_submit in Drupal 5

Same name and namespace in other branches
  1. 4 modules/book.module \book_admin_edit_submit()
  2. 6 modules/book/book.admin.inc \book_admin_edit_submit()
  3. 7 modules/book/book.admin.inc \book_admin_edit_submit()

File

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

Code

function book_admin_edit_submit($form_id, $form_values) {
  foreach ($form_values['table'] as $row) {
    $node = node_load($row['nid']);
    if ($row['title'] != $node->title || $row['weight'] != $node->weight) {
      $node->title = $row['title'];
      $node->weight = $row['weight'];
      node_save($node);
      watchdog('content', t('%type: updated %title.', array(
        '%type' => t('book'),
        '%title' => $node->title,
      )), WATCHDOG_NOTICE, l(t('view'), 'node/' . $node->nid));
    }
  }
  if (is_numeric(arg(3))) {

    // Updating pages in a single book.
    $book = node_load(arg(3));
    drupal_set_message(t('Updated book %title.', array(
      '%title' => $book->title,
    )));
  }
  else {

    // Updating the orphan pages.
    drupal_set_message(t('Updated orphan book pages.'));
  }
}