You are here

function library_node_view in Library 7

Implements hook_node_view().

Display library items when a node is viewed

File

./library.module, line 747

Code

function library_node_view($node, $build_mode = 'full') {
  if (variable_get('library_' . $node->type, LIBRARY_ITEM_NOT_IN_LIBRARY) == LIBRARY_ITEM_IN_LIBRARY) {
    $items = $node->library_items;
    if (!empty($items)) {
      $node->content['library_items'] = array(
        '#markup' => theme('library_items', array(
          'items' => $items,
        )),
        '#weight' => -4,
      );
    }
  }
}