function ctools_comment_links_content_type_render

Output function for the comment links.

File

plugins/content_types/comment/comment_links.inc, line 26

Code

function ctools_comment_links_content_type_render($subtype, $conf, $panel_args, $context) {
    if (!empty($context) && empty($context->data)) {
        return;
    }
    $comment = isset($context->data) ? clone $context->data : NULL;
    $block = new stdClass();
    $block->module = 'comment';
    $block->delta = $comment->cid;
    if (empty($comment)) {
        $block->delta = 'placeholder';
        $block->subject = t('Comment subject.');
        $block->content = t('Comment links go here.');
    }
    else {
        $node = node_load($comment->nid);
        $block->subject = $comment->subject;
        comment_build_content($comment, $node, $conf['build_mode']);
        $block->content = $comment->content['links'];
    }
    return $block;
}