You are here

function book_menus_node_presave in Book Menus 7

Implements hook_node_presave().

Set the original parent for the book before book.module overwrites it.

File

./book_menus.module, line 311
Functionality for book_menus.module.

Code

function book_menus_node_presave($node) {

  // Check if this is a book menu node with a menu entry.
  if (!empty($node->book['plid']) && $node->book['plid'] > 0 && !empty($node->book['bid']) && $node->book['bid'] > 0 && !empty($node->book['menu_name']) && in_array($node->book['menu_name'], variable_get('book_menus', array()))) {

    // Save the original plid.
    $node->original_plid = $node->book['plid'];
  }
}