diff --git a/core/modules/system/lib/Drupal/system/TimezoneController.php b/core/modules/system/lib/Drupal/system/TimezoneController.php new file mode 100644 index 0000000..d25558e +++ b/core/modules/system/lib/Drupal/system/TimezoneController.php @@ -0,0 +1,27 @@ + 'core/includes', 'file' => 'form.inc', ); - $items['system/timezone'] = array( - 'title' => 'Time zone', - 'page callback' => 'system_timezone', - 'access callback' => TRUE, - 'type' => MENU_CALLBACK, - 'file' => 'system.admin.inc', - ); $items['admin'] = array( 'title' => 'Administration', 'access arguments' => array('access administration pages'), @@ -3580,17 +3573,6 @@ function system_time_zones($blank = NULL) { } /** - * Menu callback; Retrieve a JSON object containing a suggested time zone name. - */ -function system_timezone($abbreviation = '', $offset = -1, $is_daylight_saving_time = NULL) { - // An abbreviation of "0" passed in the callback arguments should be - // interpreted as the empty string. - $abbreviation = $abbreviation ? $abbreviation : ''; - $timezone = timezone_name_from_abbr($abbreviation, intval($offset), $is_daylight_saving_time); - return new JsonResponse($timezone); -} - -/** * Returns HTML for the Powered by Drupal text. * * @ingroup themeable diff --git a/core/modules/system/system.routing.yml b/core/modules/system/system.routing.yml index b285844..fdc32e9 100644 --- a/core/modules/system/system.routing.yml +++ b/core/modules/system/system.routing.yml @@ -73,3 +73,10 @@ system_site_maintenance_mode: _form: 'Drupal\system\Form\SiteMaintenanceModeForm' requirements: _permission: 'administer site configuration' + +system_timezone: + pattern: '/system/timezone' + defaults: + _controller: '\Drupal\system\TimezoneController::getTimezone' + requirements: + _access: 'TRUE'