You are here

function user_badges_menu in User Badges 7.2

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. 6 user_badges.module \user_badges_menu()
  4. 7.4 user_badges.module \user_badges_menu()
  5. 7 user_badges.module \user_badges_menu()
  6. 7.3 user_badges.module \user_badges_menu()

Implements hook_menu().

File

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

Code

function user_badges_menu() {
  $items = array();
  $items[USER_BADGES_ADMIN_PATH] = array(
    'title' => 'Badges',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_badges_badgelist_form',
    ),
    'access arguments' => array(
      'manage badges',
    ),
    'file' => 'user_badges.admin.inc',
  );
  $items[USER_BADGES_ADMIN_PATH . '/list'] = array(
    'title' => 'List',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_badges_badgelist_form',
    ),
    'access arguments' => array(
      'manage badges',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
    'file' => 'user_badges.admin.inc',
  );
  $items[USER_BADGES_ADMIN_PATH . '/add'] = array(
    'title' => 'Add new badge',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_badges_edit_form',
    ),
    'access arguments' => array(
      'manage badges',
    ),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'user_badges.admin.inc',
  );
  $items[USER_BADGES_ADMIN_PATH . '/images'] = array(
    'title' => 'Images',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_badges_images_form',
    ),
    'access arguments' => array(
      'manage badges',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'user_badges.admin.inc',
  );
  $items[USER_BADGES_ADMIN_PATH . '/roles'] = array(
    'title' => 'Roles',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_badges_roles_form',
    ),
    'access arguments' => array(
      'manage badges',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'user_badges.admin.inc',
  );
  $items[USER_BADGES_ADMIN_PATH . '/settings'] = array(
    'title' => 'Settings',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_badges_settings_form',
    ),
    'access arguments' => array(
      'manage badges',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'user_badges.admin.inc',
  );
  $items[USER_BADGES_ADMIN_PATH . '/edit/%user_badge'] = array(
    'title' => 'Edit badge',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_badges_edit_form',
      USER_BADGES_ARG_POSITION,
    ),
    'access arguments' => array(
      'manage badges',
    ),
    'type' => MENU_CALLBACK + MENU_VISIBLE_IN_BREADCRUMB,
    'file' => 'user_badges.admin.inc',
  );
  $items[USER_BADGES_ADMIN_PATH . '/delete/%user_badge'] = array(
    'title' => 'Delete badge',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_badges_delete_form',
      USER_BADGES_ARG_POSITION,
    ),
    'access arguments' => array(
      'manage badges',
    ),
    'type' => MENU_CALLBACK + MENU_VISIBLE_IN_BREADCRUMB,
    'file' => 'user_badges.admin.inc',
  );
  $items['user/%user/badges'] = array(
    'title' => 'Badges',
    'page callback' => 'user_badges_userweight_page',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'change badge assignments',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 4,
  );
  $items['user/%user/badges/list'] = array(
    'title' => 'List',
    'page callback' => 'user_badges_userweight_page',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'change badge assignments',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['user/%user/badges/whoelse'] = array(
    'title' => 'Who Else',
    'page callback' => 'user_badges_userweight_page',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'change badge assignments',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 0,
  );
  $items['user/%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,
  );

  // Menu item to allow a user to change their own badge assignments.
  $items['user/%user/edit/badges'] = array(
    'title' => 'Badges',
    'page callback' => 'user_badges_page',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'change own 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;
}