book_admin_edit_submit

Definition

book_admin_edit_submit($form_id, $form_values)
modules/book/book.module, line 928

Code

<?php
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.'));
  }
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.