function _hs_menu_children in Hierarchical Select 6.3
Same name and namespace in other branches
- 7.3 modules/hs_menu.module \_hs_menu_children()
Recursive helper function for hs_menu_hierarchical_select_children().
1 call to _hs_menu_children()
- hs_menu_hierarchical_select_children in modules/
hs_menu.module - Implementation of hook_hierarchical_select_children().
File
- modules/
hs_menu.module, line 184 - Implementation of the Hierarchical Select API for the Menu module.
Code
function _hs_menu_children($tree, $menu_name, $plid = 0, $exclude = FALSE) {
$children = array();
foreach ($tree as $data) {
if ($data['link']['plid'] == $plid && $data['link']['hidden'] >= 0) {
if ($exclude && $data['link']['menu_name'] === $exclude[0] && $data['link']['mlid'] == $exclude[1]) {
continue;
}
$title = truncate_utf8($data['link']['title'], 30, TRUE, FALSE);
if ($data['link']['hidden']) {
$title .= ' (' . t('disabled') . ')';
}
$children[$menu_name . ':' . $data['link']['mlid']] = $title;
if ($data['below']) {
$children += _hs_menu_children($data['below'], $menu_name, $plid, $exclude);
}
}
elseif ($data['below']) {
$children += _hs_menu_children($data['below'], $menu_name, $plid, $exclude);
}
}
return $children;
}