function nodehierarchy_widgets_nodehierarchy_get_parent_selector in Node Hierarchy 7.4
Same name and namespace in other branches
- 6.3 nodehierarchy_widgets/nodehierarchy_widgets.module \nodehierarchy_widgets_nodehierarchy_get_parent_selector()
- 6.2 nodehierarchy_widgets/nodehierarchy_widgets.module \nodehierarchy_widgets_nodehierarchy_get_parent_selector()
- 7.2 nodehierarchy_widgets/nodehierarchy_widgets.module \nodehierarchy_widgets_nodehierarchy_get_parent_selector()
Implements hook_nodehierarchy_get_parent_selector().
File
- nodehierarchy_widgets/
nodehierarchy_widgets.module, line 27 - Alternative parent selector widgets for Node Hierarchy.
Code
function nodehierarchy_widgets_nodehierarchy_get_parent_selector($child_type, $pnid, $exclude = NULL) {
if (variable_get('nodehierarchy_widgets_parent_selector', 'autocomplete') == 'autocomplete') {
drupal_add_css(drupal_get_path('module', 'nodehierarchy_widgets') . '/nodehierarchy_widgets.css');
$out = array(
'#type' => 'textfield',
'#autocomplete_path' => 'nodehierarchy/autocomplete/parent/' . $child_type . '/' . (int) $exclude,
'#child_type' => $child_type,
'#exclude' => $exclude,
'#description' => 'Enter the title of the parent node.',
'#element_validate' => array(
'_nodehierarchy_widgets_autocomplete_parent_validate',
),
'#default_value' => _nodehierarchy_widgets_autocomplete_parent_value($pnid),
'#attributes' => array(
'class' => array(
'nodehierarchy-parent-autocomplete',
),
),
);
return array(
$out,
);
}
}