You are here

function commerce_line_item_ui_menu_alter in Commerce Core 7

Implements hook_menu_alter().

File

modules/line_item/commerce_line_item_ui.module, line 56
Provides the user interface for managing Line Item types.

Code

function commerce_line_item_ui_menu_alter(&$items) {

  // Transform the field UI tabs into contextual links.
  foreach (commerce_line_item_types() as $type => $line_item_type) {

    // Convert underscores to hyphens for the menu item argument.
    $type_arg = strtr($type, '_', '-');
    $items['admin/commerce/config/line-items/' . $type_arg . '/fields']['context'] = MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE;
    $items['admin/commerce/config/line-items/' . $type_arg . '/display']['context'] = MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE;
  }
}