Commit c157c82e authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #67229 by dww: cleaned up book_load().

parent 0603a4f8
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -161,23 +161,7 @@ function book_block($op = 'list', $delta = 0) {
 * Implementation of hook_load().
 */
function book_load($node) {
  global $user;

  $book = db_fetch_object(db_query('SELECT parent, weight, log FROM {book} WHERE nid = %d', $node->nid));

  if (arg(2) == 'edit' && !user_access('administer nodes')) {
    // If a user is about to update a book page, we overload some
    // fields to reflect the changes.
    if ($user->uid) {
      $book->uid = $user->uid;
      $book->name = $user->name;
    }
    else {
      $book->uid = 0;
      $book->name = '';
    }
  }

  return $book;
}