function commerce_payment_ui_menu in Commerce Core 7
Implements hook_menu().
File
- modules/
payment/ commerce_payment_ui.module, line 11 - Default Payment UI for Drupal Commerce.
Code
function commerce_payment_ui_menu() {
$items = array();
// Payment tab on orders.
$items['admin/commerce/orders/%commerce_order/payment'] = array(
'title' => 'Payment',
'page callback' => 'commerce_payment_ui_order_tab',
'page arguments' => array(
3,
),
'access callback' => 'commerce_payment_transaction_order_access',
'access arguments' => array(
'view',
3,
),
'type' => MENU_LOCAL_TASK,
'weight' => 10,
'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
'file' => 'includes/commerce_payment_ui.admin.inc',
);
// Payment transaction operations links.
$items['admin/commerce/orders/%commerce_order/payment/%commerce_payment_transaction'] = array(
'title callback' => 'commerce_payment_ui_payment_transaction_title',
'title arguments' => array(
5,
),
'page callback' => 'commerce_payment_ui_payment_transaction_view',
'page arguments' => array(
3,
5,
'administrator',
),
'access callback' => 'commerce_payment_transaction_access',
'access arguments' => array(
'view',
5,
),
'file' => 'includes/commerce_payment_ui.admin.inc',
);
$items['admin/commerce/orders/%commerce_order/payment/%commerce_payment_transaction/view'] = array(
'title' => 'View',
'type' => MENU_DEFAULT_LOCAL_TASK,
'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
'weight' => 0,
);
$items['admin/commerce/orders/%commerce_order/payment/%commerce_payment_transaction/delete'] = array(
'title' => 'Delete',
'page callback' => 'commerce_payment_ui_payment_transaction_delete_form_wrapper',
'page arguments' => array(
3,
5,
),
'access callback' => 'commerce_payment_transaction_access',
'access arguments' => array(
'delete',
5,
),
'type' => MENU_LOCAL_TASK,
'context' => MENU_CONTEXT_INLINE,
'weight' => 10,
'file' => 'includes/commerce_payment_ui.admin.inc',
);
// Payment method Rules administration page.
$items['admin/commerce/config/payment-methods'] = array(
'title' => 'Payment methods',
'description' => 'Enable and configure payment method rule configurations.',
'page callback' => 'commerce_payment_ui_admin_page',
'access arguments' => array(
'administer payment methods',
),
'file' => 'includes/commerce_payment_ui.admin.inc',
);
// Add the menu items for the various Rules forms.
$controller = new RulesUIController();
$items += $controller
->config_menu('admin/commerce/config/payment-methods');
$items['admin/commerce/config/payment-methods/add'] = array(
'title' => 'Add a payment method rule',
'description' => 'Adds an additional payment method rule configuration.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'commerce_payment_ui_add_payment_rule_form',
'admin/commerce/config/payment-methods',
),
'access arguments' => array(
'administer payment methods',
),
'file path' => drupal_get_path('module', 'rules_admin'),
'file' => 'rules_admin.inc',
);
return $items;
}