You are here

function uc_addresses_menu in Ubercart Addresses 6.2

Same name and namespace in other branches
  1. 5.2 uc_addresses.module \uc_addresses_menu()
  2. 5 uc_addresses.module \uc_addresses_menu()
  3. 6 uc_addresses.module \uc_addresses_menu()
  4. 7 uc_addresses.module \uc_addresses_menu()

Implementation of hook_menu().

Return value

array A list of menu items.

File

./uc_addresses.module, line 150
Adds user profile address support to Ubercart.

Code

function uc_addresses_menu() {
  $items = array();

  // Address book pages.
  $items['user/%user_uid_optional/addresses'] = array(
    'title' => 'Address book',
    'description' => 'Manage your addresses',
    'page callback' => 'uc_addresses_address_book',
    'page arguments' => array(
      1,
      NULL,
    ),
    'access callback' => 'UcAddressesPermissions::canViewAddress',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'uc_addresses.pages.inc',
  );
  $items['user/%user_uid_optional/addresses/list'] = array(
    'title' => 'Address list',
    'description' => 'Manage your addresses',
    'access callback' => 'UcAddressesPermissions::canViewAddress',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 0,
  );
  $items['user/%user_uid_optional/addresses/add'] = array(
    'title' => 'Add address',
    'description' => 'Add a new address.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_addresses_get_address_form',
      1,
      NULL,
    ),
    'access callback' => 'UcAddressesPermissions::canEditAddress',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 3,
    'file' => 'uc_addresses.pages.inc',
  );
  $items['user/%user_uid_optional/addresses/%uc_addresses_address'] = array(
    'title' => 'View address',
    'description' => 'View one saved address',
    'load arguments' => array(
      1,
    ),
    'page callback' => 'uc_addresses_list_one_address',
    'page arguments' => array(
      1,
      3,
    ),
    'access callback' => 'UcAddressesPermissions::canViewAddress',
    'access arguments' => array(
      1,
      3,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'uc_addresses.pages.inc',
  );
  $items['user/%user_uid_optional/addresses/%uc_addresses_address/edit'] = array(
    'title' => 'Edit address',
    'load arguments' => array(
      1,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_addresses_get_address_form',
      1,
      3,
    ),
    'access callback' => 'UcAddressesPermissions::canEditAddress',
    'access arguments' => array(
      1,
      3,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'uc_addresses.pages.inc',
  );
  $items['user/%user_uid_optional/addresses/%uc_addresses_address/delete'] = array(
    'title' => 'Delete address',
    'load arguments' => array(
      1,
    ),
    'page callback' => 'uc_addresses_delete_address_confirm',
    'page arguments' => array(
      1,
      3,
    ),
    'access callback' => 'UcAddressesPermissions::canDeleteAddress',
    'access arguments' => array(
      1,
      3,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'uc_addresses.pages.inc',
  );

  // Admin pages.
  $items['admin/store/settings/addresses'] = array(
    'title' => 'Address settings',
    'description' => 'Configure the address settings.',
    'page callback' => 'uc_addresses_settings_overview',
    'access arguments' => array(
      'administer store',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'uc_addresses.admin.inc',
  );
  $items['admin/store/settings/addresses/overview'] = array(
    'title' => 'Overview',
    'access arguments' => array(
      'administer store',
    ),
    'description' => 'View the address settings.',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/store/settings/addresses/edit'] = array(
    'title' => 'Edit',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_addresses_settings_form',
    ),
    'access arguments' => array(
      'administer store',
    ),
    'description' => 'Edit the address settings.',
    'type' => MENU_LOCAL_TASK,
    'weight' => -5,
    'file' => 'uc_addresses.admin.inc',
  );
  $items['admin/store/settings/countries/edit/uc_addresses_formats'] = array(
    'title' => 'Ubercart Addresses country formats',
    'description' => 'Edit the country specific format settings for Ubercart Addresses.',
    'page callback' => 'uc_addresses_country_formats_page',
    'access arguments' => array(
      'administer store',
    ),
    'weight' => -4,
    'type' => MENU_LOCAL_TASK,
    'file' => 'uc_addresses.admin.inc',
    '_visible' => TRUE,
  );
  return $items;
}