You are here

function uc_ups_menu in Ubercart 5

Same name and namespace in other branches
  1. 8.4 shipping/uc_ups/uc_ups.module \uc_ups_menu()
  2. 6.2 shipping/uc_ups/uc_ups.module \uc_ups_menu()
  3. 7.3 shipping/uc_ups/uc_ups.module \uc_ups_menu()

Implementation of hook_menu().

File

shipping/uc_ups/uc_ups.module, line 18
Shipping quote module that interfaces with www.ups.com to get rates for small package shipments.

Code

function uc_ups_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/store/settings/quotes/methods/ups',
      'access' => user_access('configure quotes'),
      'title' => t('UPS'),
      'callback' => 'drupal_get_form',
      'callback arguments' => 'uc_ups_admin_settings',
      'type' => MENU_LOCAL_TASK,
    );
  }
  else {
    $items[] = array(
      'path' => 'admin/store/orders/' . arg(3) . '/shipments/ups',
      'access' => user_access('fulfill orders'),
      'title' => t('UPS shipment'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'uc_ups_confirm_shipment',
        arg(3),
      ),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/store/orders/' . arg(3) . '/shipments/labels/ups',
      'access' => user_access('fulfill orders'),
      'callback' => 'theme',
      'callback arguments' => array(
        'uc_ups_label_image',
      ),
      'type' => MENU_CALLBACK,
    );
    drupal_add_css(drupal_get_path('module', 'uc_ups') . '/uc_ups.css');
  }
  return $items;
}