function book_title_override_node_load

cis7 book_title_override.module book_title_override_node_load($nodes, $types)
cle7 book_title_override.module book_title_override_node_load($nodes, $types)
elmsmedia7 book_title_override.module book_title_override_node_load($nodes, $types)
icor7 book_title_override.module book_title_override_node_load($nodes, $types)
meedjum_blog7 book_title_override.module book_title_override_node_load($nodes, $types)
mooc7 book_title_override.module book_title_override_node_load($nodes, $types)

Implements hook_node_load().

File

sites/all/modules/elmsln_contrib/book_title_override/book_title_override.module, line 33

Code

function book_title_override_node_load($nodes, $types) {
  $result = db_query("SELECT * FROM {book} b INNER JOIN {menu_links} ml ON b.mlid = ml.mlid WHERE b.nid IN (:nids)", array(':nids' => array_keys($nodes)), array('fetch' => PDO::FETCH_ASSOC));
  foreach ($result as $record) {
    if ($nodes[$record['nid']]->title != $record['link_title']) {
      $nodes[$record['nid']]->book_title_override_title = $record['link_title'];
      $nodes[$record['nid']]->book_title_override_override = TRUE;
    }
  }
}