function _nodehierarchy_get_parent_selector_value in Node Hierarchy 6.2
Same name and namespace in other branches
- 6.3 nodehierarchy.module \_nodehierarchy_get_parent_selector_value()
- 7.2 nodehierarchy.module \_nodehierarchy_get_parent_selector_value()
Get the parent selector key from a menu_link array. Returns either nid:mlid or nid
1 call to _nodehierarchy_get_parent_selector_value()
- _nodehierarchy_get_parent_selector in ./
nodehierarchy.module - Get the parent selector pulldown.
File
- ./
nodehierarchy.module, line 1648 - A module to make nodes hierarchical.
Code
function _nodehierarchy_get_parent_selector_value($parent) {
$out = 0;
// If the parent value is a node ID, laod the menu_link for that node.
if (is_numeric($parent)) {
$out = trim($parent . ':' . _nodehierarchy_get_node_mlid($parent), ':');
}
elseif (is_numeric($parent['mlid'])) {
$out = $parent['nid'] . ':' . $parent['mlid'];
}
elseif (!empty($parent['nid'])) {
$out = $parent['nid'];
}
return $out;
}