You are here

function book_admin_edit_submit in Drupal 4

Same name and namespace in other branches
  1. 5 modules/book/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.module, line 949
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' => theme('placeholder', t('book')),
        '%title' => theme('placeholder', $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' => theme('placeholder', $book->title),
    )));
  }
  else {

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