public function CommerceDiscountUIController::hook_menu in Commerce Discount 7
Overridden EntityDefaultUIController::hook_menu().
Call our own page callback to show the "commerce_discount_overview" view, as this view has exposed filters which will not work inside Entity API's default form.
Overrides EntityDefaultUIController::hook_menu
File
- includes/
commerce_discount.admin.inc, line 54 - Commerce discount editing UI.
Class
- CommerceDiscountUIController
- Class CommerceDiscountUIController.
Code
public function hook_menu() {
$items = parent::hook_menu();
$items[$this->path] = array(
'title' => 'Discounts',
'description' => 'Manage discounts.',
'page callback' => 'commerce_discount_overview_form',
'access callback' => 'entity_access',
'access arguments' => array(
'view',
$this->entityType,
),
'file' => 'includes/commerce_discount.admin.inc',
'file path' => drupal_get_path('module', 'commerce_discount'),
);
$items[$this->path . '/list'] = array(
'title' => 'List',
'type' => MENU_DEFAULT_LOCAL_TASK,
);
$items[$this->path . '/add']['title callback'] = 't';
$items[$this->path . '/import']['title callback'] = 't';
$items[$this->path . '/add']['title'] = 'Add discount';
$items[$this->path . '/import']['title'] = 'Import discount';
$items[$this->path . '/settings'] = array(
'title' => 'Settings',
'description' => 'Additional settings for Commerce Discounts.',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'commerce_discount_settings',
),
'access arguments' => array(
'administer commerce discounts',
),
'type' => MENU_LOCAL_TASK,
'file' => 'includes/commerce_discount.admin.inc',
'file path' => drupal_get_path('module', 'commerce_discount'),
);
if (module_exists('rules_admin')) {
$items[$this->path . '/rules'] = array(
'title' => 'Discount rules',
'description' => 'Manage discount rules',
'page callback' => 'drupal_goto',
'page arguments' => array(
'admin/config/workflow/rules',
array(
'query' => array(
'event' => 0,
'tag' => 'Commerce Discount',
),
),
),
'access arguments' => array(
'administer commerce discounts',
),
'type' => MENU_LOCAL_TASK,
'weight' => 10,
);
}
return $items;
}