Changeset 9036
- Timestamp:
- 09/30/2008 10:30:56 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/colors-classic.css
r9028 r9036 533 533 } 534 534 535 #tagchecklist span a { 535 #tagchecklist span a, 536 #bulk-titles div a { 536 537 background: url(../images/xit.gif) no-repeat; 537 538 } 538 539 539 #tagchecklist span a:hover { 540 #tagchecklist span a:hover, 541 #bulk-titles div a:hover { 540 542 background: url(../images/xit.gif) no-repeat -10px 0; 541 543 } -
trunk/wp-admin/css/colors-fresh.css
r9028 r9036 517 517 } 518 518 519 #tagchecklist span a { 519 #tagchecklist span a, 520 #bulk-titles div a { 520 521 background: url(../images/xit.gif) no-repeat; 521 522 } 522 523 523 #tagchecklist span a:hover { 524 #tagchecklist span a:hover, 525 #bulk-titles div a:hover { 524 526 background: url(../images/xit.gif) no-repeat -10px 0; 525 527 } -
trunk/wp-admin/edit-pages.php
r9032 r9036 37 37 if ( isset($_GET['post']) ) { 38 38 check_admin_referer('bulk-pages'); 39 $_GET['post_status'] = $_GET['_status']; 40 41 if ( -1 == $_GET['post_author'] ) 42 unset($_GET['post_author']); 39 40 if ( -1 == $_GET['_status'] ) { 41 $_GET['post_status'] = null; 42 unset($_GET['_status'], $_GET['post_status']); 43 } else { 44 $_GET['post_status'] = $_GET['_status']; 45 } 43 46 44 47 $done = bulk_edit_posts($_GET); … … 51 54 $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); 52 55 if ( isset($done) ) { 53 $done['upd'] = count( $done['upd'] ); 54 $done['skip'] = count( $done['skip'] ); 56 $done['updated'] = count( $done['updated'] ); 57 $done['skipped'] = count( $done['skipped'] ); 58 $done['locked'] = count( $done['locked'] ); 55 59 $sendback = add_query_arg( $done, $sendback ); 56 unset($done);57 60 } 58 61 wp_redirect($sendback); … … 112 115 <div class="wrap"> 113 116 114 <?php if ( isset($_GET[' upd']) || isset($_GET['skip']) ) { ?>117 <?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) ) { ?> 115 118 <div id="message" class="updated fade"><p> 116 <?php if ( (int) $_GET['upd'] ) { 117 printf( __ngettext( '%d page updated.', '%d pages updated.', $_GET['upd'] ), number_format_i18n( $_GET['upd'] ) ); 118 unset($_GET['upd']); 119 } 120 121 if ( (int) $_GET['skip'] ) { 122 printf( __ngettext( ' %d page not updated. Somebody is editing it.', ' %d pages not updated. Somebody is editing them.', $_GET['skip'] ), number_format_i18n( $_GET['skip'] ) ); 123 unset($_GET['skip']); 119 <?php if ( (int) $_GET['updated'] ) { 120 printf( __ngettext( '%d page updated.', '%d pages updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) ); 121 unset($_GET['updated']); 122 } 123 124 if ( (int) $_GET['skipped'] ) { 125 printf( __ngettext( ' %d page not updated, invalid parent page specified.', ' %d pages not updated, invalid parent page specified.', $_GET['skipped'] ), number_format_i18n( $_GET['skipped'] ) ); 126 unset($_GET['skipped']); 127 } 128 129 if ( (int) $_GET['locked'] ) { 130 printf( __ngettext( ' %d page not updated, somebody is editing it.', ' %d pages not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['skipped'] ) ); 131 unset($_GET['locked']); 124 132 } ?> 125 133 </p></div> -
trunk/wp-admin/edit.php
r9032 r9036 37 37 if ( isset($_GET['post']) ) { 38 38 check_admin_referer('bulk-posts'); 39 $_GET['post_status'] = $_GET['_status']; 40 41 if ( -1 == $_GET['post_author'] ) 42 unset($_GET['post_author']); 39 40 if ( -1 == $_GET['_status'] ) { 41 $_GET['post_status'] = null; 42 unset($_GET['_status'], $_GET['post_status']); 43 } else { 44 $_GET['post_status'] = $_GET['_status']; 45 } 43 46 44 47 $done = bulk_edit_posts($_GET); … … 52 55 $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); 53 56 if ( isset($done) ) { 54 $done['upd'] = count( $done['upd'] ); 55 $done['skip'] = count( $done['skip'] ); 57 $done['updated'] = count( $done['updated'] ); 58 $done['skipped'] = count( $done['skipped'] ); 59 $done['locked'] = count( $done['locked'] ); 56 60 $sendback = add_query_arg( $done, $sendback ); 57 unset($done);58 61 } 59 62 wp_redirect($sendback); … … 101 104 </div></div> 102 105 106 <div class="wrap"> 107 103 108 <?php 104 109 if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?> … … 107 112 endif; ?> 108 113 109 <?php if ( isset($_GET[' upd']) && (int) $_GET['upd']) { ?>114 <?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) ) { ?> 110 115 <div id="message" class="updated fade"><p> 111 <?php printf( __ngettext( '%d post updated.', '%d posts updated.', $_GET['upd'] ), number_format_i18n( $_GET['upd'] ) ); 112 unset($_GET['upd']); 113 114 if ( isset($_GET['skip']) && (int) $_GET['skip'] ) { 115 printf( __ngettext( ' %d post not updated. Somebody is editing it.', ' %d posts not updated. Somebody is editing them.', $_GET['skip'] ), number_format_i18n( $_GET['skip'] ) ); 116 unset($_GET['skip']); 117 } ?> 116 <?php if ( (int) $_GET['updated'] ) { 117 printf( __ngettext( '%d page updated.', '%d pages updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) ); 118 unset($_GET['updated']); 119 } 120 121 if ( (int) $_GET['skipped'] ) 122 unset($_GET['skipped']); 123 124 if ( (int) $_GET['locked'] ) { 125 printf( __ngettext( ' %d page not updated, somebody is editing it.', ' %d pages not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['skipped'] ) ); 126 unset($_GET['locked']); 127 } ?> 118 128 </p></div> 119 129 <?php } ?> 120 121 <div class="wrap">122 130 123 131 <ul class="subsubsub"> -
trunk/wp-admin/includes/post.php
r8973 r9036 178 178 } 179 179 180 // updates all bulk edited posts/pages, adding (but not removing) tags and categories. Skips pages when they would be their own parent or child. 180 181 function bulk_edit_posts( $post_data = null ) { 182 global $wpdb; 181 183 182 184 if ( empty($post_data) ) … … 193 195 $post_IDs = array_map( intval, (array) $post_data['post'] ); 194 196 197 $reset = array( 'post_author', 'post_status', 'post_password', 'post_parent', 'page_template', 'comment_status', 'ping_status', 'keep_private', 'tags_input', 'post_category' ); 198 foreach ( $reset as $field ) { 199 if ( isset($post_data[$field]) && ( '' == $post_data[$field] || -1 == $post_data[$field] ) ) 200 unset($post_data[$field]); 201 } 202 195 203 if ( isset($post_data['post_category']) ) { 196 204 if ( is_array($post_data['post_category']) && ! empty($post_data['post_category']) ) … … 201 209 202 210 if ( isset($post_data['tags_input']) ) { 203 if ( ! empty($post_data['tags_input']) ) { 204 $new_tags = preg_replace( '/\s*,\s*/', ',', rtrim($post_data['tags_input'], ' ,') ); 205 $new_tags = explode(',', $new_tags); 206 } else { 207 unset($post_data['tags_input']); 208 } 209 } 210 211 $reset = array( 'post_author', 'post_status', 'post_password', 'post_parent', 'page_template', 'comment_status', 'ping_status', 'keep_private' ); 212 foreach ( $reset as $field ) { 213 if ( isset($post_data[$field]) && '' == $post_data[$field] ) 214 unset($post_data[$field]); 215 } 216 217 $updated = $skipped = array(); 211 $new_tags = preg_replace( '/\s*,\s*/', ',', rtrim( trim($post_data['tags_input']), ' ,' ) ); 212 $new_tags = explode(',', $new_tags); 213 } 214 215 if ( isset($post_data['post_parent']) && ($parent = (int) $post_data['post_parent']) ) { 216 $pages = $wpdb->get_results("SELECT ID, post_parent FROM $wpdb->posts WHERE post_type = 'page'"); 217 $children = array(); 218 219 for ( $i = 0; $i < 50 && $parent > 0; $i++ ) { 220 $children[] = $parent; 221 222 foreach ( $pages as $page ) { 223 if ( $page->ID == $parent ) { 224 $parent = $page->post_parent; 225 break; 226 } 227 } 228 } 229 } 230 231 $updated = $skipped = $locked = array(); 218 232 foreach ( $post_IDs as $post_ID ) { 219 233 234 if ( isset($children) && in_array($post_ID, $children) ) { 235 $skipped[] = $post_ID; 236 continue; 237 } 238 220 239 if ( wp_check_post_lock( $post_ID ) ) { 221 $ skipped[] = $post_ID;240 $locked[] = $post_ID; 222 241 continue; 223 242 } … … 237 256 } 238 257 239 return array( 'upd ' => $updated, 'skip' => $skipped );258 return array( 'updated' => $updated, 'skipped' => $skipped, 'locked' => $locked ); 240 259 } 241 260 -
trunk/wp-admin/includes/template.php
r9028 r9036 694 694 <select name="post_parent"> 695 695 <?php if ( $bulk ) { ?> 696 <option value=" "><?php _e('- No Change -'); ?></option>696 <option value="-1"><?php _e('- No Change -'); ?></option> 697 697 <?php } ?> 698 698 <option value="0"><?php _e('Main Page (no parent)'); ?></option> … … 707 707 <select name="page_template"> 708 708 <?php if ( $bulk ) { ?> 709 <option value=" "><?php _e('- No Change -'); ?></option>709 <option value="-1"><?php _e('- No Change -'); ?></option> 710 710 <?php } ?> 711 711 <option value="default"><?php _e('Default Template'); ?></option> … … 785 785 <div class="in"> 786 786 <?php 787 $users_opt = array('include' => $authors, 'name' => 'post_author', 'class'=> 'authors' );787 $users_opt = array('include' => $authors, 'name' => 'post_author', 'class'=> 'authors', 'multi' => 1); 788 788 if ( $bulk ) $users_opt['show_option_none'] = __('- No Change -'); 789 789 wp_dropdown_users( $users_opt ); ?> … … 810 810 <select name="_status"> 811 811 <?php if ( $bulk ) { ?> 812 <option value=" "><?php _e('- No Change -'); ?></option>812 <option value="-1"><?php _e('- No Change -'); ?></option> 813 813 <?php if ( $can_publish ) { ?> 814 814 <option value="private"><?php _e('Private') ?></option> -
trunk/wp-admin/js/inline-edit.js
r8981 r9036 99 99 var id = $(this).val(); 100 100 c = c == '' ? ' class="alternate"' : ''; 101 te += '<div'+c+' >'+$('#inline_'+id+' .post_title').text()+'</div>';101 te += '<div'+c+' id="ttle'+id+'"><a id="_'+id+'" class="ntdelbutton">X</a>'+$('#inline_'+id+' .post_title').text()+'</div>'; 102 102 } 103 103 }); 104 104 105 105 $('#bulk-titles').html(te); 106 $('#bulk-titles a').click(function() { 107 var id = $(this).attr('id').substr(1), r = inlineEdit.type+'-'+id; 108 109 $('table.widefat input[value="'+id+'"]').attr('checked', ''); 110 $('#ttle'+id).remove(); 111 }); 106 112 107 113 // enable autocomplete for tags -
trunk/wp-admin/wp-admin.css
r9021 r9036 2311 2311 } 2312 2312 2313 #bulk-titles div a { 2314 cursor: pointer; 2315 display: block; 2316 float: left; 2317 height: 10px; 2318 margin: 3px 3px 0 -2px; 2319 overflow: hidden; 2320 position: relative; 2321 text-indent: -9999px; 2322 width: 10px; 2323 } 2324 2325 2313 2326 /* Media library */ 2314 2327 #wpbody-content #media-items .describe { -
trunk/wp-includes/script-loader.php
r9019 r9036 245 245 $scripts->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'jquery' ), '20080625' ); 246 246 247 $scripts->add( 'inline-edit', '/wp-admin/js/inline-edit.js', array( 'jquery', 'jquery-form', 'suggest' ), '200809 26' );247 $scripts->add( 'inline-edit', '/wp-admin/js/inline-edit.js', array( 'jquery', 'jquery-form', 'suggest' ), '20080930' ); 248 248 $scripts->localize( 'inline-edit', 'inlineEditL10n', array( 249 249 'edit' => __('Double-click to edit') … … 305 305 $rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'press-this-ie' ); 306 306 307 $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '200809 26' );307 $styles->add( 'wp-admin', '/wp-admin/wp-admin.css', array(), '20080930' ); 308 308 $styles->add_data( 'wp-admin', 'rtl', '/wp-admin/rtl.css' ); 309 309 -
trunk/wp-includes/user.php
r9009 r9036 427 427 * <li>include - User IDs to include.</li> 428 428 * <li>exclude - User IDs to exclude.</li> 429 * <li>multi - Default is 'false'. Whether to skip the ID attribute on the 'select' element.</li> 429 430 * <li>show - Default is 'display_name'. User table column to display.</li> 430 431 * <li>echo - Default is '1'. Whether to display or retrieve content.</li> … … 445 446 'show_option_all' => '', 'show_option_none' => '', 446 447 'orderby' => 'display_name', 'order' => 'ASC', 447 'include' => '', 'exclude' => '', 448 'include' => '', 'exclude' => '', 'multi' => 0, 448 449 'show' => 'display_name', 'echo' => 1, 449 450 'selected' => 0, 'name' => 'user', 'class' => '' … … 480 481 $output = ''; 481 482 if ( !empty($users) ) { 482 $output = "<select name='$name' id='$name' class='$class'>\n"; 483 $id = $multi ? "" : "id='$name'"; 484 485 $output = "<select name='$name' $id class='$class'>\n"; 483 486 484 487 if ( $show_option_all )
Note: See TracChangeset
for help on using the changeset viewer.