X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/d3b1ea255664edd2deef17f900a655613d20820d..refs/tags/wordpress-4.5:/wp-admin/options-general.php diff --git a/wp-admin/options-general.php b/wp-admin/options-general.php index cd4b8cdb..9091d5e3 100644 --- a/wp-admin/options-general.php +++ b/wp-admin/options-general.php @@ -7,222 +7,257 @@ */ /** WordPress Administration Bootstrap */ -require_once('./admin.php'); +require_once( dirname( __FILE__ ) . '/admin.php' ); + +/** WordPress Translation Install API */ +require_once( ABSPATH . 'wp-admin/includes/translation-install.php' ); + +if ( ! current_user_can( 'manage_options' ) ) + wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) ); $title = __('General Settings'); $parent_file = 'options-general.php'; /* translators: date and time format for exact current time, mainly about timezones, see http://php.net/date */ -$timezone_format = _x('Y-m-d G:i:s', 'timezone date format'); +$timezone_format = _x('Y-m-d H:i:s', 'timezone date format'); -/** - * Display JavaScript on the page. - * - * @package WordPress - * @subpackage General_Settings_Panel - */ -function add_js() { -?> - -' . __('The fields on this screen determine some of the basics of your site setup.') . '

' . + '

' . __('Most themes display the site title at the top of every page, in the title bar of the browser, and as the identifying name for syndicated feeds. The tagline is also displayed by many themes.') . '

'; + +if ( ! is_multisite() ) { + $options_help .= '

' . __('The WordPress URL and the Site URL can be the same (example.com) or different; for example, having the WordPress core files (example.com/wordpress) in a subdirectory instead of the root directory.') . '

' . + '

' . __('If you want site visitors to be able to register themselves, as opposed to by the site administrator, check the membership box. A default user role can be set for all new users, whether self-registered or registered by the site admin.') . '

'; } -add_filter('admin_head', 'add_js'); -include('./admin-header.php'); +$options_help .= '

' . __( 'You can set the language, and the translation files will be automatically downloaded and installed (available if your filesystem is writable).' ) . '

' . + '

' . __( 'UTC means Coordinated Universal Time.' ) . '

' . + '

' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '

'; + +get_current_screen()->add_help_tab( array( + 'id' => 'overview', + 'title' => __('Overview'), + 'content' => $options_help, +) ); + +get_current_screen()->set_help_sidebar( + '

' . __('For more information:') . '

' . + '

' . __('Documentation on General Settings') . '

' . + '

' . __('Support Forums') . '

' +); + +include( ABSPATH . 'wp-admin/admin-header.php' ); ?>
- -

+

-
+ - - + + - + - + - - - + + + + - - - + + + + - - - + + + - + - + + + + - + + += 0) ? '+' : '') . $offnum; + +$check_zone_info = true; + +// Remove old Etc mappings. Fallback to gmt_offset. +if ( false !== strpos($tzstring,'Etc/GMT') ) + $tzstring = ''; + +if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists + $check_zone_info = false; + if ( 0 == $current_offset ) + $tzstring = 'UTC+0'; + elseif ($current_offset < 0) + $tzstring = 'UTC' . $current_offset; + else + $tzstring = 'UTC+' . $current_offset; } + ?> - @@ -232,27 +267,35 @@ if (empty($tzstring)) { // set the Etc zone if no timezone string exists @@ -261,6 +304,11 @@ if (empty($tzstring)) { // set the Etc zone if no timezone string exists + + + + + + +
- +

" />
class="regular-text code" />
" /> -to be different from the directory you installed WordPress.'); ?>
class="regular-text code" /> + +

want your site home page to be different from your WordPress installation directory.' ); ?>

-
+

+

The new address will not become active until confirmed.' ) ?>

-
- - -UTC time is %s'), date_i18n( $time_format, false, 'gmt')); ?> - - %2$s'), $current_offset_name, date_i18n($time_format)); ?> +$new_admin_email = get_option( 'new_admin_email' ); +if ( $new_admin_email && $new_admin_email != get_option('admin_email') ) : ?> +
+

