function user_menu

7.x user.module user_menu()
6.x user.module user_menu()
4.x user.module user_menu()
5.x user.module user_menu()

Implementation of hook_menu

File

modules/user/user.module, line 6

Code

function user_menu() {
  $items = array();


  // This one will appear in our admin menu
  $items ["admin/config/users"] = array(
    "title" => "Users",
    "description" => "Search and manage FlightPath users",
    "page_callback" => "user_subtab_switchboard",
    "access_arguments" => array("manage_users"),
    "type" => MENU_TYPE_NORMAL_ITEM,
    "tab_parent" => "admin-tools/admin",
    "page_settings" => array(
      "menu_icon" => fp_get_module_path('user') . "/icons/group.png",
    ),
  );


  // Subtab for which type of user we want to work on.
  $items ["admin/users/faculty"] = array(
    "title" => "Faculty / Staff Users",
    "description" => "Search and manage faculty/staff users",
    "page_callback" => "user_display_users",
    "access_arguments" => array("manage_users"),
    "page_settings" => array(


      "page_hide_report_error" => TRUE,
      "menu_links" => array(
        0 => array(
          "text" => "Admin Console",
          "path" => "admin-tools/admin",
          "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
        ),
      ),
    ),
    "type" => MENU_TYPE_SUB_TAB,
    "tab_family" => "users",
    "tab_parent" => "admin-tools/admin",
    "weight" => 100,
  );

  $items ["admin/users/students"] = array(
    "title" => "Student Users",
    "page_callback" => "user_display_student_users",
    "access_arguments" => array("manage_users"),
    "page_settings" => array(


      "page_hide_report_error" => TRUE,
      "menu_links" => array(
        0 => array(
          "text" => "Admin Console",
          "path" => "admin-tools/admin",
          "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
        ),
      ),
    ),
    "type" => MENU_TYPE_SUB_TAB,
    "tab_family" => "users",
    "tab_parent" => "admin-tools/admin",
    "file" => menu_get_module_path("user") . "/user.student.inc",
    'weight' => 110,
  );


  $items ["admin/config/user-roles"] = array(
    "title" => "User roles",
    "description" => "Manage roles for users. Ex: advisors, viewers, etc.",
    "page_callback" => "fp_render_form",
    "page_arguments" => array("user_user_roles_form"),
    "access_arguments" => array("can_edit_user_roles"),
    "page_settings" => array(
      "menu_icon" => fp_get_module_path('user') . "/icons/medal_gold_1.png",


      "page_hide_report_error" => TRUE,
      "menu_links" => array(
        0 => array(
          "text" => "Admin Console",
          "path" => "admin-tools/admin",
          "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
        ),
      ),
    ),
    "type" => MENU_TYPE_NORMAL_ITEM,
    "tab_parent" => "admin-tools/admin",
  );

  $items ["admin/users/edit-user"] = array(
    "title" => "Edit Faculty/Staff User",
    "page_callback" => "fp_render_form",
    "page_arguments" => array("user_edit_user_form"),
    "access_arguments" => array("manage_users"),
    "page_settings" => array(


      "page_hide_report_error" => TRUE,
      "menu_links" => array(
        0 => array(
          "text" => "Admin Console",
          "path" => "admin-tools/admin",
          "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
        ),
        1 => array(
          "text" => "Back to Users list",
          "path" => "admin/users/faculty",
          "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
        ),
      ),
    ),
    "type" => MENU_TYPE_NORMAL_ITEM,
    "tab_parent" => "admin-tools/admin",
  );

  $items ["admin/users/edit-user/advisees"] = array(
    "title" => "Edit Faculty/Staff User Advisees",
    "page_callback" => "fp_render_form",
    "page_arguments" => array("user_edit_user_advisees_form"),
    "access_arguments" => array("manage_users"),
    "page_settings" => array(


      "page_hide_report_error" => TRUE,
      "menu_links" => array(
        0 => array(
          "text" => "Admin Console",
          "path" => "admin-tools/admin",
          "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
        ),
        1 => array(
          "text" => "Back to Users list",
          "path" => "admin/users/faculty",
          "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
        ),
      ),
    ),
    "type" => MENU_TYPE_NORMAL_ITEM,
    "tab_parent" => "admin-tools/admin",
  );



  $items ["admin/users/edit-student-user"] = array(
    "title" => "Edit Student",
    "page_callback" => "fp_render_form",
    "page_arguments" => array("user_edit_student_user_form"),
    "access_arguments" => array("manage_users"),
    "page_settings" => array(
      "page_hide_report_error" => TRUE,
      "menu_links" => array(
        0 => array(
          "text" => "Admin Console",
          "path" => "admin-tools/admin",
          "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
        ),
        1 => array(
          "text" => "Back to Users list",
          "path" => "admin/users/students",
          "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
        ),
      ),
    ),
    "type" => MENU_TYPE_NORMAL_ITEM,
    "tab_parent" => "admin-tools/admin",
    "file" => menu_get_module_path("user") . "/user.student.inc",
  );


  $items ["admin/users/edit-student-user/courses"] = array(
    "title" => "Edit Student Courses",
    "page_callback" => "fp_render_form",
    "page_arguments" => array("user_student_edit_student_courses_form"),
    "access_arguments" => array("manage_users"),
    "page_settings" => array(
      "page_hide_report_error" => TRUE,
      "menu_links" => array(
        0 => array(
          "text" => "Admin Console",
          "path" => "admin-tools/admin",
          "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
        ),
        1 => array(
          "text" => "Back to Users list",
          "path" => "admin/users/students",
          "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
        ),
      ),
    ),
    "type" => MENU_TYPE_CALLBACK,
    "tab_parent" => "admin-tools/admin",
    "file" => menu_get_module_path("user") . "/user.student.inc",
  );




  // For students...
  $items ["admin/users/edit-student-user/attributes"] = array(
    "title" => "Edit User Attributes",
    "page_callback" => "fp_render_form",
    "page_arguments" => array("user_edit_user_attributes_form"),
    "access_arguments" => array("manage_users"),
    "page_settings" => array(
      "page_hide_report_error" => TRUE,
      "menu_links" => array(
        0 => array(
          "text" => "Admin Console",
          "path" => "admin-tools/admin",
          "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
        ),
        1 => array(
          "text" => "Back to Users list",
          "path" => "admin/users/students",
          "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
        ),
      ),
    ),
    "type" => MENU_TYPE_CALLBACK,
    "tab_parent" => "admin-tools/admin",
  );

  // For faculty, but we are going to copy the entry for students and only change what
  // we need to.
  $items ["admin/users/edit-user/attributes"] = $items ["admin/users/edit-student-user/attributes"];
  $items ["admin/users/edit-user/attributes"]['page_settings']['menu_links'][1]['path'] = 'admin/users/faculty';







  $items ["admin/config/permissions"] = array(
    "title" => "Permissions",
    "description" => "Manage permissions for user roles in FlightPath",
    "page_callback" => "fp_render_form",
    "page_arguments" => array("user_permissions_form"),
    "access_arguments" => array("can_edit_permissions"),
    "page_settings" => array(
      "menu_icon" => fp_get_module_path('user') . "/icons/key.png",


      "page_hide_report_error" => TRUE,
      "menu_links" => array(
        0 => array(
          "text" => "Admin Console",
          "path" => "admin-tools/admin",
          "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
        ),
      ),
    ),
    "type" => MENU_TYPE_NORMAL_ITEM,
    "tab_parent" => "admin-tools/admin",
  );



  $items ["user-settings"] = array(
    "title" => t("User Settings"),
    "page_callback" => "fp_render_form",
    "page_arguments" => array('user_user_settings_form'),
    "access_arguments" => array("access_logged_in_content"),
    "type" => MENU_TYPE_TAB,
    "tab_family" => "user_settings",
    "weight" => 0,
  );




  $items ["user/%/edit-attribute/%"] = array(
    "title" => "Edit Attribute",
    "page_callback" => "fp_render_form",
    "page_arguments" => array("user_edit_attribute_form", "", 1, 3),
    "access_callback" => TRUE, // TODO: set to something else    
    "page_settings" => array(
      "page_hide_report_error" => TRUE,
    ),
  );






  return $items;
}