function views_handler_field_nodehierarchy_parent::init in Node Hierarchy 6
Override init function to provide generic option to link to comment.
File
- includes/
views/ views_handler_field_nodehierarchy_parent.inc, line 12  
Class
- views_handler_field_nodehierarchy_parent
 - Field handler to allow linking to a comment
 
Code
function init(&$view, &$data) {
  parent::init($view, $data);
  if (isset($data['link_to_parent']) && $view->base_table != 'node') {
    // @todo: This can't be right, it'll totally fail with relationships.
    $this->additional_fields[] = 'nid';
    $this->nid_field = 'node_nid';
  }
  else {
    $this->nid_field = 'parent';
  }
}