' . esc_html( $new_admin_email ) . '' + ); + printf( + ' %2$s', + esc_url( admin_url( 'options.php?dismiss=new_admin_email' ) ), + __( 'Cancel' ) + ); +?>

+
-
-
- - UTC time is %s'), date_i18n($timezone_format, false, 'gmt')); ?> - - %1$s'), date_i18n($timezone_format)); ?> +

+ +

+ ' . __( 'UTC' ) . '', + '' . date_i18n( $timezone_format, false, 'gmt' ) . '' + ); + ?> + + ' . date_i18n( $timezone_format ) . '' + ); + ?> -
- -
+

+ + +

-
time()) { - $found = true; + $allowed_zones = timezone_identifiers_list(); + + if ( in_array( $tzstring, $allowed_zones) ) { + $found = false; + $date_time_zone_selected = new DateTimeZone($tzstring); + $tz_offset = timezone_offset_get($date_time_zone_selected, date_create()); + $right_now = time(); + foreach ( timezone_transitions_get($date_time_zone_selected) as $tr) { + if ( $tr['ts'] > $right_now ) { + $found = true; break; } } - if ( isset($found) && $found === true ) { + if ( $found ) { echo ' '; $message = $tr['isdst'] ? - __('Daylight savings time begins on: %s.') : - __('Standard time begins on: %s.'); - $tz = new DateTimeZone($tzstring); - $d = new DateTime( "@{$tr['ts']}" ); - $d->setTimezone($tz); - printf( $message, date_i18n(get_option('date_format').' '.get_option('time_format'), $d->format('U') ) ); + /* translators: %s: date and time */ + __( 'Daylight saving time begins on: %s.') : + /* translators: %s: date and time */ + __( 'Standard time begins on: %s.' ); + // Add the difference between the current offset and the new offset to ts to get the correct transition time from date_i18n(). + printf( $message, + '' . date_i18n( + __( 'F j, Y' ) . ' ' . __( 'g:i a' ), + $tr['ts'] + ( $tz_offset - $tr['offset'] ) + ) . '' + ); } else { - _e('This timezone does not observe daylight savings time.'); + _e( 'This timezone does not observe daylight saving time.' ); } } + // Set back to UTC. + date_default_timezone_set('UTC'); ?>
+

' . date_i18n( $format ) . "
\n"; + echo ' /> ' . date_i18n( $format ) . '' . esc_html( $format ) . "
\n"; } - echo ' ' . date_i18n( get_option('date_format') ) . "\n"; - - echo "\t

" . __('Documentation on date formatting. Click “Save Changes” to update sample output.') . "

\n"; + echo '/> ' . __( 'Custom:' ) . ' ' . __( 'enter a custom date format in the following field' ) . '' . + '' . + '' . + '' . __( 'example:' ) . ' ' . date_i18n( get_option( 'date_format' ) ) . '' . + "\n"; ?>
' . date_i18n( $format ) . "
\n"; + echo ' /> ' . date_i18n( $format ) . '' . esc_html( $format ) . "
\n"; } - echo ' ' . date_i18n( get_option('time_format') ) . "\n"; + echo '/> ' . __( 'Custom:' ) . ' ' . __( 'enter a custom time format in the following field' ) . '' . + '' . + '' . + '' . __( 'example:' ) . ' ' . date_i18n( get_option( 'time_format' ) ) . '' . + "\n"; + + echo "\t

" . __('Documentation on date and time formatting.') . "

\n"; ?>
+ 'WPLANG', + 'id' => 'WPLANG', + 'selected' => $locale, + 'languages' => $languages, + 'translations' => $translations, + 'show_available_translations' => ( ! is_multisite() || is_super_admin() ) && wp_can_install_language_pack(), + ) ); + + // Add note about deprecated WPLANG constant. + if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && $locale !== WPLANG ) { + if ( is_super_admin() ) { + ?> +

+ WPLANG', 'wp-config.php' ); ?> +

+ +
-

- -

+
- +