function _menu_link_parents_set in Drupal 6
Same name and namespace in other branches
- 7 includes/menu.inc \_menu_link_parents_set()
Helper function that sets the p1..p9 values for a menu link being saved.
Related topics
1 call to _menu_link_parents_set()
- menu_link_save in includes/
menu.inc - Save a menu link.
File
- includes/
menu.inc, line 2257 - API for the Drupal menu system.
Code
function _menu_link_parents_set(&$item, $parent) {
$i = 1;
while ($i < $item['depth']) {
$p = 'p' . $i++;
$item[$p] = $parent[$p];
}
$p = 'p' . $i++;
// The parent (p1 - p9) corresponding to the depth always equals the mlid.
$item[$p] = $item['mlid'];
while ($i <= MENU_MAX_DEPTH) {
$p = 'p' . $i++;
$item[$p] = 0;
}
}