function template_preprocess_views_view_row_comment in Views (for Drupal 7) 6.2
Same name and namespace in other branches
- 6.3 modules/comment.views.inc \template_preprocess_views_view_row_comment()
- 7.3 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 544 - Provide views data and handlers for comment.module
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']->cid];
$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);
}