function date_timezone_menu in Date 5.2
Same name and namespace in other branches
- 6.2 date_timezone/date_timezone.module \date_timezone_menu()
- 6 date_timezone/date_timezone.module \date_timezone_menu()
Make sure a timezone has been selected.
File
- date_timezone/
date_timezone.module, line 14 - 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_menu($may_cache) {
global $user;
$items = array();
if (!$may_cache) {
$tz_name = variable_get('date_default_timezone_name', NULL);
if (!empty($user->uid) && $_GET['q'] != 'admin/settings/date-time' && empty($tz_name)) {
drupal_set_message(t('The Date Timezone module requires you to !link.', array(
'!link' => l(t('set the site timezone name'), 'admin/settings/date-time'),
)), 'error');
}
$items[] = array(
'path' => 'user/timezone',
'title' => 'User timezone',
'callback' => 'user_timezone',
'access' => TRUE,
'type' => MENU_CALLBACK,
);
}
return $items;
}