You are here

function uc_weightquote_menu in Ubercart 5

Same name and namespace in other branches
  1. 6.2 shipping/uc_weightquote/uc_weightquote.module \uc_weightquote_menu()
  2. 7.3 shipping/uc_weightquote/uc_weightquote.module \uc_weightquote_menu()

Implementation of hook_menu().

File

shipping/uc_weightquote/uc_weightquote.module, line 17
Shipping quote module that defines a shipping rate for each product based on weight.

Code

function uc_weightquote_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/store/settings/quotes/methods/weightquote',
      'access' => user_access('configure quotes'),
      'title' => t('Weight quote'),
      'callback' => 'uc_weightquote_admin_methods',
      'type' => MENU_LOCAL_TASK,
    );
  }
  else {
    $items[] = array(
      'path' => 'admin/store/settings/quotes/methods/weightquote/' . arg(6),
      'access' => user_access('configure quotes'),
      'title' => t('Edit weight quote method'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'uc_weightquote_admin_method_edit_form',
        arg(6),
      ),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/store/settings/quotes/methods/weightquote/' . arg(6) . '/delete',
      'access' => user_access('configure quotes'),
      'title' => t('Delete weight quote method'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'uc_weightquote_admin_method_confirm_delete',
        arg(6),
      ),
      'type' => MENU_CALLBACK,
    );
  }
  return $items;
}