node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE)
drupal/modules/node/node.module, line 685
Generate a display of the given node.
$node A node array or node object.
$teaser Whether to display the teaser only, as on the main page.
$page Whether the node is being displayed by itself as a page.
$links Whether or not to display node links. Links are omitted for node previews.
An HTML representation of the themed node.
function node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE) {
$node = (object)$node;
$node = node_build_content($node, $teaser, $page);
if ($links) {
$node->links = module_invoke_all('link', 'node', $node, $teaser);
foreach (module_implements('link_alter') AS $module) {
$function = $module .'_link_alter';
$function($node, $node->links);
}
}
// Set the proper node part, then unset unused $node part so that a bad
// theme can not open a security hole.
$content = drupal_render($node->content);
if ($teaser) {
$node->teaser = $content;
unset($node->body);
}
else {
$node->body = $content;
unset($node->teaser);
}
// Allow modules to modify the fully-built node.
node_invoke_nodeapi($node, 'alter', $teaser, $page);
return theme('node', $node, $teaser, $page);
}