function nodehierarchy_views_nodehierarchy_node_form in Node Hierarchy 7.2
Same name and namespace in other branches
- 6.3 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_nodehierarchy_node_form()
- 6.2 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_nodehierarchy_node_form()
- 7.4 nodehierarchy_views/nodehierarchy_views.module \nodehierarchy_views_nodehierarchy_node_form()
@todo Please document this function.
See also
File
- nodehierarchy_views/
nodehierarchy_views.module, line 114 - Embed a view of children onto a node.
Code
function nodehierarchy_views_nodehierarchy_node_form($node) {
$form = array();
$default_value = NULL;
if (!empty($node->nh_children_view)) {
$display = !empty($node->nh_children_view_display) ? $node->nh_children_view_display : 'default';
$default_value = $node->nh_children_view . ':' . $display;
}
if ($node && nodehierarchy_node_can_be_parent($node)) {
$form['nh_children_view'] = array(
'#type' => user_access('edit embedded child view') ? 'select' : 'value',
'#title' => t('Embed Children View'),
'#multiple' => FALSE,
'#options' => _nodehierarchy_views_view_options(),
'#required' => FALSE,
'#default_value' => $default_value,
'#description' => t("Embed a view containing this node's children into the node's page view"),
);
}
return $form;
}