You are here

protected function menu_CrumbsMultiPlugin_hierarchy::specialMenuItemFindParent in Crumbs, the Breadcrumbs suite 7.2

Finds the parent path for an artificial router item representing a special menu item with '<nolink>' path.

Parameters

array $item:

Return value

string[] Parent path candidates (can't be more than one).

1 call to menu_CrumbsMultiPlugin_hierarchy::specialMenuItemFindParent()
menu_CrumbsMultiPlugin_hierarchy::findParent in plugins/crumbs.menu.inc
Find candidates for the parent path.

File

plugins/crumbs.menu.inc, line 114

Class

menu_CrumbsMultiPlugin_hierarchy

Code

protected function specialMenuItemFindParent(array $item) {
  if (empty($item['map'][2]['menu_name']) || empty($item['map'][2]['plid'])) {
    return array();
  }
  $menu_name = $item['map'][2]['menu_name'];
  $parent_link = menu_link_load($item['map'][2]['plid']);
  if (empty($parent_link['link_path'])) {
    return array();
  }
  $parent_path = $parent_link['link_path'];
  if ('<separator>' === $parent_path) {
    return array();
  }
  if ('<nolink>' === $parent_path) {
    $parent_path = 'crumbs/special-menu-item/' . $parent_link['mlid'];
  }
  return array(
    $menu_name => $parent_path,
  );
}