You are here

function timezone_detect_admin_form in Timezone Detect 6

Same name and namespace in other branches
  1. 7 timezone_detect.admin.inc \timezone_detect_admin_form()

Administration form.

1 string reference to 'timezone_detect_admin_form'
timezone_detect_menu in ./timezone_detect.module
Implements hook_menu().

File

./timezone_detect.admin.inc, line 11
Administration pages for Timezone Detect module.

Code

function timezone_detect_admin_form() {
  $options = array(
    TIMEZONE_DETECT_MODE_DEFAULT => t("Set timezone on login only if it is not yet set (recommended)"),
    TIMEZONE_DETECT_MODE_LOGIN => t("Update timezone on every login"),
    TIMEZONE_DETECT_MODE_ALWAYS => t("Update timezone whenever it changes"),
  );
  $form['timezone_detect_mode'] = array(
    '#type' => 'radios',
    '#title' => t("When to set a user's timezone automatically"),
    '#default_value' => variable_get('timezone_detect_mode', TIMEZONE_DETECT_MODE_DEFAULT),
    '#options' => $options,
    '#description' => t("By default, Timezone Detect sets a user's timezone on login if it is not yet set. Alternatively, you can have the module update the user's timezone automatically on every login or whenever their timezone changes; be aware that these later settings will overwrite any manual timezone selection that the user may make."),
  );
  $form['timezone_detect_success_watchdog'] = array(
    '#type' => 'checkbox',
    '#title' => t("Log successful events in watchdog"),
    '#default_value' => variable_get('timezone_detect_success_watchdog', TRUE),
    '#description' => t("By default, Timezone Detect will create a log entry every time it sets a users timezone. This can create unnecessary noise in your log files so you are likely to want to disable this once you are confident the feature works."),
  );
  return system_settings_form($form);
}