Make WordPress Core

Changeset 13606


Ignore:
Timestamp:
03/06/2010 09:49:11 AM (16 years ago)
Author:
dd32
Message:

Code standards cleanup for wp-admin/options-general.php

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-general.php

    r13605 r13606  
    164164    $tzstring = '';
    165165
    166 if (empty($tzstring)) { // Create a UTC+- zone if no timezone string exists
     166if ( empty($tzstring) ) { // Create a UTC+- zone if no timezone string exists
    167167    $check_zone_info = false;
    168168    if ( 0 == $current_offset )
     
    183183
    184184    <span id="utc-time"><?php printf(__('<abbr title="Coordinated Universal Time">UTC</abbr> time is <code>%s</code>'), date_i18n($timezone_format, false, 'gmt')); ?></span>
    185 <?php if (get_option('timezone_string')) : ?>
     185<?php if ( get_option('timezone_string') ) : ?>
    186186    <span id="local-time"><?php printf(__('Local time is <code>%1$s</code>'), date_i18n($timezone_format)); ?></span>
    187187<?php endif; ?>
     
    192192<span>
    193193    <?php
    194     $now = localtime(time(),true);
    195     if ($now['tm_isdst']) _e('This timezone is currently in daylight saving time.');
    196     else _e('This timezone is currently in standard time.');
     194    $now = localtime(time(), true);
     195    if ( $now['tm_isdst'] )
     196        _e('This timezone is currently in daylight saving time.');
     197    else
     198        _e('This timezone is currently in standard time.');
    197199    ?>
    198200    <br />
    199201    <?php
    200     if (function_exists('timezone_transitions_get')) {
    201         $dateTimeZoneSelected = new DateTimeZone($tzstring);
    202         foreach (timezone_transitions_get($dateTimeZoneSelected) as $tr) {
    203             if ($tr['ts'] > time()) {
     202    if ( function_exists('timezone_transitions_get') ) {
     203        $found = false;
     204        $date_time_zone_selected = new DateTimeZone($tzstring);
     205        foreach ( timezone_transitions_get($date_time_zone_selected) as $tr) {
     206            if ( $tr['ts'] > time() ) {
    204207                $found = true;
    205208                break;
     
    207210        }
    208211
    209         if ( isset($found) && $found === true ) {
     212        if ( $found ) {
    210213            echo ' ';
    211214            $message = $tr['isdst'] ?
    212215                __('Daylight saving time begins on: <code>%s</code>.') :
    213216                __('Standard time begins  on: <code>%s</code>.');
    214             printf( $message, date_i18n(get_option('date_format').' '.get_option('time_format'), $tr['ts'] ) );
     217            printf( $message, date_i18n(get_option('date_format') . ' ' . get_option('time_format'), $tr['ts'] ) );
    215218        } else {
    216219            _e('This timezone does not observe daylight saving time.');
     
    237240    ) );
    238241
    239     $custom = TRUE;
     242    $custom = true;
    240243
    241244    foreach ( $date_formats as $format ) {
     
    243246        if ( get_option('date_format') === $format ) { // checked() uses "==" rather than "==="
    244247            echo " checked='checked'";
    245             $custom = FALSE;
     248            $custom = false;
    246249        }
    247250        echo ' /> ' . date_i18n( $format ) . "</label><br />\n";
     
    269272    ) );
    270273
    271     $custom = TRUE;
     274    $custom = true;
    272275
    273276    foreach ( $time_formats as $format ) {
     
    275278        if ( get_option('time_format') === $format ) { // checked() uses "==" rather than "==="
    276279            echo " checked='checked'";
    277             $custom = FALSE;
     280            $custom = false;
    278281        }
    279282        echo ' /> ' . date_i18n( $format ) . "</label><br />\n";
Note: See TracChangeset for help on using the changeset viewer.