You are here

function commerce_order_types_menu in Commerce Order Types 7

Implements hook_menu().

File

./commerce_order_types.module, line 12
Provides a UI for creating and managing custom order types.

Code

function commerce_order_types_menu() {
  $items = array();
  if (module_exists('commerce_order_ui')) {
    foreach (commerce_order_types_order_types() as $type => $info) {
      $items['admin/commerce/orders/add/' . $type] = array(
        'title' => 'Add order @type',
        'title arguments' => array(
          '@type' => $info->name,
        ),
        'description' => $info->help,
        'page callback' => 'commerce_order_ui_order_form_wrapper',
        'page arguments' => array(
          commerce_order_new(0, NULL, $type),
        ),
        //type
        'access callback' => 'commerce_order_access',
        'access arguments' => array(
          'create',
        ),
        'type' => MENU_NORMAL_ITEM,
        'file' => 'includes/commerce_order_ui.orders.inc',
        'file path' => drupal_get_path('module', 'commerce_order_ui'),
      );
    }
  }
  return $items;
}