You are here

function book_helper_node_update in Book helper 7

Implements hook_node_update().

2 calls to book_helper_node_update()
book_helper_node_insert in ./book_helper.module
Implements hook_node_insert().
_book_helper_outline_submit in ./book_helper.module

File

./book_helper.module, line 149
Improves Drupal's core book module's functionality.

Code

function book_helper_node_update($node) {

  // Update the book page's menu link title if it has been customized.
  if (isset($node->book_helper, $node->book_helper['link_title_sync']) && !empty($node->book['bid']) && !empty($node->book_helper['link_title_custom']) && !$node->book_helper['link_title_sync'] && $node->book_helper['link_title_custom'] != $node->book['link_title']) {
    db_update('menu_links')
      ->fields(array(
      'link_title' => $node->book_helper['link_title_custom'],
    ))
      ->condition('mlid', $node->book['mlid'])
      ->execute();
  }
}