You are here

function uc_catalog_menu in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_catalog/uc_catalog.module \uc_catalog_menu()
  2. 7.3 uc_catalog/uc_catalog.module \uc_catalog_menu()

Implementation of hook_menu().

File

uc_catalog/uc_catalog.module, line 61
Übercart Catalog module.

Code

function uc_catalog_menu($may_cache) {
  global $user;
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'catalog',
      'access' => user_access('view catalog'),
      'title' => variable_get('uc_catalog_name', t('Catalog')),
      'callback' => 'theme',
      'callback arguments' => array(
        'uc_catalog_browse',
      ),
      'type' => MENU_SUGGESTED_ITEM,
    );
    $items[] = array(
      'path' => 'admin/store/settings/catalog',
      'access' => user_access('administer catalog'),
      'title' => t('Catalog settings'),
      'description' => t('Configure the catalog settings.'),
      'callback' => 'uc_catalog_settings_overview',
      'type' => MENU_NORMAL_ITEM,
    );
    $items[] = array(
      'path' => 'admin/store/settings/catalog/overview',
      'access' => user_access('administer catalog'),
      'title' => t('Overview'),
      'weight' => -10,
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/store/settings/catalog/edit',
      'access' => user_access('administer catalog'),
      'title' => t('Edit'),
      'callback' => 'uc_catalog_admin_settings',
      'weight' => -5,
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/store/settings/catalog/edit/catalog',
      'access' => user_access('administer catalog'),
      'title' => t('Catalog'),
      'weight' => -10,
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/store/settings/catalog/edit/grid',
      'access' => user_access('administer catalog'),
      'title' => t('Grid'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'uc_catalog_grid_admin_form',
      ),
      'weight' => -5,
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/store/products/orphans',
      'title' => t('Find orphaned products'),
      'access' => user_access('administer catalog'),
      'callback' => 'uc_catalog_orphaned_products',
      'description' => t('Find products that have not been categorized.'),
      'type' => MENU_NORMAL_ITEM,
      'weight' => -4,
    );
    if (module_exists('ubrowser')) {
      $items[] = array(
        'path' => 'admin/store/products/categories',
        'access' => user_access('administer catalog'),
        'title' => t('Move products'),
        'callback' => 'drupal_get_form',
        'callback arguments' => 'uc_catalog_set_category_form',
        'type' => MENU_NORMAL_ITEM,
        'weight' => -6,
      );
    }
  }
  return $items;
}