You are here

function node_field_node_view in Node Field 7.2

Implements hook_node_view().

File

./node_field.module, line 183
This module provide ability to add extra fields to any single node.

Code

function node_field_node_view($node, $view_mode, $langcode) {
  if (user_access('add/edit/delete fields to node')) {

    // Adding node_fields to content.
    $node_fields = node_field_get_node_fields($node);
    $exclude = module_invoke_all('node_field_exclude_node_content', $node);
    if (empty($node_fields) || $exclude) {
      return;
    }
    $node->content['node_fields'] = node_field_node_content_add_node_fields($node_fields);
  }
}