Ticket #12581: 12581.diff
File 12581.diff, 10.5 KB (added by , 14 years ago) |
---|
-
includes/file.php
914 914 <table class="form-table"> 915 915 <tr valign="top"> 916 916 <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> 918 918 </tr> 919 919 920 920 <tr valign="top"> 921 921 <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> 923 923 </tr> 924 924 925 925 <tr valign="top"> 926 926 <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> 928 928 </tr> 929 929 930 930 <?php if ( isset($types['ssh']) ) : ?> … … 934 934 <label for="public_key"><?php _e('Public Key:') ?></label ><br /> 935 935 <label for="private_key"><?php _e('Private Key:') ?></label> 936 936 </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" /> 938 938 <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> 939 939 </tr> 940 940 <?php endif; ?> … … 943 943 <th scope="row"><?php _e('Connection Type') ?></th> 944 944 <td> 945 945 <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 ) : ?> 951 947 <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) ); ?> /> 953 949 <?php echo $text ?> 954 950 </label> 955 951 <?php endforeach; ?> -
includes/media.php
858 858 $checked = " checked='checked'"; 859 859 } 860 860 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 />"; 862 862 863 863 $html .= "<label for='{$css_id}'>$label</label>"; 864 864 // only show the dimensions if that choice is available -
includes/template.php
206 206 $name = 'tax_input['.$taxonomy.']'; 207 207 208 208 $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>'; 210 210 } 211 211 212 212 function end_el(&$output, $category, $depth, $args) { -
ms-sites.php
165 165 foreach ( $options as $option ) { 166 166 if ( $option->option_name == 'default_role' ) 167 167 $editblog_default_role = $option->option_value; 168 $disabled = '';168 $disabled = false; 169 169 if ( is_serialized($option->option_value) ) { 170 170 if ( is_serialized_string($option->option_value) ) { 171 171 $option->option_value = esc_html(maybe_unserialize($option->option_value), 'single'); 172 172 } else { 173 173 $option->option_value = "SERIALIZED DATA"; 174 $disabled = ' disabled="disabled"';174 $disabled = true; 175 175 } 176 176 } 177 177 if ( stristr($option->option_value, "\r") || stristr($option->option_value, "\n") || stristr($option->option_value, "\r\n") ) { 178 178 ?> 179 179 <tr class="form-field"> 180 180 <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> 182 182 </tr> 183 183 <?php 184 184 } else { … … 188 188 <?php if ( $is_main_site && in_array( $option->option_name, array( 'siteurl', 'home' ) ) ) { ?> 189 189 <td><?php echo esc_attr( $option->option_value ) ?></td> 190 190 <?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> 192 192 <?php } ?> 193 193 </tr> 194 194 <?php -
options-general.php
75 75 <?php if ( !is_multisite() ) { ?> 76 76 <tr valign="top"> 77 77 <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> 79 79 </tr> 80 80 <tr valign="top"> 81 81 <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' ?>" /> 83 83 <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> 84 84 </tr> 85 85 <tr valign="top"> -
options.php
173 173 $options = $wpdb->get_results( "SELECT * FROM $wpdb->options ORDER BY option_name" ); 174 174 175 175 foreach ( (array) $options as $option ) : 176 $disabled = '';176 $disabled = false; 177 177 if ( $option->option_name == '' ) 178 178 continue; 179 179 if ( is_serialized( $option->option_value ) ) { … … 184 184 $class = 'all-options'; 185 185 } else { 186 186 $value = 'SERIALIZED DATA'; 187 $disabled = ' disabled="disabled"';187 $disabled = true; 188 188 $class = 'all-options disabled'; 189 189 } 190 190 } else { … … 200 200 if ( strpos( $value, "\n" ) !== false ) 201 201 echo "<textarea class='$class' name='$name' id='$name' cols='30' rows='5'>" . wp_htmledit_pre( $value ) . "</textarea>"; 202 202 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 ) . " />"; 204 204 echo "</td> 205 205 </tr>"; 206 206 endforeach;