_menu_link_parents_set

Versions
6 – 7
_menu_link_parents_set(&$item, $parent)

Helper function that sets the p1..p9 values for a menu link being saved.

Related topics

Code

includes/menu.inc, line 2238

<?php
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;
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.