You are here

function commerce_product_ui_menu_alter in Commerce Core 7

Implements hook_menu_alter().

File

modules/product/commerce_product_ui.module, line 170

Code

function commerce_product_ui_menu_alter(&$items) {

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

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