You are here

function uc_coupon_menu in Ubercart Discount Coupons 6

Same name and namespace in other branches
  1. 5 uc_coupon.module \uc_coupon_menu()
  2. 7.3 uc_coupon.module \uc_coupon_menu()
  3. 7.2 uc_coupon.module \uc_coupon_menu()

Implementation of hook_menu().

File

./uc_coupon.module, line 18
Provides discount coupons for Ubercart.

Code

function uc_coupon_menu() {
  $items = array();
  $items['admin/store/coupons'] = array(
    'title' => 'Coupons',
    'description' => 'Manage store discount coupons.',
    'page callback' => 'uc_coupon_display',
    'page arguments' => array(
      'active',
    ),
    'access arguments' => array(
      'view store coupons',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'uc_coupon.admin.inc',
  );
  $items['admin/store/coupons/list'] = array(
    'title' => 'Active coupons',
    'description' => 'View active coupons.',
    'page callback' => 'uc_coupon_display',
    'page arguments' => array(
      'active',
    ),
    'access arguments' => array(
      'view store coupons',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'uc_coupon.admin.inc',
    'weight' => 0,
  );
  $items['admin/store/coupons/inactive'] = array(
    'title' => 'Inactive coupons',
    'description' => 'View inactive coupons.',
    'page callback' => 'uc_coupon_display',
    'page arguments' => array(
      'inactive',
    ),
    'access arguments' => array(
      'view store coupons',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'uc_coupon.admin.inc',
    'weight' => 1,
  );
  $items['admin/store/coupons/add'] = array(
    'title' => 'Add new coupon',
    'description' => 'Add a new coupon.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_coupon_add_form',
    ),
    'access arguments' => array(
      'manage store coupons',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'uc_coupon.admin.inc',
    'weight' => 2,
  );
  $items['admin/store/coupons/%uc_coupon'] = array(
    'title callback' => 'uc_coupon_title',
    'title arguments' => array(
      3,
    ),
    'description' => 'View coupon details.',
    'page callback' => 'uc_coupon_view',
    'page arguments' => array(
      3,
    ),
    'access arguments' => array(
      'view store coupons',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'uc_coupon.admin.inc',
    'weight' => 3,
  );
  $items['admin/store/coupons/%uc_coupon/view'] = array(
    'title' => 'View',
    'description' => 'View coupon details.',
    'access arguments' => array(
      'view store coupons',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'file' => 'uc_coupon.admin.inc',
    'weight' => 0,
  );
  $items['admin/store/coupons/%uc_coupon/print'] = array(
    'title' => 'Print',
    'description' => 'Print coupon.',
    'page callback' => 'uc_coupon_print',
    'page arguments' => array(
      3,
      5,
      'print',
    ),
    'access arguments' => array(
      'view store coupons',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'uc_coupon.admin.inc',
    'weight' => 1,
  );
  $items['admin/store/coupons/%uc_coupon/edit'] = array(
    'title' => 'Edit',
    'description' => 'Edit an existing coupon.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_coupon_add_form',
      3,
    ),
    'access arguments' => array(
      'manage store coupons',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'uc_coupon.admin.inc',
    'weight' => 2,
  );
  $items['admin/store/coupons/%uc_coupon/delete'] = array(
    'title' => 'Delete',
    'description' => 'Delete a coupon.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_coupon_delete_confirm',
      3,
    ),
    'access arguments' => array(
      'manage store coupons',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'uc_coupon.admin.inc',
    'weight' => 3,
  );
  $items['admin/store/coupons/%uc_coupon/codes'] = array(
    'title' => 'Download bulk coupon codes',
    'description' => 'Download the list of bulk coupon codes as a CSV file.',
    'page callback' => 'uc_coupon_codes_csv',
    'page arguments' => array(
      3,
    ),
    'access arguments' => array(
      'view store coupons',
    ),
    'file' => 'uc_coupon.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['admin/store/coupons/ahah'] = array(
    'page callback' => 'uc_coupon_ahah',
    'access arguments' => array(
      'manage store coupons',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'uc_coupon.admin.inc',
  );
  $items['admin/store/coupons/autocomplete/node'] = array(
    'title' => 'Node autocomplete',
    'page callback' => 'uc_coupon_autocomplete_node',
    'access arguments' => array(
      'manage store coupons',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'uc_coupon.admin.inc',
  );
  $items['admin/store/coupons/autocomplete/term'] = array(
    'title' => 'Term autocomplete',
    'page callback' => 'uc_coupon_autocomplete_term',
    'access arguments' => array(
      'manage store coupons',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'uc_coupon.admin.inc',
  );
  $items['admin/store/coupons/autocomplete/user'] = array(
    'title' => 'User autocomplete',
    'page callback' => 'uc_coupon_autocomplete_user',
    'access arguments' => array(
      'manage store coupons',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'uc_coupon.admin.inc',
  );
  $items['admin/store/coupons/autocomplete/role'] = array(
    'title' => 'Role autocomplete',
    'page callback' => 'uc_coupon_autocomplete_role',
    'access arguments' => array(
      'manage store coupons',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'uc_coupon.admin.inc',
  );
  $items['admin/store/settings/coupon'] = array(
    'title' => 'Coupon module settings',
    'description' => 'Configure the discount coupon module settings.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_coupon_settings_form',
    ),
    'access arguments' => array(
      'administer store',
    ),
    'file' => 'uc_coupon.admin.inc',
    'type' => MENU_NORMAL_ITEM,
  );
  $items['admin/store/reports/coupon'] = array(
    'title' => 'Coupon usage reports',
    'description' => 'View coupon usage reports.',
    'page callback' => 'uc_coupon_reports',
    'access arguments' => array(
      'view reports',
    ),
    'file' => 'uc_coupon.reports.inc',
    'type' => MENU_NORMAL_ITEM,
  );
  $items['cart/checkout/coupon'] = array(
    'title' => 'Apply coupon',
    'page callback' => 'uc_coupon_checkout_apply',
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}