Ticket #6005: no_js_bulk_delete_messages.diff
File no_js_bulk_delete_messages.diff, 8.2 KB (added by , 10 years ago) |
---|
-
src/bp-messages/bp-messages-actions.php
102 102 return false; 103 103 } 104 104 105 $thread_ids = $_POST['thread_ids']; 105 if ( isset( $_POST['thread_ids'] ) ) { 106 $thread_ids = wp_parse_id_list( $_POST['thread_ids'] ); 107 } elseif ( isset( $_POST['message_ids'] ) ) { 108 $thread_ids = wp_parse_id_list( $_POST['message_ids'] ); 109 } 106 110 107 if ( !$thread_ids || !messages_check_thread_access( $thread_ids ) ) { 111 $nonce = !empty( $_POST['messages_delete_thread'] ) ? $_POST['messages_delete_thread'] : ''; 112 113 if ( empty( $thread_ids ) || ! wp_verify_nonce( $nonce, 'messages_delete_thread' ) ) { 108 114 bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ) ); 115 return false; 109 116 } else { 110 if ( !check_admin_referer( 'messages_delete_thread' ) ) { 111 return false; 117 foreach ( $thread_ids as $thread_id ) { 118 if ( ! messages_check_thread_access( $thread_id ) ) { 119 bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ) ); 120 return false; 121 } 122 else { 123 messages_delete_thread( $thread_id ); 124 } 112 125 } 126 bp_core_add_message( __('Messages deleted.', 'buddypress') ); 113 127 114 if ( !messages_delete_thread( $thread_ids ) ) {115 bp_core_add_message( __('There was an error deleting messages.', 'buddypress'), 'error' );116 } else {117 bp_core_add_message( __('Messages deleted.', 'buddypress') );118 }119 120 128 bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ) ); 121 129 } 122 130 } -
src/bp-messages/bp-messages-template.php
856 856 function bp_messages_options() { 857 857 ?> 858 858 859 <?php _e( 'Select:', 'buddypress' ) ?> 860 859 <label for="message-type-select"> 860 <?php _e( 'Select:', 'buddypress' ) ?> 861 </label> 861 862 <select name="message-type-select" id="message-type-select"> 862 863 <option value=""></option> 863 864 <option value="read"><?php _ex('Read', 'Message dropdown filter', 'buddypress') ?></option> … … 874 875 875 876 <a href="#" id="delete_<?php echo bp_current_action(); ?>_messages"><?php _e( 'Delete Selected', 'buddypress' ); ?></a> 876 877 878 <noscript> 879 <input type="submit" id="messages-bulk-delete" class="button action" value="<?php esc_attr_e( 'Delete Selected', 'buddypress' ); ?>"> 880 </noscript> 881 877 882 <?php 878 883 } 879 884 -
src/bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php
18 18 19 19 <?php do_action( 'bp_before_member_messages_threads' ); ?> 20 20 21 <table id="message-threads" class="messages-notices"> 22 <?php while ( bp_message_threads() ) : bp_message_thread(); ?> 21 <form action="<?php echo bp_loggedin_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ?>/bulk-delete/" method="post" id="messages-bulk-management"> 23 22 24 <tr id="m-<?php bp_message_thread_id(); ?>" class="<?php bp_message_css_class(); ?><?php if ( bp_message_thread_has_unread() ) : ?> unread<?php else: ?> read<?php endif; ?>"> 25 <td width="1%" class="thread-count"> 26 <span class="unread-count"><?php bp_message_thread_unread_count(); ?></span> 27 </td> 28 <td width="1%" class="thread-avatar"><?php bp_message_thread_avatar(); ?></td> 23 <table id="message-threads" class="messages-notices"> 24 <?php while ( bp_message_threads() ) : bp_message_thread(); ?> 29 25 30 <?php if ( 'sentbox' != bp_current_action() ) : ?> 31 <td width="30%" class="thread-from"> 32 <?php _e( 'From:', 'buddypress' ); ?> <?php bp_message_thread_from(); ?><br /> 33 <span class="activity"><?php bp_message_thread_last_post_date(); ?></span> 26 <tr id="m-<?php bp_message_thread_id(); ?>" class="<?php bp_message_css_class(); ?><?php if ( bp_message_thread_has_unread() ) : ?> unread<?php else: ?> read<?php endif; ?>"> 27 <td width="1%" class="thread-count"> 28 <input type="checkbox" name="message_ids[]" value="<?php bp_message_thread_id(); ?>" /> 34 29 </td> 35 <?php else: ?> 36 <td width="30%" class="thread-from"> 37 <?php _e( 'To:', 'buddypress' ); ?> <?php bp_message_thread_to(); ?><br /> 38 <span class="activity"><?php bp_message_thread_last_post_date(); ?></span> 30 31 <td width="1%" class="thread-count"> 32 <span class="unread-count"><?php bp_message_thread_unread_count(); ?></span> 39 33 </td> 40 <?php endif; ?>34 <td width="1%" class="thread-avatar"><?php bp_message_thread_avatar(); ?></td> 41 35 42 <td width="50%" class="thread-info"> 43 <p><a href="<?php bp_message_thread_view_link(); ?>" title="<?php esc_attr_e( "View Message", "buddypress" ); ?>"><?php bp_message_thread_subject(); ?></a></p> 44 <p class="thread-excerpt"><?php bp_message_thread_excerpt(); ?></p> 45 </td> 36 <?php if ( 'sentbox' != bp_current_action() ) : ?> 37 <td width="30%" class="thread-from"> 38 <?php _e( 'From:', 'buddypress' ); ?> <?php bp_message_thread_from(); ?><br /> 39 <span class="activity"><?php bp_message_thread_last_post_date(); ?></span> 40 </td> 41 <?php else: ?> 42 <td width="30%" class="thread-from"> 43 <?php _e( 'To:', 'buddypress' ); ?> <?php bp_message_thread_to(); ?><br /> 44 <span class="activity"><?php bp_message_thread_last_post_date(); ?></span> 45 </td> 46 <?php endif; ?> 46 47 47 <?php do_action( 'bp_messages_inbox_list_item' ); ?> 48 <td width="50%" class="thread-info"> 49 <p><a href="<?php bp_message_thread_view_link(); ?>" title="<?php esc_attr_e( "View Message", "buddypress" ); ?>"><?php bp_message_thread_subject(); ?></a></p> 50 <p class="thread-excerpt"><?php bp_message_thread_excerpt(); ?></p> 51 </td> 48 52 49 <td width="13%" class="thread-options"> 50 <input type="checkbox" name="message_ids[]" value="<?php bp_message_thread_id(); ?>" /> 51 <a class="button confirm" href="<?php bp_message_thread_delete_link(); ?>" title="<?php esc_attr_e( "Delete Conversation", "buddypress" ); ?>"><?php _e( 'Delete', 'buddypress' ); ?></a> 52 </td> 53 </tr> 53 <?php do_action( 'bp_messages_inbox_list_item' ); ?> 54 54 55 <?php endwhile; ?> 56 </table><!-- #message-threads --> 55 <td width="13%" class="thread-options"> 56 <a class="button confirm" href="<?php bp_message_thread_delete_link(); ?>" title="<?php esc_attr_e( "Delete Conversation", "buddypress" ); ?>"><?php _e( 'Delete', 'buddypress' ); ?></a> 57 </td> 58 </tr> 57 59 58 <div class="messages-options-nav"> 59 <?php bp_messages_options(); ?> 60 </div><!-- .messages-options-nav --> 60 <?php endwhile; ?> 61 </table><!-- #message-threads --> 61 62 63 <div class="messages-options-nav"> 64 <?php bp_messages_options(); ?> 65 </div><!-- .messages-options-nav --> 66 <?php wp_nonce_field( 'messages_delete_thread', 'messages_delete_thread' ); ?> 67 </form> 68 62 69 <?php do_action( 'bp_after_member_messages_threads' ); ?> 63 70 64 71 <?php do_action( 'bp_after_member_messages_options' ); ?> -
src/bp-templates/bp-legacy/css/buddypress.css
740 740 body.no-js #buddypress #notifications-bulk-management #select-all-notifications { 741 741 display: none; 742 742 } 743 body.no-js #buddypress label[for="message-type-select"] { 744 display: none; 745 } 746 body.no-js #buddypress #message-type-select { 747 display: none; 748 } 749 body.no-js #buddypress #delete_inbox_messages, 750 body.no-js #buddypress #delete_sentbox_messages { 751 display: none; 752 } 753 #buddypress #notifications-bulk-management { 754 clear: left; 755 } 756 body.no-js #buddypress #notifications-bulk-management #select-all-notifications { 757 display: none; 758 } 743 759 #buddypress .standard-form input:focus, 744 760 #buddypress .standard-form textarea:focus, 745 761 #buddypress .standard-form select:focus {