You are here

function userpoints_menu in User Points 5

Same name and namespace in other branches
  1. 5.3 userpoints.module \userpoints_menu()
  2. 5.2 userpoints.module \userpoints_menu()
  3. 6 userpoints.module \userpoints_menu()
  4. 7.2 userpoints.module \userpoints_menu()
  5. 7 userpoints.module \userpoints_menu()

Implementation of hook_menu().

File

./userpoints.module, line 65

Code

function userpoints_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'userpoints',
      'callback' => 'userpoints_list_users',
      'title' => t('users by !points', userpoints_translation()),
      'description' => t('List users by !points', userpoints_translation()),
      'access' => user_access(USERPOINTS_PERM_VIEW),
      'type' => MENU_NORMAL_ITEM,
    );
    $items[] = array(
      'path' => 'admin/settings/userpoints',
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'userpoints_admin_settings',
      ),
      'title' => t('!Points settings', userpoints_translation()),
      'description' => t('Configure userpoints settings'),
      'access' => user_access(USERPOINTS_PERM_ADMIN),
      'type' => MENU_NORMAL_ITEM,
    );
    $items[] = array(
      'path' => 'admin/user/userpoints',
      'callback' => 'userpoints_admin_manage',
      'title' => t('!Points', userpoints_translation()),
      'description' => t('Manage !points', userpoints_translation()),
      'access' => user_access(USERPOINTS_PERM_ADMIN),
    );
    $items[] = array(
      'path' => 'admin/user/userpoints/manage',
      'callback' => 'userpoints_admin_manage',
      'title' => t('Manage'),
      'access' => user_access(USERPOINTS_PERM_ADMIN),
      'type' => MENU_DEFAULT_LOCAL_TASK,
      'weight' => -1,
    );
    $items[] = array(
      'path' => 'admin/user/userpoints/add',
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'userpoints_admin_txn',
      ),
      'title' => t('Add'),
      'description' => t('Admin add/delete userpoints'),
      'access' => user_access(USERPOINTS_PERM_ADMIN),
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/user/userpoints/edit',
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'userpoints_admin_txn',
      ),
      'access' => user_access(USERPOINTS_PERM_ADMIN),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/user/userpoints/approve',
      'callback' => 'userpoints_admin_approve',
      'access' => user_access(USERPOINTS_PERM_ADMIN),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/user/userpoints/decline',
      'callback' => 'userpoints_admin_approve',
      'access' => user_access(USERPOINTS_PERM_ADMIN),
      'type' => MENU_CALLBACK,
    );
  }
  return $items;
}