function prereqs_settings_form

6.x prereqs.module prereqs_settings_form()

File

modules/prereqs/prereqs.module, line 59
This is the module file for the prereqs module.

Code

function prereqs_settings_form() {
  $form = array();

  $elements = array();

  $elements ["prereqs_show_availability_in_popup"] = array(
    "label" => t("Show course's anticipated availability (from Course Search module) in course description popups?"),
    "type" => "select",
    "options" => array("no" => t("No"), "yes" => "Yes"),
    "hide_please_select" => TRUE,
    "value" => variable_get("prereqs_show_availability_in_popup", "no"),
    "description" => t("If set to 'Yes', this will show a course's anticipated availability (what terms it will be available)
                        in the course description popup which loads when a course is clicked."),
  );


  $elements ["prereqs_lock_course_advise_based_on_avail"] = array(
    "label" => t("Lock advising for a course based on availability?"),
    "type" => "select",
    "options" => array("no" => t("No"), "yes" => "Yes"),
    "hide_please_select" => TRUE,
    "value" => variable_get("prereqs_lock_course_advise_based_on_avail", "no"),
    "description" => t("If set to 'Yes', this will 'lock' a course's advising checkbox if it is not
                        offered in the advising term selected.  This requires that most of your courses
                        have accurate term schedules entered in the Course Search module.  If unsure what to select, choose 'no'."),
  );

  $elements ["prereqs_use_term_desc_abbr_in_popup"] = array(
    "label" => t("Use term description abbreviations in popup?"),
    "type" => "select",
    "options" => array("no" => t("No"), "yes" => "Yes"),
    "hide_please_select" => TRUE,
    "value" => variable_get("prereqs_use_term_desc_abbr_in_popup", "yes"),
    "description" => t("If set to 'Yes', then the availability text in a course's popup description will show
                        the \"abbreviated\" term descriptions.  Ex:  Sum1 instead of Summer One.  To show full
                        term descriptions, chose 'no'.  If unsure what to select, choose 'no'."),
  );



  $elements ["prereqs_not_anticipated_text"] = array(
    "label" => t("The message to show in the popup description, when 'Not Anticipated' has been selected for a course, or if no current terms are selected:"),
    "type" => "textfield",
    "maxlength" => "255",
    "size" => "80",
    "value" => variable_get("prereqs_not_anticipated_text", "This course isn't currently anticipated to be offered. Please ask your advisor to learn more."),
    "description" => t("This message will show in the popup description for a course, when it has been flaged as 'Not Anticipated' in its schedule, or if no current terms
                        have been selected.
                        <br>Ex: <em>This course isn't currently anticipated to be offered. Please ask your advisor to learn more.</em>"),
  );



  $elements ["prereqs_lock_msg_avail"] = array(
    "label" => t("The message to show the user when the course is locked due to availability (option above must be set to 'yes'):"),
    "type" => "textfield",
    "maxlength" => "255",
    "size" => "80",
    "value" => variable_get("prereqs_lock_msg_avail", "This course is not listed as being available for the selected advising term (@term)."),
    "description" => t("This message will show to the advisor when they try to bypass the lock for availability.  You may use the replacement pattern <b>@term</b>
                        to mean the current term selected.  
                        <br>Ex: <em>This course is not listed as being available for the selected advising term (@term).</em>"),
  );


  $form ["avail"] = array(
    "type" => "cfieldset",
    "label" => t("Prereqs based on availability"),
    "elements" => array($elements),
  );


  //////////////////////////////////////////////////////////
  //////////////////////////////////////////////////////////
  //////////////////////////////////////////////////////////
  //////////////////////////////////////////////////////////
  //////////////////////////////////////////////////////////


  $elements = array();


  $elements ["prereqs_show_courses_in_popup"] = array(
    "label" => t("Show course's prereq courses in course description popups and on Course Search module?"),
    "type" => "select",
    "options" => array("no" => t("No"), "yes" => "Yes"),
    "hide_please_select" => TRUE,
    "value" => variable_get("prereqs_show_courses_in_popup", "no"),
    "description" => t("If set to 'Yes', this will show a course's prereq course requirements (from the Course Edit form)
                        in the course description popup which loads when a course is clicked, and in course descriptions in the Course Search module."),
  );


  $elements ["prereqs_lock_course_advise_based_on_courses"] = array(
    "label" => t("Lock advising for a course based on prereq courses?"),
    "type" => "select",
    "options" => array("no" => t("No"), "yes" => "Yes"),
    "hide_please_select" => TRUE,
    "value" => variable_get("prereqs_lock_course_advise_based_on_courses", "no"),
    "description" => t("If set to 'Yes', this will 'lock' a course's advising checkbox if its prereq courses (entered on the Course Edit form for that course)
                        have not been fulfilled.  If unsure what to select, choose 'no'."),
  );

  $elements ["prereqs_lock_msg_courses"] = array(
    "label" => t("The message to show the user when the course is locked due to prereq courses (option above must be set to 'yes'):"),
    "type" => "textfield",
    "maxlength" => "255",
    "size" => "80",
    "value" => variable_get("prereqs_lock_msg_courses", "This course is not listed as being available because the student has not fulfilled the following prerequisite course(s) and possible min grades:\\n   @need_courses."),
    "description" => t("This message will show to the advisor when they try to bypass the lock for prereq courses.  You may use the replacement pattern <b>@needed_courses</b>
                        to mean the current term selected.  You may also use \\n to mean 'insert new line.'  
                        <br>Ex: <em>This course is not listed as being available because the student has not fulfilled the following prerequisite course(s) and possible min grades:\\n   @need_courses.</em>"),
  );



  $form ["courses"] = array(
    "type" => "cfieldset",
    "label" => t("Prereqs based on prereq courses"),
    "elements" => array($elements),
  );


  ///////////////////////////
  ///////////////////////////
  ///////////////////////////
  ///////////////////////////

  $form ["prereqs_confirm_msg"] = array(
    "label" => t("Confirm message:"),
    "type" => "textfield",
    "maxlength" => 255,
    "size" => 80,
    "value" => variable_get("prereqs_confirm_msg", "Are you sure you wish to advise the student to enroll in this course anyway?"),
    "description" => t("This message will be appended AFTER the lock message to the advisor, asking them if they wish to proceed with advising anyway.
                        Ex: <em>Are you sure you wish to advise the student to enroll in this course anyway?</em>"),
  );






  return $form;
}