From 40eee9fdf0932ade72adc899d084fbf9cf1cbd75 Mon Sep 17 00:00:00 2001
From: Zach Schmid <zach@schmid.me>
Date: Sun, 26 May 2013 00:14:12 -0400
Subject: [PATCH] Issue #2003802 by zschmid | dagmita: Under Configuration =>
 regional and language, merge Regional settings and date and
 time formats.

---
 .../system/lib/Drupal/system/Form/RegionalForm.php   |  2 +-
 .../Drupal/system/Tests/Common/FormatDateTest.php    |  4 ++--
 .../lib/Drupal/system/Tests/System/AdminTest.php     |  4 ++--
 .../lib/Drupal/system/Tests/System/DateTimeTest.php  | 16 ++++++++--------
 core/modules/system/system.module                    | 20 ++++++++++++--------
 5 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/core/modules/system/lib/Drupal/system/Form/RegionalForm.php b/core/modules/system/lib/Drupal/system/Form/RegionalForm.php
index 323a3bb..822eb5d 100644
--- a/core/modules/system/lib/Drupal/system/Form/RegionalForm.php
+++ b/core/modules/system/lib/Drupal/system/Form/RegionalForm.php
@@ -34,7 +34,7 @@ public function buildForm(array $form, array &$form_state) {
 
     $form['locale'] = array(
       '#type' => 'details',
-      '#title' => t('Locale'),
+      '#title' => t('Default Country &amp; Language'),
     );
 
     $form['locale']['site_default_country'] = array(
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php
index 118a059..d4b8d81 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php
@@ -68,7 +68,7 @@ function testAdminDefinedFormatDate() {
       'date_format_name' => 'Example Style',
       'date_format_pattern' => 'j M y',
     );
-    $this->drupalPost('admin/config/regional/date-time/formats/add', $edit, t('Add format'));
+    $this->drupalPost('admin/config/regional/settings/date-time/formats/add', $edit, t('Add format'));
 
     // Add a second date format with a different case than the first.
     $edit = array(
@@ -76,7 +76,7 @@ function testAdminDefinedFormatDate() {
       'date_format_name' => 'Example Style Uppercase',
       'date_format_pattern' => 'j M Y',
     );
-    $this->drupalPost('admin/config/regional/date-time/formats/add', $edit, t('Add format'));
+    $this->drupalPost('admin/config/regional/settings/date-time/formats/add', $edit, t('Add format'));
     $this->assertText(t('Custom date format updated.'));
 
     $timestamp = strtotime('2007-03-10T00:00:00+00:00');
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php b/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php
index 1c42936..09e576c 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php
@@ -80,7 +80,7 @@ function testAdminPages() {
       $this->drupalGet($page);
       $this->assertLinkByHref('admin/config');
       $this->assertLinkByHref('admin/config/regional/settings');
-      $this->assertLinkByHref('admin/config/regional/date-time');
+      $this->assertLinkByHref('admin/config/regional/settings/date-time');
       $this->assertLinkByHref('admin/config/regional/language');
       $this->assertNoLinkByHref('admin/config/regional/language/detection/session');
       $this->assertNoLinkByHref('admin/config/regional/language/detection/url');
@@ -97,7 +97,7 @@ function testAdminPages() {
       $this->drupalGet($page);
       $this->assertLinkByHref('admin/config');
       $this->assertNoLinkByHref('admin/config/regional/settings');
-      $this->assertNoLinkByHref('admin/config/regional/date-time');
+      $this->assertNoLinkByHref('admin/config/regional/settings/date-time');
       $this->assertNoLinkByHref('admin/config/regional/language');
       $this->assertNoLinkByHref('admin/config/regional/language/detection/session');
       $this->assertNoLinkByHref('admin/config/regional/language/detection/url');
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php
index c867581..616405c 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php
@@ -78,7 +78,7 @@ function testTimeZoneHandling() {
    */
   function testDateFormatConfiguration() {
     // Confirm 'no custom date formats available' message appears.
-    $this->drupalGet('admin/config/regional/date-time/formats');
+    $this->drupalGet('admin/config/regional/settings/date-time/formats');
 
     // Add custom date format.
     $this->clickLink(t('Add format'));
@@ -90,26 +90,26 @@ function testDateFormatConfiguration() {
       'date_format_name' => $name,
       'date_format_pattern' => $date_format,
     );
-    $this->drupalPost('admin/config/regional/date-time/formats/add', $edit, t('Add format'));
-    $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time/formats', array('absolute' => TRUE)), 'Correct page redirection.');
+    $this->drupalPost('admin/config/regional/settings/date-time/formats/add', $edit, t('Add format'));
+    $this->assertEqual($this->getUrl(), url('admin/config/regional/settings/date-time/formats', array('absolute' => TRUE)), 'Correct page redirection.');
     $this->assertText(t('Custom date format updated.'), 'Date format added confirmation message appears.');
     $this->assertText($date_format_id, 'Custom date format appears in the date format list.');
     $this->assertText(t('Delete'), 'Delete link for custom date format appears.');
 
     // Edit custom date format.
-    $this->drupalGet('admin/config/regional/date-time/formats');
+    $this->drupalGet('admin/config/regional/settings/date-time/formats');
     $this->clickLink(t('Edit'));
     $edit = array(
       'date_format_pattern' => 'Y m',
     );
     $this->drupalPost($this->getUrl(), $edit, t('Save format'));
-    $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time/formats', array('absolute' => TRUE)), 'Correct page redirection.');
+    $this->assertEqual($this->getUrl(), url('admin/config/regional/settings/date-time/formats', array('absolute' => TRUE)), 'Correct page redirection.');
     $this->assertText(t('Custom date format updated.'), 'Custom date format successfully updated.');
 
     // Delete custom date format.
     $this->clickLink(t('Delete'));
-    $this->drupalPost('admin/config/regional/date-time/formats/' . $date_format_id . '/delete', array(), t('Remove'));
-    $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time/formats', array('absolute' => TRUE)), 'Correct page redirection.');
+    $this->drupalPost('admin/config/regional/settings/date-time/formats/' . $date_format_id . '/delete', array(), t('Remove'));
+    $this->assertEqual($this->getUrl(), url('admin/config/regional/settings/date-time/formats', array('absolute' => TRUE)), 'Correct page redirection.');
     $this->assertText(t('Removed date format ' . $name), 'Custom date format removed.');
 
     // Make sure the date does not exist in config.
@@ -152,7 +152,7 @@ function testDateFormatXSS() {
     );
     system_date_format_save('xss_short', $date_format_info);
 
-    $this->drupalGet('admin/config/regional/date-time');
+    $this->drupalGet('admin/config/regional/settings/date-time');
     $this->assertNoRaw("<script>alert('XSS');</script>", 'The date format was properly sanitized');
   }
 }
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index b6d37f0..552f770 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -859,20 +859,24 @@ function system_menu() {
     'file' => 'system.admin.inc',
   );
   $items['admin/config/regional/settings'] = array(
-    'title' => 'Regional settings',
-    'description' => "Settings for the site's default time zone and country.",
+    'title' => 'Regional, date and time setting',
+    'description' => "Set default time zones, default country and configure display format strings for date and time.",
     'route_name' => 'system_regional_settings',
     'weight' => -20,
   );
-  $items['admin/config/regional/date-time'] = array(
+    $items['admin/config/regional/settings/list'] = array(
+    'title' => 'Settings',
+    'type' => MENU_DEFAULT_LOCAL_TASK,
+  );
+  $items['admin/config/regional/settings/date-time'] = array(
     'title' => 'Date and time formats',
     'description' => 'Configure display format strings for date and time.',
     'page callback' => 'system_date_time_formats',
     'access arguments' => array('administer site configuration'),
-    'weight' => -9,
+    'type' => MENU_LOCAL_TASK,
     'file' => 'system.admin.inc',
   );
-  $items['admin/config/regional/date-time/formats/add'] = array(
+  $items['admin/config/regional/settings/date-time/formats/add'] = array(
     'title' => 'Add format',
     'description' => 'Allow users to add additional date formats.',
     'type' => MENU_LOCAL_ACTION,
@@ -882,7 +886,7 @@ function system_menu() {
     'weight' => -10,
     'file' => 'system.admin.inc',
   );
-  $items['admin/config/regional/date-time/formats/%system_date_format/edit'] = array(
+  $items['admin/config/regional/settings/date-time/formats/%system_date_format/edit'] = array(
     'title' => 'Edit date format',
     'description' => 'Allow users to edit a configured date format.',
     'page callback' => 'drupal_get_form',
@@ -890,12 +894,12 @@ function system_menu() {
     'access arguments' => array('administer site configuration'),
     'file' => 'system.admin.inc',
   );
-  $items['admin/config/regional/date-time/formats/%system_date_format/delete'] = array(
+  $items['admin/config/regional/settings/date-time/formats/%system_date_format/delete'] = array(
     'title' => 'Delete date format',
     'description' => 'Allow users to delete a configured date format.',
     'route_name' => 'date_format_delete',
   );
-  $items['admin/config/regional/date-time/formats/lookup'] = array(
+  $items['admin/config/regional/settings/date-time/formats/lookup'] = array(
     'title' => 'Date and time lookup',
     'page callback' => 'system_date_time_lookup',
     'access arguments' => array('administer site configuration'),
-- 
1.7.11.1

