function views_handler_arg_nodehierarchy_parent in Node Hierarchy 5
Handle the parent argument.
1 string reference to 'views_handler_arg_nodehierarchy_parent'
- nodehierarchy_views_arguments in nodehierarchy_views/
nodehierarchy_views.module - Implementation of hook_views_arguments().
File
- nodehierarchy_views/
nodehierarchy_views.module, line 277 - Views.module integration for nodehierarchy.module.
Code
function views_handler_arg_nodehierarchy_parent($op, &$query, $argtype, $arg = '') {
switch ($op) {
case 'summary':
$query
->add_field('nid');
$query
->add_field("title");
$fieldinfo['field'] = 'nodehierarchy.parent';
return $fieldinfo;
case 'sort':
$query
->add_orderby('nodehierarchy', 'order_by', $argtype);
break;
case 'filter':
$query
->ensure_table("nodehierarchy");
$query
->add_where("nodehierarchy.parent = %d", $arg);
break;
case 'link':
return l($query->title, "{$arg}/{$query->nid}");
case 'title':
$node = db_fetch_object(db_query("SELECT title FROM {node} WHERE nid=%d", $query));
return $node->title;
}
}