function student_files_little_upload_form

7.x student_files.module student_files_little_upload_form($student_id = "")
6.x student_files.module student_files_little_upload_form($student_id = "")

File

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

Code

function student_files_little_upload_form($student_id = "") {
  $form = array();

  $form ["#attributes"] = array("enctype" => 'multipart/form-data'); // allow the form itself to submit files.


  $form ["student_file_upload_file"] = array(
    "type" => "file",
    "description" => t("<b>Allowed files:</b> <em>%ext</em>", array("%ext" => strtolower(variable_get("student_files_allowed_extensions", "txt, pdf, doc, docx, csv, xls, xlsx, ppt, pptx, rtf, odt, jpg, jpeg, png, gif, zip, 7z")))),
  );

  $form ["access_type"] = array(
    "type" => "radios",
    "label" => t("Visible to:"),
    "options" => array("public" => t("Anyone (incl students)"), "faculty" => t("Faculty/Staff")),
    "value" => "faculty",
  );

  $form ["student_id"] = array(
    "type" => "hidden",
    "value" => $student_id,
  );

  $form ["current_student_id"] = array(
    "type" => "hidden",
    "value" => $student_id,
  );


  $form ["submit_btn"] = array(
    "type" => "submit",
    "value" => t("Upload"),
    "attributes" => array("onClick" => "showUpdate(false);"),
  );

  return $form;
}