diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index 9c7fdf3..6ce1fab 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -1963,73 +1963,6 @@ function system_regional_settings_submit($form, &$form_state) { } /** - * Form builder; Configure the site date and time settings. - * - * @ingroup forms - * @see system_settings_form() - */ -function system_date_time_settings() { - // Display any user-defined date formats. - $date_formats = system_get_date_formats(); - - $header = array( - 'machine_name' => array('data' => t('Machine name')), - 'name' => array('data' => t('Name')), - 'pattern' => array('data' => t('Date format')), - 'example' => array('data' => t('Example of use')), - ); - - $rows = array(); - foreach ($date_formats as $date_format_id => $format_info) { - $rows[] = array( - $date_format_id, - $format_info['name'], - $pattern, - format_date(REQUEST_TIME, $date_format_id), - ); - } - - $variables = array( - 'header' => $header, - 'rows' => $rows, - ); - - return theme('table', $variables); -} - -/** - * Returns HTML for the date settings form. - * - * @param $variables - * An associative array containing: - * - form: A render element representing the form. - * - * @ingroup themeable - */ -function theme_system_date_time_settings($variables) { - $form = $variables['form']; - $header = array( - t('Date type'), - t('Format'), - t('Operations'), - ); - - foreach (element_children($form['format']) as $key) { - $row = array(); - $row[] = $form['format'][$key]['#title']; - $form['format'][$key]['#title_display'] = 'invisible'; - $row[] = array('data' => drupal_render($form['format'][$key])); - $row[] = drupal_render($form['operations'][$key]); - $rows[] = $row; - } - - $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'system-date-types'))); - $output .= drupal_render_children($form); - - return $output; -} - -/** * Form builder; Configure the site's maintenance status. * * @ingroup forms @@ -2583,7 +2516,7 @@ function system_date_delete_format_form_submit($form, &$form_state) { */ function system_date_time_formats() { $header = array( - array('data' => t('Machine Name'), 'field' => 'machine_name'), + array('data' => t('Machine name'), 'field' => 'machine_name'), array('data' => t('Name'), 'field' => 'name'), array('data' => t('Pattern'), 'field' => 'pattern'), array('data' => t('Operations')) @@ -2643,25 +2576,6 @@ function system_configure_date_formats_form($form, &$form_state, $date_format_id $format_info = config('system.date')->get('formats.' . $date_format_id); $patterns = $format_info['pattern']; $pattern = class_exists('IntlDateFormatter') ? $patterns[DrupalDateTime::INTL] : $patterns[DrupalDateTime::PHP]; - if (empty($date_format_id)) { - $form['date_format_id'] = array( - '#type' => 'machine_name', - '#title' => t('Machine-readable name'), - '#description' => t('A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores.'), - '#machine_name' => array( - 'exists' => 'system_date_format_exists', - 'source' => array('machine_name'), - ), - ); - $now = ''; - } - else { - $form['date_format_id'] = array( - '#type' => 'value', - '#value' => $date_format_id, - ); - $now = t('Displayed as %date', array('%date' => format_date(REQUEST_TIME, $date_format_id))); - } $form['date_format_name'] = array( '#type' => 'textfield', @@ -2671,6 +2585,20 @@ function system_configure_date_formats_form($form, &$form_state, $date_format_id '#default_value' => empty($format_info['name']) ? '' : $format_info['name'] ); + $now = !empty($date_format_id) ? t('Displayed as %date', array('%date' => format_date(REQUEST_TIME, $date_format_id))) : ''; + + $form['date_format_id'] = array( + '#type' => 'machine_name', + '#title' => t('Machine-readable name'), + '#description' => t('A unique machine-readable name. Can only contain lowercase letters, numbers, and underscores.'), + '#disabled' => !empty($date_format_id), + '#default_value' => $date_format_id, + '#machine_name' => array( + 'exists' => 'system_date_format_exists', + 'source' => array('date_format_name'), + ), + ); + if (class_exists('intlDateFormatter')) { $description = t('A user-defined date format. See the PHP manual for available options.', array('@url' => 'http://userguide.icu-project.org/formatparse/datetime')); } diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index c41172e..d561cee 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -1838,10 +1838,6 @@ function hook_theme($existing, $type, $theme, $path) { 'render element' => 'requirements', 'file' => 'system.admin.inc', ), - 'system_date_time_settings' => array( - 'render element' => 'form', - 'file' => 'system.admin.inc', - ), ); } diff --git a/core/modules/system/system.module b/core/modules/system/system.module index ce5e289..d4f9eb7 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -188,10 +188,6 @@ function system_theme() { 'system_compact_link' => array( 'variables' => array(), ), - 'system_date_time_settings' => array( - 'render element' => 'form', - 'file' => 'system.admin.inc', - ), 'system_date_format_localize_form' => array( 'render element' => 'form', ),