You are here

function timeago_form_user_profile_form_alter in Timeago 7.2

Implements hook_form_FORM_ID_alter().

See also

system_form_user_profile_form_alter()

File

./timeago.module, line 398
Adds support for the Timeago jQuery library.

Code

function timeago_form_user_profile_form_alter(&$form, &$form_state) {
  if ($form['#user_category'] == 'account') {
    if (variable_get('configurable_timezones', 1)) {
      $date_format_long = variable_get('date_format_long', 'l, F j, Y - H:i');
      $date_format = NULL;
      if ($date_format_long == TIMEAGO_FORMAT_LONG_US) {
        $date_format = 'l, F j, Y - g:ia';
      }
      elseif ($date_format_long = TIMEAGO_FORMAT_LONG) {
        $date_format = 'l, j F Y - H:i';
      }
      if ($date_format) {
        $form['timezone']['timezone']['#options'] = timeago_time_zones($form['#user']->uid != $GLOBALS['user']->uid, $date_format);
      }
    }
    return $form;
  }
}