You are here

function views_handler_field_nodehierarchy_parent in Node Hierarchy 5

Display the parent.

1 string reference to 'views_handler_field_nodehierarchy_parent'
nodehierarchy_views_tables in nodehierarchy_views/nodehierarchy_views.module
Implementation of hook_views_tables().

File

nodehierarchy_views/nodehierarchy_views.module, line 429
Views.module integration for nodehierarchy.module.

Code

function views_handler_field_nodehierarchy_parent($fieldinfo, $fielddata, $value, $data) {
  static $titles = array();
  if (!isset($titles[$value])) {
    $title = db_result(db_query("SELECT title FROM {node} WHERE nid=%d", $value));
    $titles[$value] = $title ? $title : '';
  }
  switch ($fielddata['options']) {
    case 'plain':
      return check_plain($titles[$value]);
    default:
      return l($titles[$value], 'node/' . $value);
  }
}