You are here

function user_badges_menu in User Badges 6

Same name and namespace in other branches
  1. 5 user_badges.module \user_badges_menu()
  2. 6.2 user_badges.module \user_badges_menu()
  3. 7.4 user_badges.module \user_badges_menu()
  4. 7 user_badges.module \user_badges_menu()
  5. 7.2 user_badges.module \user_badges_menu()
  6. 7.3 user_badges.module \user_badges_menu()

Implements hook_menu().

File

./user_badges.module, line 69
@brief User Badges module file

Code

function user_badges_menu() {
  $items = array();
  $access = array(
    'manage badges',
  );
  $items['admin/user/user_badges'] = array(
    'title' => 'Badges',
    'description' => t('Add, edit, and delete badges.  Associate badges with roles and configure site-wide settings for badges.'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_badges_badgelist_form',
    ),
    'access arguments' => $access,
    'file' => 'user_badges.admin.inc',
  );
  $items['admin/user/user_badges/list'] = array(
    'title' => 'List',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_badges_badgelist_form',
    ),
    'access arguments' => $access,
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
    'file' => 'user_badges.admin.inc',
  );
  $items['admin/user/user_badges/add'] = array(
    'title' => 'Add',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_badges_edit_form',
    ),
    'access arguments' => $access,
    'type' => MENU_LOCAL_TASK,
    'file' => 'user_badges.admin.inc',
  );
  $items['admin/user/user_badges/images'] = array(
    'title' => 'Images',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_badges_images_form',
    ),
    'access arguments' => $access,
    'type' => MENU_LOCAL_TASK,
    'file' => 'user_badges.admin.inc',
  );
  $items['admin/user/user_badges/roles'] = array(
    'title' => 'Roles',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_badges_roles_form',
    ),
    'access arguments' => $access,
    'type' => MENU_LOCAL_TASK,
    'file' => 'user_badges.admin.inc',
  );
  $items['admin/user/user_badges/settings'] = array(
    'title' => 'Settings',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_badges_settings_form',
    ),
    'access arguments' => $access,
    'type' => MENU_LOCAL_TASK,
    'file' => 'user_badges.admin.inc',
  );
  $items['admin/user/user_badges/edit/%'] = array(
    'title' => 'Edit badge',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_badges_edit_form',
      4,
    ),
    'access arguments' => $access,
    'type' => MENU_CALLBACK,
    'file' => 'user_badges.admin.inc',
  );
  $items['admin/user/user_badges/delete/%'] = array(
    'title' => 'Delete badge',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_badges_delete_form',
      4,
    ),
    'access arguments' => $access,
    'type' => MENU_CALLBACK,
    'file' => 'user_badges.admin.inc',
  );
  $items['user/%/badges'] = array(
    'title' => 'Badges',
    'page callback' => 'user_badges_userweight_page',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'show badges in user profile',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 4,
  );
  $items['user/%/badges/list'] = array(
    'title' => 'List',
    'page callback' => 'user_badges_userweight_page',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'show badges in user profile',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['user/%/badges/edit'] = array(
    'title' => 'Edit',
    'page callback' => 'user_badges_page',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'change badge assignments',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 5,
  );
  $items['user_badges/autocomplete'] = array(
    'title' => 'User Badges Badge Name Autocomplete',
    'page callback' => 'user_badges_badge_autocomplete',
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );
  return $items;
}