function commerce_pricelist_menu in Commerce Pricelist 7
Implements hook_menu().
File
- ./
commerce_pricelist.module, line 13 - Implements the basic functionality required for price lists
Code
function commerce_pricelist_menu() {
// This provides a place for Field API to hang its own
// interface and has to be the same as what was defined
// in entity_info() above.
$items['admin/commerce/pricelist/commerce_pricelist_list'] = array(
'title' => 'Price lists',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'commerce_pricelist_draggable_form',
),
'access arguments' => array(
'administer commerce_pricelist_list entities',
),
'file' => 'includes/commerce_pricelist.admin.inc',
);
// Add example entities.
$items['admin/commerce/pricelist/commerce_pricelist_list/add'] = array(
'title' => 'Add a Price list',
'page callback' => 'commerce_pricelist_list_add',
'access arguments' => array(
'create commerce_pricelist_list entities',
),
'type' => MENU_LOCAL_ACTION,
'file' => 'includes/commerce_pricelist.admin.inc',
);
// Add example entities.
$items['admin/commerce/products/%commerce_product/add_price'] = array(
'title' => 'Add a Price list item',
'page callback' => 'commerce_pricelist_item_add',
'page arguments' => array(
3,
),
'access arguments' => array(
'edit any commerce_pricelist_list entity',
),
'file' => 'includes/commerce_pricelist.admin.inc',
'type' => MENU_CALLBACK,
);
// The page to view our entities - needs to follow what
// is defined in basic_uri and will use load_basic to retrieve
// the necessary entity info.
$items['admin/commerce/pricelist/commerce_pricelist_list/%commerce_pricelist_list'] = array(
'title callback' => 'commerce_pricelist_list_title',
'title arguments' => array(
4,
),
'page callback' => 'commerce_pricelist_list_view',
'page arguments' => array(
4,
),
'access arguments' => array(
'view any commerce_pricelist_list entity',
),
'file' => 'includes/commerce_pricelist.admin.inc',
);
// 'View' tab for an individual entity page.
$items['admin/commerce/pricelist/commerce_pricelist_list/%commerce_pricelist_list/view'] = array(
'title' => 'View',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
'file' => 'includes/commerce_pricelist.admin.inc',
);
// 'Edit' tab for an individual entity page.
$items['admin/commerce/pricelist/commerce_pricelist_list/%commerce_pricelist_list/edit'] = array(
'title' => 'Edit',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'commerce_pricelist_list_form',
4,
),
'access arguments' => array(
'edit any commerce_pricelist_list entity',
),
'type' => MENU_LOCAL_TASK,
'file' => 'includes/commerce_pricelist.admin.inc',
);
// 'Edit' tab for an individual entity page.
$items['admin/commerce/pricelist/commerce_pricelist_item/%commerce_pricelist_item/edit'] = array(
'title' => 'Edit',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'commerce_pricelist_item_form',
4,
),
'access arguments' => array(
'edit any commerce_pricelist_list entity',
),
'file' => 'includes/commerce_pricelist.admin.inc',
);
// 'Add' tab for an individual entity page.
$items['admin/commerce/pricelist/commerce_pricelist_list/%commerce_pricelist_list/add'] = array(
'title' => 'Add price',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'commerce_pricelist_item_form',
NULL,
4,
),
'access arguments' => array(
'edit any commerce_pricelist_list entity',
),
'type' => MENU_LOCAL_TASK,
'file' => 'includes/commerce_pricelist.admin.inc',
);
return $items;
}