You are here

function menu_crumbs_plugins in Crumbs, the Breadcrumbs suite 7.2

Same name and namespace in other branches
  1. 6.2 plugins/crumbs.menu.inc \menu_crumbs_plugins()
  2. 6 plugins/crumbs.menu.inc \menu_crumbs_plugins()
  3. 7 plugins/crumbs.menu.inc \menu_crumbs_plugins()

Implementation of hook_crumbs_plugins()

Parameters

crumbs_InjectedAPI_hookCrumbsPlugins $api:

File

plugins/crumbs.menu.inc, line 9

Code

function menu_crumbs_plugins($api) {
  $api
    ->multiPlugin('hierarchy');
  $api
    ->multiPlugin('link_title');
  $api
    ->disabledByDefault('hierarchy.*');
  $api
    ->disabledByDefault('link_title.*');
  $api
    ->routeParentCallback('admin/structure/menu/item/%/edit', 'item_edit', function ($path, array $item) {
    if (!empty($item['map'][4]['menu_name'])) {
      return 'admin/structure/menu/manage/' . $item['map'][4]['menu_name'];
    }
    return NULL;
  });
  $api
    ->routeTitleCallback('admin/structure/menu/item/%/edit', 'item_edit_title', function ($path, array $item) {
    if (!empty($item['map'][4]['mlid'])) {
      return t('Edit menu link') . ' ' . $item['map'][4]['mlid'];
    }
    return NULL;
  });
}