You are here

function nodehierarchy_parent_selector_to_nid in Node Hierarchy 7.2

Same name and namespace in other branches
  1. 6.3 nodehierarchy.module \nodehierarchy_parent_selector_to_nid()
  2. 6.2 nodehierarchy.module \nodehierarchy_parent_selector_to_nid()

An element validator for the parent pulldown selector that retuns a nid for saving.

1 string reference to 'nodehierarchy_parent_selector_to_nid'
_nodehierarchy_get_parent_selector in ./nodehierarchy.module
Get the parent selector pulldown.

File

./nodehierarchy.module, line 1588
A module to make nodes hierarchical.

Code

function nodehierarchy_parent_selector_to_nid($element, &$form_state) {
  $value = $element['#value'];
  if ($value) {
    $nid = $element['#items'][$value]['nid'];
    form_set_value($element, $nid, $form_state);
  }
}