function date_timezone_user_form_after_build in Date 6.2
Hide the original form.
We have to do this in after_build in case the Event module is enabled since the Event module will do its form_alter() after the Date module.
1 string reference to 'date_timezone_user_form_after_build'
- date_timezone_form_alter in date_timezone/
date_timezone.module - Implementation of hook_form_alter().
File
- date_timezone/
date_timezone.module, line 138 - 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_user_form_after_build($form) {
// Set the value, and make sure it's a legal value.
$value = $form['timezone']['timezone']['#default_value'];
$options = $form['timezone']['timezone']['#options'];
if (!array_key_exists($value, $options)) {
//$value = array_pop($options);
$value = NULL;
}
$form['timezone']['timezone']['#type'] = 'hidden';
$form['timezone']['timezone']['#value'] = $value;
return $form;
}