You are here

function date_timezone_form_alter in Date 6.2

Same name and namespace in other branches
  1. 5.2 date_timezone/date_timezone.module \date_timezone_form_alter()
  2. 6 date_timezone/date_timezone.module \date_timezone_form_alter()

Implementation of hook_form_alter().

Override system handling of user and site timezone selection.

File

date_timezone/date_timezone.module, line 30
This module will make the alter the user and site timezone forms to select a timezone name instead of a timezone offset.

Code

function date_timezone_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'system_date_time_settings') {
    date_timezone_site_form($form);
    if (!isset($form['#after_build'])) {
      $form['#after_build'] = array();
    }
    $form['#after_build'][] = 'date_timezone_site_form_after_build';
  }
  elseif ($form_id == 'user_profile_form' && variable_get('configurable_timezones', 1) && isset($form['timezone'])) {
    date_timezone_user_form($form);
    if (!isset($form['#after_build'])) {
      $form['#after_build'] = array();
    }
    $form['#after_build'][] = 'date_timezone_user_form_after_build';
  }
}