You are here

function menu_item_container_clean_breadcrumb in Menu item container 7

Same name and namespace in other branches
  1. 6 menu_item_container.module \menu_item_container_clean_breadcrumb()

Cleans menu item containers in the breadcrumb.

1 string reference to 'menu_item_container_clean_breadcrumb'
menu_item_container_theme_registry_alter in ./menu_item_container.module
Implements hook_theme_registry_alter().

File

./menu_item_container.module, line 100
Provides containers for menu items.

Code

function menu_item_container_clean_breadcrumb($breadcrumb) {

  // Remove the link from any containers.
  foreach ($breadcrumb as $key => $link) {
    list($module, $id, ) = explode('/', $link . '//', 3);
    if ($start = strpos($link, 'menu-item-container/')) {

      // Find the container ID to allow theme hook suggestions.
      $start += 20;
      $id = substr($link, $start, strpos($link, '"', $start) - $start);
      $hooks = array(
        'menu_item_container__' . $id,
        //'menu_item_container__' . str_replace('-', '_', $menu_name),
        'menu_item_container',
      );
      $breadcrumb[$key] = theme($hooks, array(
        'title' => strip_tags($link),
      ));
    }
  }

  // Use the original theme function before we overrode it.
  // See menu_item_container_theme_registry_alter().
  $theme_registry =& theme_get_registry();
  $function = $theme_registry['breadcrumb']['function_menu_item_container'];
  return $function($breadcrumb);
}