function admin_add_degree_form
Search API
7.x admin.degrees.inc | admin_add_degree_form() |
6.x admin.degrees.inc | admin_add_degree_form() |
4.x admin.degrees.inc | admin_add_degree_form() |
5.x admin.degrees.inc | admin_add_degree_form() |
This form lets the user add a degree to the database.
File
- modules/
admin/ admin.degrees.inc, line 432
Code
function admin_add_degree_form() {
$de_catalog_year = admin_get_de_catalog_year();
fp_set_title(t("Add Degree for") . " " . $de_catalog_year);
$form = array();
$m = 0;
$form ["markup" . $m++] = array(
"type" => "markup",
"value" => t("You may use this screen to add a new degree,
by entering a new degree code (Level 1 or 2) or <em>track</em> (Level-3 degree) code.
<br><br><em>Note: For simplicity, FlightPath refers to Level-1 and -2 degree codes as \"major codes\" and Level-3 degree codes as \"track codes\".</e>"),
);
$bool_legacy_concentrations = variable_get("enable_legacy_concentrations", FALSE);
$legacy_text = "";
if ($bool_legacy_concentrations) {
$legacy_text = " [and concentration] ";
}
$form ["de_catalog_year"] = array(
"type" => "hidden",
"value" => $de_catalog_year,
);
$form ["new_major"] = array(
"type" => "radios",
"label" => t("Are you entering a new major code $legacy_text,<br>
or an existing major code $legacy_text (so you can add a new track)?"),
"options" => array(
"new" => t("Entering a <b>new</b> major code"),
"existing" => t("Entering an <b>existing</b> major code (only adding a new Level-3 track)"),
),
"required" => TRUE,
);
$desc = "Enter the Level-1 or -2 Major Code here.
Do not enter any Level 3 codes (ex: Tracks or Concentrations).
<br>For example, enter ACCT or ENGL. <i><b>But not ENGL|_TRKA, etc</b></i>";
if ($bool_legacy_concentrations) {
$desc = "To enter a concentration code, use MAJOR|CONC.
The | character is call the pipe, and it should under the backspace key.
If adding a new concentration to an existing major, you still put this in as a
NEW major code. Do not have any spaces in this box. The concentration code
is optional. If the major does not have a concentration,
then simply enter the major code by itself. The combined major code and optional track
code can only be 18 characters maximum.";
}
$form ["major_code"] = array(
"type" => "textfield",
"size" => 15,
"label" => t("Level-1 or -2 Major Code:"),
"description" => t($desc),
"required" => TRUE,
);
$form ["new_track"] = array(
"type" => "radios",
"label" => t("Are you entering a new Level-3 track code?"),
"options" => array(
"new" => t("Entering a <b>new</b> track code"),
"none" => t("None - Not adding a track. Leave blank"),
),
"required" => TRUE,
);
$form ["track_code"] = array(
"type" => "textfield",
"size" => 15,
"label" => t("Level-3 Track code:"),
"description" => t("Leave blank if you selected None above. This code must not contain spaces,
and combined with the major code it must not exceed 18 characters."),
);
// Our submit button.
$form ["submit"] = array(
"type" => "submit",
"value" => "Submit",
"prefix" => "<hr>",
);
return $form;
}