function commerce_customer_ui_menu in Commerce Core 7
Implements hook_menu().
File
- modules/
customer/ commerce_customer_ui.module, line 10
Code
function commerce_customer_ui_menu() {
$items = array();
// Note: admin/commerce/customer-profiles is defined by a default View.
// Add a customer profile.
$items['admin/commerce/customer-profiles/add'] = array(
'title' => 'Add a customer profile',
'description' => 'Add a new customer profile.',
'page callback' => 'commerce_customer_ui_customer_profile_add_page',
'access callback' => 'commerce_customer_ui_customer_profile_add_any_access',
'weight' => 10,
'file' => 'includes/commerce_customer_ui.profiles.inc',
);
foreach (commerce_customer_profile_types() as $type => $profile_type) {
$items['admin/commerce/customer-profiles/add/' . strtr($type, array(
'_' => '-',
))] = array(
'title' => 'Create @name',
'title arguments' => array(
'@name' => $profile_type['name'],
),
'description' => $profile_type['description'],
'page callback' => 'commerce_customer_ui_customer_profile_form_wrapper',
'page arguments' => array(
commerce_customer_profile_new($type),
),
'access callback' => 'commerce_customer_profile_access',
'access arguments' => array(
'create',
commerce_customer_profile_new($type),
),
'file' => 'includes/commerce_customer_ui.profiles.inc',
);
}
$items['admin/commerce/customer-profiles/%commerce_customer_profile'] = array(
'title callback' => 'commerce_customer_ui_customer_profile_title',
'title arguments' => array(
3,
),
'page callback' => 'commerce_customer_ui_customer_profile_form_wrapper',
'page arguments' => array(
3,
),
'access callback' => 'commerce_customer_profile_access',
'access arguments' => array(
'update',
3,
),
'weight' => 0,
'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
'file' => 'includes/commerce_customer_ui.profiles.inc',
);
$items['admin/commerce/customer-profiles/%commerce_customer_profile/edit'] = array(
'title' => 'Edit',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
);
$items['admin/commerce/customer-profiles/%commerce_customer_profile/delete'] = array(
'title' => 'Delete a customer profile',
'page callback' => 'commerce_customer_ui_customer_profile_delete_form_wrapper',
'page arguments' => array(
3,
),
'access callback' => 'commerce_customer_profile_access',
'access arguments' => array(
'delete',
3,
),
'type' => MENU_LOCAL_TASK,
'weight' => 10,
'context' => MENU_CONTEXT_INLINE,
'file' => 'includes/commerce_customer_ui.profiles.inc',
);
$items['admin/commerce/customer-profiles/types'] = array(
'title' => 'Profile types',
'description' => 'Manage customer profile types for your store.',
'page callback' => 'commerce_customer_ui_customer_profile_types_overview',
'access arguments' => array(
'administer customer profile types',
),
'type' => MENU_LOCAL_TASK,
'weight' => 0,
'file' => 'includes/commerce_customer_ui.profile_types.inc',
);
foreach (commerce_customer_profile_types() as $type => $profile_type) {
// Convert underscores to hyphens for the menu item argument.
$type_arg = strtr($type, '_', '-');
$items['admin/commerce/customer-profiles/types/' . $type_arg] = array(
'title' => $profile_type['name'],
'page callback' => 'commerce_customer_ui_profile_type_redirect',
'page arguments' => array(
$type,
),
'access arguments' => array(
'administer customer profile types',
),
);
}
return $items;
}