Make WordPress Core

Ticket #12581: 12581.diff

File 12581.diff, 10.5 KB (added by nacin, 14 years ago)
  • includes/file.php

     
    914914<table class="form-table">
    915915<tr valign="top">
    916916<th scope="row"><label for="hostname"><?php _e('Hostname') ?></label></th>
    917 <td><input name="hostname" type="text" id="hostname" value="<?php echo esc_attr($hostname); if ( !empty($port) ) echo ":$port"; ?>"<?php if ( defined('FTP_HOST') ) echo ' disabled="disabled"' ?> size="40" /></td>
     917<td><input name="hostname" type="text" id="hostname" value="<?php echo esc_attr($hostname); if ( !empty($port) ) echo ":$port"; ?>"<?php disabled( defined('FTP_HOST') ); ?> size="40" /></td>
    918918</tr>
    919919
    920920<tr valign="top">
    921921<th scope="row"><label for="username"><?php _e('Username') ?></label></th>
    922 <td><input name="username" type="text" id="username" value="<?php echo esc_attr($username) ?>"<?php if ( defined('FTP_USER') ) echo ' disabled="disabled"' ?> size="40" /></td>
     922<td><input name="username" type="text" id="username" value="<?php echo esc_attr($username) ?>"<?php disabled( defined('FTP_USER') ); ?> size="40" /></td>
    923923</tr>
    924924
    925925<tr valign="top">
    926926<th scope="row"><label for="password"><?php _e('Password') ?></label></th>
    927 <td><input name="password" type="password" id="password" value="<?php if ( defined('FTP_PASS') ) echo '*****'; ?>"<?php if ( defined('FTP_PASS') ) echo ' disabled="disabled"' ?> size="40" /></td>
     927<td><input name="password" type="password" id="password" value="<?php if ( defined('FTP_PASS') ) echo '*****'; ?>"<?php disabled( defined('FTP_PASS') ); ?> size="40" /></td>
    928928</tr>
    929929
    930930<?php if ( isset($types['ssh']) ) : ?>
     
    934934<label for="public_key"><?php _e('Public Key:') ?></label ><br />
    935935<label for="private_key"><?php _e('Private Key:') ?></label>
    936936</div></th>
    937 <td><br /><input name="public_key" type="text" id="public_key" value="<?php echo esc_attr($public_key) ?>"<?php if ( defined('FTP_PUBKEY') ) echo ' disabled="disabled"' ?> size="40" /><br /><input name="private_key" type="text" id="private_key" value="<?php echo esc_attr($private_key) ?>"<?php if ( defined('FTP_PRIKEY') ) echo ' disabled="disabled"' ?> size="40" />
     937<td><br /><input name="public_key" type="text" id="public_key" value="<?php echo esc_attr($public_key) ?>"<?php disabled( defined('FTP_PUBKEY') ); ?> size="40" /><br /><input name="private_key" type="text" id="private_key" value="<?php echo esc_attr($private_key) ?>"<?php disabled( defined('FTP_PRIKEY') ); ?> size="40" />
    938938<div><?php _e('Enter the location on the server where the keys are located. If a passphrase is needed, enter that in the password field above.') ?></div></td>
    939939</tr>
    940940<?php endif; ?>
     
    943943<th scope="row"><?php _e('Connection Type') ?></th>
    944944<td>
    945945<fieldset><legend class="screen-reader-text"><span><?php _e('Connection Type') ?></span></legend>
    946 <?php
    947 
    948         $disabled = (defined('FTP_SSL') && FTP_SSL) || (defined('FTP_SSH') && FTP_SSH) ? ' disabled="disabled"' : '';
    949 
    950         foreach ( $types as $name => $text ) : ?>
     946<?php foreach ( $types as $name => $text ) : ?>
    951947        <label for="<?php echo esc_attr($name) ?>">
    952                 <input type="radio" name="connection_type" id="<?php echo esc_attr($name) ?>" value="<?php echo esc_attr($name) ?>" <?php checked($name, $connection_type); echo $disabled; ?>/>
     948                <input type="radio" name="connection_type" id="<?php echo esc_attr($name) ?>" value="<?php echo esc_attr($name) ?>"<?php checked($name, $connection_type); disabled( $disabled, (defined('FTP_SSL') && FTP_SSL) || (defined('FTP_SSH') && FTP_SSH) ); ?> />
    953949                <?php echo $text ?>
    954950        </label>
    955951        <?php endforeach; ?>
  • includes/media.php

     
    858858                                $checked = " checked='checked'";
    859859                        }
    860860
    861                         $html = "<div class='image-size-item'><input type='radio' " . ( $enabled ? '' : "disabled='disabled' " ) . "name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}'$checked />";
     861                        $html = "<div class='image-size-item'><input type='radio' " . disabled( $enabled, false, false ) . "name='attachments[$post->ID][image-size]' id='{$css_id}' value='{$size}'$checked />";
    862862
    863863                        $html .= "<label for='{$css_id}'>$label</label>";
    864864                        // only show the dimensions if that choice is available
  • includes/template.php

     
    206206                        $name = 'tax_input['.$taxonomy.']';
    207207
    208208                $class = in_array( $category->term_id, $popular_cats ) ? ' class="popular-category"' : '';
    209                 $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . (in_array( $category->term_id, $selected_cats ) ? ' checked="checked"' : "" ) . (!empty($args['disabled']) ? 'disabled="disabled"' : '') . '/> ' . esc_html( apply_filters('the_category', $category->name )) . '</label>';
     209                $output .= "\n<li id='{$taxonomy}-{$category->term_id}'$class>" . '<label class="selectit"><input value="' . $category->term_id . '" type="checkbox" name="'.$name.'[]" id="in-'.$taxonomy.'-' . $category->term_id . '"' . checked( in_array( $category->term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . esc_html( apply_filters('the_category', $category->name )) . '</label>';
    210210        }
    211211
    212212        function end_el(&$output, $category, $depth, $args) {
  • ms-sites.php

     
    165165                                                        foreach ( $options as $option ) {
    166166                                                                if ( $option->option_name == 'default_role' )
    167167                                                                        $editblog_default_role = $option->option_value;
    168                                                                 $disabled = '';
     168                                                                $disabled = false;
    169169                                                                if ( is_serialized($option->option_value) ) {
    170170                                                                        if ( is_serialized_string($option->option_value) ) {
    171171                                                                                $option->option_value = esc_html(maybe_unserialize($option->option_value), 'single');
    172172                                                                        } else {
    173173                                                                                $option->option_value = "SERIALIZED DATA";
    174                                                                                 $disabled = ' disabled="disabled"';
     174                                                                                $disabled = true;
    175175                                                                        }
    176176                                                                }
    177177                                                                if ( stristr($option->option_value, "\r") || stristr($option->option_value, "\n") || stristr($option->option_value, "\r\n") ) {
    178178                                                                ?>
    179179                                                                        <tr class="form-field">
    180180                                                                                <th scope="row"><?php echo ucwords( str_replace( "_", " ", $option->option_name ) ) ?></th>
    181                                                                                 <td><textarea rows="5" cols="40" name="option[<?php echo esc_attr($option->option_name) ?>]" id="<?php echo esc_attr($option->option_name) ?>"<?php echo $disabled ?>><?php echo esc_html( $option->option_value ) ?></textarea></td>
     181                                                                                <td><textarea rows="5" cols="40" name="option[<?php echo esc_attr($option->option_name) ?>]" id="<?php echo esc_attr($option->option_name) ?>"<?php disabled( $disabled ) ?>><?php echo esc_html( $option->option_value ) ?></textarea></td>
    182182                                                                        </tr>
    183183                                                                <?php
    184184                                                                } else {
     
    188188<?php if ( $is_main_site && in_array( $option->option_name, array( 'siteurl', 'home' ) ) ) { ?>
    189189                                                                                <td><?php echo esc_attr( $option->option_value ) ?></td>
    190190<?php } else { ?>
    191                                                                                 <td><input name="option[<?php echo esc_attr($option->option_name) ?>]" type="text" id="<?php echo esc_attr($option->option_name) ?>" value="<?php echo esc_attr( $option->option_value ) ?>" size="40" <?php echo $disabled ?> /></td>
     191                                                                                <td><input name="option[<?php echo esc_attr($option->option_name) ?>]" type="text" id="<?php echo esc_attr($option->option_name) ?>" value="<?php echo esc_attr( $option->option_value ) ?>" size="40" <?php disabled( $disabled ) ?> /></td>
    192192<?php } ?>
    193193                                                                        </tr>
    194194                                                                <?php
  • options-general.php

     
    7575<?php if ( !is_multisite() ) { ?>
    7676<tr valign="top">
    7777<th scope="row"><label for="siteurl"><?php _e('WordPress address (URL)') ?></label></th>
    78 <td><input name="siteurl" type="text" id="siteurl" value="<?php form_option('siteurl'); ?>" class="regular-text code<?php if ( defined( 'WP_SITEURL' ) ) : ?> disabled" disabled="disabled"<?php else: ?>"<?php endif; ?> /></td>
     78<td><input name="siteurl" type="text" id="siteurl" value="<?php form_option('siteurl'); ?>"<?php $disabled = disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php if ( $disabled ) echo ' disabled' ?>" /></td>
    7979</tr>
    8080<tr valign="top">
    8181<th scope="row"><label for="home"><?php _e('Blog address (URL)') ?></label></th>
    82 <td><input name="home" type="text" id="home" value="<?php form_option('home'); ?>" class="regular-text code<?php if ( defined( 'WP_HOME' ) ) : ?> disabled" disabled="disabled"<?php else: ?>"<?php endif; ?> />
     82<td><input name="home" type="text" id="home" value="<?php form_option('home'); ?>"<?php $disabled = disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php if ( $disabled ) echo ' disabled' ?>" />
    8383<span class="description"><?php _e('Enter the address here if you want your blog homepage <a href="http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory">to be different from the directory</a> you installed WordPress.'); ?></span></td>
    8484</tr>
    8585<tr valign="top">
  • options.php

     
    173173$options = $wpdb->get_results( "SELECT * FROM $wpdb->options ORDER BY option_name" );
    174174
    175175foreach ( (array) $options as $option ) :
    176         $disabled = '';
     176        $disabled = false;
    177177        if ( $option->option_name == '' )
    178178                continue;
    179179        if ( is_serialized( $option->option_value ) ) {
     
    184184                        $class = 'all-options';
    185185                } else {
    186186                        $value = 'SERIALIZED DATA';
    187                         $disabled = ' disabled="disabled"';
     187                        $disabled = true;
    188188                        $class = 'all-options disabled';
    189189                }
    190190        } else {
     
    200200        if ( strpos( $value, "\n" ) !== false )
    201201                echo "<textarea class='$class' name='$name' id='$name' cols='30' rows='5'>" . wp_htmledit_pre( $value ) . "</textarea>";
    202202        else
    203                 echo "<input class='regular-text $class' type='text' name='$name' id='$name' value='" . esc_attr( $value ) . "'$disabled />";
     203                echo "<input class='regular-text $class' type='text' name='$name' id='$name' value='" . esc_attr( $value ) . "'" . disabled( $disabled, true, false ) . " />";
    204204        echo "</td>
    205205</tr>";
    206206endforeach;