Ticket #31354: 31354.patch
File 31354.patch, 7.7 KB (added by , 10 years ago) |
---|
-
network/settings.php
# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /Applications/MAMP/htdocs/corewp/wp_411/trunk/wp-admin # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process.
39 39 $( '#submit', this ).after( '<span class="spinner language-install-spinner" />' ); 40 40 } 41 41 }); 42 jQuery('.option-label-chk').find('input[type="number"],select').attr({disabled:'disabled'}); 43 jQuery('.option-label-chk input[type="checkbox"]').click(function(){ 44 if(jQuery(this).is(':checked')){ 45 jQuery(this).parents('.option-label-chk').find('input[type="number"],select').removeAttr('disabled'); 46 }else{ 47 jQuery(this).parents('.option-label-chk').find('input[type="number"],select').attr({disabled:'disabled'}); 48 } 42 49 }); 50 jQuery('.option-label-chk input[type="checkbox"]:checked').parents('.option-label-chk').find('input[type="number"],select').removeAttr('disabled'); 51 }); 43 52 </script> 44 53 <?php 45 54 } … … 293 302 <tr> 294 303 <th scope="row"><?php _e( 'Site upload space' ) ?></th> 295 304 <td> 296 <label><input type="checkbox" id="upload_space_check_disabled" name="upload_space_check_disabled" value="0"<?php checked( get_site_option( 'upload_space_check_disabled' ), 0 ) ?>/> <?php printf( __( 'Limit total size of files uploaded to %s MB' ), '</label><label><input name="blog_upload_space" type="number" min="0" style="width: 100px" id="blog_upload_space" value="' . esc_attr( get_site_option('blog_upload_space', 100) ) . '" />' ); ?></label><br /> 305 <div class="option-label-chk"> 306 <label><input type="checkbox" id="upload_space_check_disabled" name="upload_space_check_disabled" value="0"<?php checked( get_site_option( 'upload_space_check_disabled' ), 0 ) ?>/> <?php printf( __( 'Limit total size of files uploaded to %s MB' ), '</label><label><input name="blog_upload_space" type="number" min="0" style="width: 100px" id="blog_upload_space" value="' . esc_attr( get_site_option('blog_upload_space', 100) ) . '" />' ); ?></label></div> 297 307 </td> 298 308 </tr> 299 309 -
options-discussion.php
14 14 $title = __('Discussion Settings'); 15 15 $parent_file = 'options-general.php'; 16 16 17 /**18 * Display JavaScript on the page.19 *20 * @since 4.2.021 */22 17 function options_discussion_add_js() { 23 18 ?> 24 <script> 25 (function($){ 26 var parent = $( '#show_avatars' ), 27 children = $( '.avatar-settings' ); 28 parent.change(function(){ 29 children.toggleClass( 'hide-if-js', ! this.checked ); 19 <script type="text/javascript"> 20 //<![CDATA[ 21 jQuery(document).ready(function(){ 22 jQuery('.option-label-chk').find('input[type="number"],select').attr({disabled:'disabled'}); 23 jQuery('.option-label-chk input[type="checkbox"]').click(function(){ 24 if(jQuery(this).is(':checked')){ 25 jQuery(this).parents('.option-label-chk').find('input[type="number"],select').removeAttr('disabled'); 26 }else{ 27 jQuery(this).parents('.option-label-chk').find('input[type="number"],select').attr({disabled:'disabled'}); 28 } 30 29 }); 31 })(jQuery); 30 jQuery('.option-label-chk input[type="checkbox"]:checked').parents('.option-label-chk').find('input[type="number"],select').removeAttr('disabled'); 31 }); 32 //]]> 32 33 </script> 33 34 <?php 34 35 } 35 add_action( 'admin_print_footer_scripts', 'options_discussion_add_js');36 add_action('admin_head', 'options_discussion_add_js'); 36 37 37 38 get_current_screen()->add_help_tab( array( 38 39 'id' => 'overview', … … 86 87 <?php if ( !get_option( 'users_can_register' ) && is_multisite() ) echo ' ' . __( '(Signup has been disabled. Only members of this site can comment.)' ); ?> 87 88 </label> 88 89 <br /> 89 90 <div class="option-label-chk"> 90 91 <label for="close_comments_for_old_posts"> 91 92 <input name="close_comments_for_old_posts" type="checkbox" id="close_comments_for_old_posts" value="1" <?php checked('1', get_option('close_comments_for_old_posts')); ?> /> 92 93 <?php printf( __('Automatically close comments on articles older than %s days'), '</label><label for="close_comments_days_old"><input name="close_comments_days_old" type="number" min="0" step="1" id="close_comments_days_old" value="' . esc_attr(get_option('close_comments_days_old')) . '" class="small-text" />'); ?> 93 94 </label> 94 <br /> 95 </div> 96 <div class="option-label-chk"> 95 97 <label for="thread_comments"> 96 98 <input name="thread_comments" type="checkbox" id="thread_comments" value="1" <?php checked('1', get_option('thread_comments')); ?> /> 97 99 <?php … … 115 117 printf( __('Enable threaded (nested) comments %s levels deep'), $thread_comments_depth ); 116 118 117 119 ?></label> 118 <br /> 120 </div> 121 <div class="option-label-chk"> 119 122 <label for="page_comments"> 120 123 <input name="page_comments" type="checkbox" id="page_comments" value="1" <?php checked('1', get_option('page_comments')); ?> /> 121 124 <?php … … 141 144 printf( __('Comments should be displayed with the %s comments at the top of each page'), $comment_order ); 142 145 143 146 ?></label> 147 </div> 144 148 </fieldset></td> 145 149 </tr> 146 150 <tr> … … 192 196 193 197 <p><?php _e('An avatar is an image that follows you from weblog to weblog appearing beside your name when you comment on avatar enabled sites. Here you can enable the display of avatars for people who comment on your site.'); ?></p> 194 198 195 <?php 196 // the above would be a good place to link to codex documentation on the gravatar functions, for putting it in themes. anything like that? 199 <?php // the above would be a good place to link to codex documentation on the gravatar functions, for putting it in themes. anything like that? ?> 197 200 198 $show_avatars = get_option( 'show_avatars' );199 ?>200 201 201 <table class="form-table"> 202 202 <tr> 203 203 <th scope="row"><?php _e('Avatar Display'); ?></th> 204 204 <td><fieldset><legend class="screen-reader-text"><span><?php _e('Avatar Display'); ?></span></legend> 205 205 <label for="show_avatars"> 206 <input type="checkbox" id="show_avatars" name="show_avatars" value="1" <?php checked( $show_avatars, 1 ); ?> />206 <input type="checkbox" id="show_avatars" name="show_avatars" value="1" <?php checked( get_option('show_avatars'), 1 ); ?> /> 207 207 <?php _e( 'Show Avatars' ); ?> 208 208 </label> 209 209 </fieldset></td> 210 210 </tr> 211 <tr class="avatar-settings<?php if ( ! $show_avatars ) echo ' hide-if-js'; ?>">211 <tr> 212 212 <th scope="row"><?php _e('Maximum Rating'); ?></th> 213 213 <td><fieldset><legend class="screen-reader-text"><span><?php _e('Maximum Rating'); ?></span></legend> 214 214 … … 231 231 232 232 </fieldset></td> 233 233 </tr> 234 <tr class="avatar-settings<?php if ( ! $show_avatars ) echo ' hide-if-js'; ?>">234 <tr> 235 235 <th scope="row"><?php _e('Default Avatar'); ?></th> 236 236 <td class="defaultavatarpicker"><fieldset><legend class="screen-reader-text"><span><?php _e('Default Avatar'); ?></span></legend> 237 237 … … 263 263 $default = 'mystery'; 264 264 $size = 32; 265 265 $avatar_list = ''; 266 267 // Force avatars on to display these choices268 add_filter( 'pre_option_show_avatars', '__return_true', 100 );269 270 266 foreach ( $avatar_defaults as $default_key => $default_name ) { 271 267 $selected = ($default == $default_key) ? 'checked="checked" ' : ''; 272 268 $avatar_list .= "\n\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='" . esc_attr($default_key) . "' {$selected}/> "; … … 277 273 $avatar_list .= ' ' . $default_name . '</label>'; 278 274 $avatar_list .= '<br />'; 279 275 } 280 281 remove_filter( 'pre_option_show_avatars', '__return_true', 100 );282 283 276 /** 284 277 * Filter the HTML output of the default avatar list. 285 278 *