function panels_content_node_comments in Panels 5.2
Same name and namespace in other branches
- 6.2 content_types/node_comments.inc \panels_content_node_comments()
Output function for the 'node comments' content type. Outputs the comments that have been made on a given nid, as provided by the $context.
1 string reference to 'panels_content_node_comments'
- panels_node_comments_panels_content_types in content_types/
node_comments.inc - Plugin declaration function - returns a plugin definition array that describes the content type.
File
- content_types/
node_comments.inc, line 27
Code
function panels_content_node_comments($conf, $panel_args, $context) {
$node = isset($context->data) ? drupal_clone($context->data) : NULL;
$block = new stdClass();
$block->module = 'comments';
$block->delta = $node->nid;
$block->subject = t('Comments');
if (empty($node)) {
$block->content = t('Node comments go here.');
}
else {
$block->content = panels_comment_render($node, $conf);
// Update the history table, stating that this user viewed this node.
node_tag_new($node->nid);
}
return $block;
}