function panels_admin_node_content in Panels 6.2
Same name and namespace in other branches
- 5.2 content_types/node_content.inc \panels_admin_node_content()
1 call to panels_admin_node_content()
- panels_content_node_content in content_types/
node_content.inc - Output function for the 'node' content type. Outputs a node based on the module and delta supplied in the configuration.
File
- content_types/
node_content.inc, line 83
Code
function panels_admin_node_content($node, $conf) {
// The build mode identifies the target for which the node is built.
if (!isset($node->build_mode)) {
$node->build_mode = NODE_BUILD_NORMAL;
}
// Remove the delimiter (if any) that separates the teaser from the body.
$node->body = str_replace('<!--break-->', '', $node->body);
// The 'view' hook can be implemented to overwrite the default function
// to display nodes.
if (node_hook($node, 'view')) {
$node = node_invoke($node, 'view', $conf['teaser'], $conf['page']);
}
else {
$node = node_prepare($node, $conf['teaser']);
}
if (empty($conf['no_extras'])) {
// Allow modules to make their own additions to the node.
node_invoke_nodeapi($node, 'view', $conf['teaser'], $conf['page']);
}
if ($conf['links']) {
$node->links = module_invoke_all('link', 'node', $node, $conf['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 ($conf['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', $conf['teaser'], $conf['page']);
return theme('node', $node, $conf['teaser'], $conf['page']);
}