function system_settings_form
Search API
6.x system.module | system_settings_form() |
4.x system.module | system_settings_form() |
5.x system.module | system_settings_form() |
This is the "system settings" form.
File
- modules/
system/ system.module, line 1815
Code
function system_settings_form() {
$form = array();
$m = 0;
$form ["mark" . $m++] = array(
"value" => t("Use this form to alter the various system settings in FlightPath.
Before making changes, it is always good policy to first back up your database."),
);
$form ["mark" . $m++] = array(
"value" => "<p><div style='font-size:0.8em;'>" . t("Your site requires a cron job in order to perform routine tasks. This
is accomplished by having your server access the following URL every so often
(like once an hour):") . "<br> <i>" . $GLOBALS ["fp_system_settings"]["base_url"] . "/cron.php?t=" . $GLOBALS ["fp_system_settings"]["cron_security_token"] . "</i>
<br>" . t("Example linux cron command:") . " <i>wget -O - -q -t 1 http://ABOVE_URL</i></div></p>",
);
$form ["maintenance_mode"] = array(
"label" => t("Set maintenance mode?"),
"type" => "checkbox",
"value" => variable_get("maintenance_mode", FALSE),
"description" => t("If checked, a message will display on every page stating
that the system is currently undergoing routine maintenance."),
);
$form ["disable_login_except_admin"] = array(
"type" => "select",
"label" => t("Disable all new logins (except admin user)?"),
"hide_please_select" => TRUE,
"options" => array("no" => t("No"), "yes" => t("Yes")),
"value" => variable_get('disable_login_except_admin', 'no'),
"description" => t("If set to Yes, then when normal users attempt to log in, they will be
sent back to the login page, with a message displayed explaning that
logins are disabled. Admin will still be able to log in. This
is useful when trying to perform maintenance on FlightPath. If unsure
what to select, select 'No'."),
);
$form ["system_name"] = array(
"type" => "textfield",
"label" => t("System Name:"),
"value" => variable_get("system_name", "FlightPath"),
"description" => t("This is the name of this software system. Ex: FlightPath. This setting allows you to re-name this
system for you school. You will also need to create new themes, and edit where the name FlightPath
is hard-coded in the template files. This will only change the name FlightPath in user-facing pages,
it will still appear in admin sections. After changing this value, clear your cache, as several
menu items will need to be updated."),
);
// Can we support clean_urls?
$bool_support_clean = system_check_clean_urls();
$form ["support_clean_urls"] = array(
"type" => "hidden",
"value" => ($bool_support_clean) ? "yes" : "no",
);
if ($bool_support_clean) {
// Give the option to change ONLY if we can support clean URLs
$form ["clean_urls"] = array(
"type" => "checkbox",
"label" => t("Enable 'Clean URLs?'"),
"value" => variable_get("clean_urls", FALSE),
"description" => t("Your server supports 'clean URLs', which eliminates 'index.php?q=' from your URLs, making them
more readable. It is recommended you leave this feature enabled. For more information, see: http://getflightpath.com/node/5."),
);
}
else {
// Server does not support clean URLs.
$form ["support_clean_markup"] = array(
"value" => "<p><b>Clean URLs:</b> This server <u>does not support</u> clean URLs. If you are using an Apache-compatible server,
make sure that your .htaccess file is properly configured. For more information, see: http://getflightpath.com/node/5.</p>",
);
}
$form ["theme"] = array(
"type" => "radios",
"label" => t("Theme:"),
"options" => system_get_available_themes(),
"value" => variable_get("theme", "themes/classic"),
"description" => t("Select the theme you wish to use. Ex: Classic (themes/classic)"),
);
$form ["notify_apply_draft_changes_email_address"] = array(
"type" => "textfield",
"label" => t("Notify apply draft changes email address:"),
"value" => variable_get("notify_apply_draft_changes_email_address", ""),
"description" => t("Enter 1 or more email addresses (separated by comma) to notify when
draft changes are applied from the admin console.
Leave blank to disable."),
);
$form ["notify_mysql_error_email_address"] = array(
"type" => "textfield",
"label" => t("Notify MySQL error email address:"),
"value" => variable_get("notify_mysql_error_email_address", ""),
"description" => t("Enter 1 or more email addresses (separated by comma) to notify when
a mysql error occurs.
Leave blank to disable."),
);
$form ["notify_php_error_email_address"] = array(
"type" => "textfield",
"label" => t("Notify PHP error email address:"),
"value" => variable_get("notify_php_error_email_address", ""),
"description" => t("Enter 1 or more email addresses (separated by comma) to notify when
a PHP warning or error occurs. Leave blank to disable. Recommendation: disable
on development, but enable on production."),
);
$form ["admin_transfer_passcode"] = array(
"type" => "textfield",
"label" => t("Admin Apply Draft password:"),
"value" => variable_get("admin_transfer_passcode", "changeMe"),
"description" => t("Enter a password which an admin user must enter
in order to apply draft changes to FlightPath.
This is an added security measure. Ex: p@ssWord569w"),
);
$options = array(
"90" => "90 days",
"180" => "180 days",
"365" => "1 year (365 days)",
"548" => "1.5 years (548 days)",
"730" => "2 years (730 days)",
"912" => "2.5 years (912 days)",
"never" => t("Never - Do not trim log table"),
);
$form ["max_watchdog_age"] = array(
"type" => "select",
"label" => t("Max watchdog (log) entry age:"),
"hide_please_select" => TRUE,
"options" => $options,
"value" => variable_get("max_watchdog_age", "548"),
"description" => t("Keep entries in the watchdog log tables until they are this old.
Entries older than this will be deleted at every cron run.
For example, if you only want to keep log entries for 1 year, then
set this to 1 year.
<b>Warning:</b> the Stats module uses data in this table to create
statistics and reports about use of FlightPath. Once data is removed from the
watchdog table, it cannot be retrieved again.
<br>If you are unsure what to put here, select '1.5 years'."),
);
$form ["popup_admin_win_options"] = array(
"type" => "textfield",
"size" => 80,
"label" => t("Javascript Popup Admin Window Options:"),
"value" => variable_get("popup_admin_win_options", "toolbar=no,status=2,scrollbars=yes,resizable=yes,width=600,height=400"),
"description" => t("This is the popup javascript options for the 'Admin' popup window. This popup is used for
assigning groups in degree edit, editing definitions, and the popup contact window.
<br><b>DO NOT ENTER ANY SPACES OR QUOTES! Entering invalid syntax could break your Javascript.</b>
<br>If unsure what to enter, use: <em>toolbar=no,status=2,scrollbars=yes,resizable=yes,width=600,height=400</em>"),
);
$form ["popup_advise_win_options"] = array(
"type" => "textfield",
"size" => 80,
"label" => t("Javascript Popup Advise Window Options:"),
"value" => variable_get("popup_advise_win_options", "toolbar=no,status=2,scrollbars=yes,resizable=yes,width=460,height=375"),
"description" => t("This is the popup javascript options for the 'Advising' popup window. This popup is used for
course descriptions, group selections, substitutions, etc.
<br><b>DO NOT ENTER ANY SPACES OR QUOTES! Entering invalid syntax could break your Javascript.</b>
<br>If unsure what to enter, use: <em>toolbar=no,status=2,scrollbars=yes,resizable=yes,width=460,height=375</em>"),
);
$form ["popup_print_win_options"] = array(
"type" => "textfield",
"size" => 80,
"label" => t("Javascript Popup Print Window Options:"),
"value" => variable_get("popup_print_win_options", "toolbar=no,status=2,scrollbars=yes,resizable=yes,width=750,height=600"),
"description" => t("This is the popup javascript options for the 'Print' popup window. This popup is used for
printable views of degree plans.
<br><b>DO NOT ENTER ANY SPACES OR QUOTES! Entering invalid syntax could break your Javascript.</b>
<br>If unsure what to enter, use: <em>toolbar=no,status=2,scrollbars=yes,resizable=yes,width=750,height=600</em>"),
);
$form ["admin_degrees_default_allow_dynamic"] = array(
"type" => "textfield",
"size" => 5,
"label" => t("Default 'Allow Dynamic' value for new degrees:"),
"value" => variable_get("admin_degrees_default_allow_dynamic", "0"),
"description" => t("When creating a new degree, this is the default value to set for 'Allow Dynamic'. If set to 1 (the number one), it means
the degree is allowed to be dynamic, meaning it can be combined with other 'dynamic' degrees. If it is set to 0 (zero), it
means the degree is not allowed to be combined with anything else. If you are unsure what to enter here, type 0 (zero)."),
);
$form ["enable_legacy_concentrations"] = array(
"label" => t("Enable legacy concentrations?"),
"type" => "checkbox",
"value" => variable_get("enable_legacy_concentrations", FALSE),
"description" => t("If checked, FlightPath will instruct users creating new degrees (and in other places) to
enter concentrations with a | (pipe) symbol. This is how concentrations were handled in FlightPath 4x and
before-- as entirely separate degrees. However, this can cause confusion if Dynamic Degrees
and/or Level-3 degrees are being utilized, as a concentration is a similar concept as a level-3 track, and some schools
may even name it as such. If you are unsure what to do, leave this unchecked."),
);
return $form;
}