Changeset 9029
- Timestamp:
- 09/29/2008 12:03:30 PM (16 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-comments.php
r9028 r9029 15 15 wp_enqueue_script( 'jquery-table-hotkeys' ); 16 16 17 if ( isset( $_POST['delete_all_spam'] ) ) {17 if ( isset( $_POST['delete_all_spam'] ) || isset( $_POST['delete_all_spam2'] ) ) { 18 18 check_admin_referer('bulk-spam-delete'); 19 19 -
trunk/wp-admin/js/forms.js
r8857 r9029 21 21 return true; 22 22 } ); 23 $( 'thead :checkbox ' ).click( function() {23 $( 'thead :checkbox, tfoot :checkbox' ).click( function() { 24 24 checkAll( $(this).parents( 'form:first' ) ); 25 25 } ); -
trunk/wp-admin/upload.php
r9028 r9029 9 9 /** WordPress Administration Bootstrap */ 10 10 require_once('admin.php'); 11 //add_thickbox();12 wp_enqueue_script( 'media-upload' );13 11 wp_enqueue_script( 'wp-ajax-response' ); 14 12 wp_enqueue_script( 'jquery-ui-draggable' ); … … 57 55 $attach = implode(',', $attach); 58 56 $attached = $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = %d WHERE post_type = 'attachment' AND ID IN ($attach)", $parent_id) ); 59 60 $message = sprintf( __ngettext('Added %1$s attachment to <strong>%2$s</strong>', 'Added %1$s attachments to <strong>%2$s</strong>', $attached, apply_filters( "the_title", $parent->post_title ) ) , $attached, apply_filters( "the_title", $parent->post_title ) ); 61 } 62 63 $_GET['detached'] = 1; 64 65 } elseif ( isset($_GET['action']) && isset($_GET['media']) && isset($_GET['doaction']) ) { 66 check_admin_referer('bulk-media'); 67 if ( $_GET['action'] == 'delete' ) { 68 foreach( (array) $_GET['media'] as $post_id_del ) { 69 $post_del = & get_post($post_id_del); 70 71 if ( !current_user_can('delete_post', $post_id_del) ) 72 wp_die( __('You are not allowed to delete this post.') ); 73 74 if ( $post_del->post_type == 'attachment' ) 75 if ( ! wp_delete_attachment($post_id_del) ) 76 wp_die( __('Error in deleting...') ); 77 } 78 57 } 58 59 if ( isset($attached) ) { 79 60 $location = 'upload.php'; 80 61 if ( $referer = wp_get_referer() ) { … … 82 63 $location = $referer; 83 64 } 65 66 $location = add_query_arg( array( 'detached' => 1, 'attached' => $attached ) , $location ); 67 wp_redirect($location); 68 exit; 69 } 70 71 } elseif ( isset($_GET['action']) && isset($_GET['media']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) { 72 check_admin_referer('bulk-media'); 73 $doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2']; 74 75 if ( 'delete' == $doaction ) { 76 foreach( (array) $_GET['media'] as $post_id_del ) { 77 $post_del = & get_post($post_id_del); 78 79 if ( !current_user_can('delete_post', $post_id_del) ) 80 wp_die( __('You are not allowed to delete this post.') ); 81 82 if ( $post_del->post_type == 'attachment' ) 83 if ( ! wp_delete_attachment($post_id_del) ) 84 wp_die( __('Error in deleting...') ); 85 } 86 87 $location = 'upload.php'; 88 if ( $referer = wp_get_referer() ) { 89 if ( false !== strpos($referer, 'upload.php') ) 90 $location = $referer; 91 } 84 92 85 93 $location = add_query_arg('message', 2, $location); … … 88 96 exit; 89 97 } 90 } elseif ( !empty($_GET['_wp_http_referer']) ) {91 wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));92 exit;98 } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) { 99 wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) ); 100 exit; 93 101 } 94 102 … … 155 163 $_GET['message'] = '1'; 156 164 $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']); 165 } 166 167 if ( isset($_GET['attached']) && (int) $_GET['attached'] ) { 168 $attached = (int) $_GET['attached']; 169 $message = sprintf( __ngettext('Reattached %d attachment', 'Reattached %d attachments', $attached), $attached ); 170 $_SERVER['REQUEST_URI'] = remove_query_arg(array('attached'), $_SERVER['REQUEST_URI']); 157 171 } 158 172 … … 294 308 295 309 <div class="alignleft"> 296 <select name="action" id="select-action">297 <option value=" " selected><?php _e('Actions'); ?></option>310 <select name="action" class="select-action"> 311 <option value="-1" selected="selected"><?php _e('Actions'); ?></option> 298 312 <option value="delete"><?php _e('Delete'); ?></option> 299 313 <?php if ( isset($orphans) ) { ?> … … 301 315 <?php } ?> 302 316 </select> 303 <input type="submit" id="submit"value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />317 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 304 318 <?php wp_nonce_field('bulk-media'); ?> 305 319 … … 325 339 </tr> 326 340 </thead> 341 342 <tfoot> 343 <tr> 344 <th scope="col" class="check-column"><input type="checkbox" /></th> 345 <th scope="col"></th> 346 <th scope="col"><?php echo _c('Media|media column header'); ?></th> 347 <th scope="col"><?php echo _c('Date Added|media column header'); ?></th> 348 </tr> 349 </tfoot> 327 350 328 351 <tbody id="the-list" class="list:post"> … … 384 407 </tbody> 385 408 </table> 386 <script type="text/javascript"> 387 (function($){ 388 $('#submit').click(function(e) { 389 if ( 'attach' == $('#select-action').val() ) { 390 e.preventDefault(); 391 findPosts.open(); 392 } 393 }); 394 })(jQuery); 395 </script> 409 396 410 <?php find_posts_div(); 397 411 … … 410 424 411 425 <div class="alignleft"> 412 <select name="action2" id="select-action">413 <option value=" " selected><?php _e('Actions'); ?></option>426 <select name="action2" class="select-action"> 427 <option value="-1" selected="selected"><?php _e('Actions'); ?></option> 414 428 <option value="delete"><?php _e('Delete'); ?></option> 415 429 <?php if ( isset($orphans) ) { ?> … … 417 431 <?php } ?> 418 432 </select> 419 <input type="submit" id="submit"value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />433 <input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" /> 420 434 </div> 421 435 … … 464 478 </div> 465 479 480 <script type="text/javascript"> 481 jQuery(function($) { 482 $('#doaction').click(function(e) { 483 if ( 'attach' == $('#posts-filter select[name="action"]').val() ) { 484 e.preventDefault(); 485 findPosts.open(); 486 } 487 }); 488 $('#doaction2').click(function(e) { 489 if ( 'attach' == $('#posts-filter select[name="action2"]').val() ) { 490 e.preventDefault(); 491 findPosts.open(); 492 } 493 }); 494 }); 495 </script> 466 496 <?php 467 497
Note: See TracChangeset
for help on using the changeset viewer.