book_admin_edit_submit

5 book.module book_admin_edit_submit($form_id, $form_values)
6 book.admin.inc book_admin_edit_submit($form, &$form_state)
7 book.admin.inc book_admin_edit_submit($form, &$form_state)
8 book.admin.inc book_admin_edit_submit($form, &$form_state)

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.'));
  }
}
Login or register to post comments