function template_preprocess_views_view_row_comment

Same name in other branches
  1. 7.x-3.x modules/comment.views.inc \template_preprocess_views_view_row_comment()

Template helper for theme_views_view_row_comment

Related topics

File

modules/comment.views.inc, line 642

Code

function template_preprocess_views_view_row_comment(&$vars) {
    $options = $vars['options'];
    $view =& $vars['view'];
    $plugin =& $view->style_plugin->row_plugin;
    $comment = $plugin->comments[$vars['row']->{$vars['field_alias']}];
    $node = node_load($comment->nid);
    // Put the view on the node so we can retrieve it in the preprocess.
    $node->view =& $view;
    $links = array();
    if (!empty($options['links'])) {
        $links = module_invoke_all('link', 'comment', $comment, 0);
        drupal_alter('link', $links, $node);
    }
    $vars['comment'] = theme('comment_view', $comment, $node, $links);
}