You are here

function uc_attribute_menu in Ubercart 7.3

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

Implements hook_menu().

File

uc_attribute/uc_attribute.module, line 45
Ubercart Attribute module.

Code

function uc_attribute_menu() {
  $items['admin/store/products/attributes'] = array(
    'title' => 'Attributes',
    'description' => 'Create and edit product attributes and options.',
    'page callback' => 'uc_attribute_admin',
    'access arguments' => array(
      'administer attributes',
    ),
    'weight' => -8,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/products/attributes/add'] = array(
    'title' => 'Add an attribute',
    'description' => 'Add a product attribute.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_form',
    ),
    'access arguments' => array(
      'administer attributes',
    ),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/products/attributes/%uc_attribute/edit'] = array(
    'title' => 'Edit attribute',
    'description' => 'Edit a product attribute.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_form',
      4,
    ),
    'access arguments' => array(
      'administer attributes',
    ),
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/products/attributes/%uc_attribute/delete'] = array(
    'title' => 'Delete attribute',
    'description' => 'Delete a product attribute.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_delete_confirm',
      4,
    ),
    'access arguments' => array(
      'administer attributes',
    ),
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/products/attributes/%uc_attribute/options'] = array(
    'title' => 'Options',
    'description' => "Edit a product attribute's options.",
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_options_form',
      4,
    ),
    'access arguments' => array(
      'administer attributes',
    ),
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/products/attributes/%uc_attribute/options/add'] = array(
    'title' => 'Add an option',
    'description' => 'Add a product attribute option.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_option_form',
      4,
      NULL,
    ),
    'access arguments' => array(
      'administer attributes',
    ),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/products/attributes/%uc_attribute/options/%uc_attribute_option/edit'] = array(
    'title' => 'Edit option',
    'description' => 'Edit a product attribute option.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_option_form',
      4,
      6,
    ),
    'access arguments' => array(
      'administer attributes',
    ),
    'file' => 'uc_attribute.admin.inc',
  );
  $items['admin/store/products/attributes/%uc_attribute/options/%uc_attribute_option/delete'] = array(
    'title' => 'Delete option',
    'description' => 'Delete a product attribute option.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'uc_attribute_option_delete_confirm',
      4,
      6,
    ),
    'access arguments' => array(
      'administer attributes',
    ),
    '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',
    'description' => 'Administer product class 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',
    'description' => 'Administer product class 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',
  );

  // Insert subitems into the edit node page for product types.
  $items['node/%node/edit/attributes'] = array(
    'title' => 'Attributes',
    'description' => 'Edit product 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' => 'Add an attribute',
    'description' => 'Add an attribute to this product.',
    '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_ACTION,
    'weight' => 1,
    'file' => 'uc_attribute.admin.inc',
  );
  $items['node/%node/edit/options'] = array(
    'title' => 'Options',
    'description' => 'Administer product attribute 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',
    'description' => 'Administer SKU adjustments for different variants of this product.',
    '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;
}