You are here

function uc_attribute_menu in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_attribute/uc_attribute.module \uc_attribute_menu()
  2. 7.3 uc_attribute/uc_attribute.module \uc_attribute_menu()

Implements hook_menu().

File

uc_attribute/uc_attribute.module, line 55

Code

function uc_attribute_menu() {
  $items['admin/store/attributes'] = array(
    'title' => 'Attributes',
    'description' => 'Create and edit attributes and options.',
    'page callback' => 'uc_attribute_admin',
    'access arguments' => array(
      'administer attributes',
    ),
    'type' => MENU_NORMAL_ITEM,
    'weight' => -1,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/attributes/overview'] = array(
    'title' => 'Overview',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 0,
  );
  $items['admin/store/attributes/add'] = array(
    'title' => 'Add an attribute',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_form',
    ),
    'access arguments' => array(
      'administer attributes',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 5,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/settings/attributes'] = array(
    'title' => 'Attribute settings',
    'description' => 'Configure the attribute settings.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_admin_settings',
    ),
    'access arguments' => array(
      'administer attributes',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/attributes/%uc_attribute/edit'] = array(
    'title' => 'Edit attribute',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_form',
      3,
    ),
    'access arguments' => array(
      'administer attributes',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/attributes/%uc_attribute/delete'] = array(
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_delete_confirm',
      3,
    ),
    'access arguments' => array(
      'administer attributes',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/attributes/%uc_attribute/options'] = array(
    'title' => 'Options',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_options_form',
      3,
    ),
    'access arguments' => array(
      'administer attributes',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/attributes/%uc_attribute/options/overview'] = array(
    'title' => 'Overview',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 0,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/attributes/%uc_attribute/options/add'] = array(
    'title' => 'Add an option',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_option_form',
      3,
      NULL,
    ),
    'access arguments' => array(
      'administer attributes',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 5,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/attributes/%uc_attribute/options/%uc_attribute_option/edit'] = array(
    'title' => 'Edit option',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_option_form',
      3,
      5,
    ),
    'access arguments' => array(
      'administer attributes',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/attributes/%uc_attribute/options/%uc_attribute_option/delete'] = array(
    'title' => 'Delete option',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_option_delete_confirm',
      3,
      5,
    ),
    'access arguments' => array(
      'administer attributes',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'uc_attribute.admin.inc',
  );

  // Menu items for default product class attributes and options.
  $items['admin/store/products/classes/%uc_product_class/attributes'] = array(
    'title' => 'Attributes',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_object_attributes_form',
      4,
      'class',
    ),
    'access callback' => 'uc_attribute_product_class_access',
    'type' => MENU_LOCAL_TASK,
    'weight' => 1,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/products/classes/%uc_product_class/options'] = array(
    'title' => 'Options',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_object_options_form',
      4,
      'class',
    ),
    'access callback' => 'uc_attribute_product_class_access',
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/products/classes/%uc_product_class/attributes_bulk'] = array(
    'title' => 'Bulk',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_bulk_update_form',
      4,
      'class',
    ),
    'access callback' => 'uc_attribute_product_class_access',
    'type' => MENU_LOCAL_TASK,
    'weight' => 3,
    'file' => 'uc_attribute.admin.inc',
  );

  // Insert subitems into the edit node page for product types.
  $items['node/%node/edit/attributes'] = array(
    'title' => 'Attributes',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_object_attributes_form',
      1,
      'product',
      'overview',
    ),
    'access callback' => 'uc_attribute_product_access',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 1,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['node/%node/edit/attributes/add'] = array(
    'title' => 'Attributes',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_object_attributes_form',
      1,
      'product',
      'add',
    ),
    'access callback' => 'uc_attribute_product_access',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 1,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['node/%node/edit/attributes/reset'] = array(
    'title' => 'Reset to defaults',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_node_reset_confirm',
      1,
    ),
    'access callback' => 'uc_attribute_product_access',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['node/%node/edit/options'] = array(
    'title' => 'Options',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_object_options_form',
      1,
      'product',
    ),
    'access callback' => 'uc_attribute_product_option_access',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['node/%node/edit/adjustments'] = array(
    'title' => 'Adjustments',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_product_adjustments_form',
      1,
    ),
    'access callback' => 'uc_attribute_product_option_access',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 3,
    'file' => 'uc_attribute.admin.inc',
  );
  return $items;
}