function student_files_menu

7.x student_files.module student_files_menu()
6.x student_files.module student_files_menu()

Implementation of hook_menu

File

modules/student_files/student_files.module, line 11
This is the student_files module, which will facilitate uploading (securely) files to be associated with student accounts.

Code

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

  $items ["admin/config/student-files"] = array(
    "title" => "Student Files settings",
    "description" => "Configure settings related to the student_files module.",
    "page_callback" => "fp_render_form",
    "page_arguments" => array("student_files_settings_form", "system_settings"),
    "access_arguments" => array("administer_student_files"),
    "page_settings" => array(
      "menu_icon" => fp_get_module_path('system') . "/icons/page_white_stack.png",
      "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",

  );


  // This will receive uploaded files for a student.
  $items ["student-files/handle-upload/%"] = array(
    "page_callback" => "student_files_handle_upload",
    "page_arguments" => array(2),
    "access_arguments" => array("upload_student_files"),
    "type" => MENU_TYPE_CALLBACK,
  );


  $items ["student-files/handle-download/%/%"] = array(
    "page_callback" => "student_files_handle_download",
    "page_arguments" => array(2, 3),
    "access_callback" => "student_files_user_may_download_student_file",
    "access_arguments" => array(2, 3),
    "type" => MENU_TYPE_CALLBACK,
  );


  $items ["student-files/handle-delete/%/%"] = array(
    "page_callback" => "student_files_handle_delete",
    "page_arguments" => array(2, 3),
    "access_callback" => "student_files_user_may_delete_student_file",
    "access_arguments" => array(2, 3),
    "type" => MENU_TYPE_CALLBACK,
  );


  $items ["admin-tools/upload-student-files"] = array(
    "title" => "Upload Student Files",
    "description" => "Upload files to any student's file area.",
    "page_callback" => "fp_render_form",
    "page_arguments" => array("student_files_upload_any_student_files_form"),
    "access_arguments" => array("upload_any_student_files"),
    "page_settings" => array(

      "menu_icon" => fp_get_module_path("student_files") . "/css/icons/page_add.png",
      "menu_links" => array(
        0 => array(
          "text" => t("Admin Tools"),
          "path" => "admin-tools",
          "query" => "de_catalog_year=%DE_CATALOG_YEAR%",
        ),
      ),

    ),
    "type" => MENU_TYPE_NORMAL_ITEM,
    "weight" => 100,
  );



  return $items;
}