File
- modules/
book.module, line 709 - Allows users to collaboratively author a book.
Code
function book_admin_save($nid, $edit = array()) {
if ($nid) {
$book = node_load(array(
'nid' => $nid,
));
foreach ($edit as $nid => $value) {
// Check to see whether the title needs updating:
$title = db_result(db_query('SELECT title FROM {node} WHERE nid = %d', $nid));
if ($title != $value['title']) {
db_query("UPDATE {node} SET title = '%s' WHERE nid = %d", $value['title'], $nid);
}
// Check to see whether the weight needs updating:
$weight = db_result(db_query('SELECT weight FROM {book} WHERE nid = %d', $nid));
if ($weight != $value['weight']) {
db_query('UPDATE {book} SET weight = %d WHERE nid = %d', $value['weight'], $nid);
}
}
$message = t('Updated book %title.', array(
'%title' => theme('placeholder', $book->title),
));
watchdog('content', $message);
return $message;
}
}