Ticket #4861: 4861.diff
File 4861.diff, 2.0 KB (added by , 12 years ago) |
---|
-
bp-groups/bp-groups-admin.php
92 92 93 93 check_admin_referer( 'bp-groups-delete' ); 94 94 95 $group_id = (int) $_GET['gid']; 95 $groups = explode( ',', $_GET['gid'] ); 96 $result = false; 97 98 // check for bulk deletion 99 if( is_array( $groups ) && count( $groups ) > 1 ) { 100 101 foreach( $groups as $group_id ) { 102 $result += intval( groups_delete_group( $group_id ) ); 103 } 104 105 } else { 106 $group_id = intval( $groups[0] ); 107 108 $result = intval( groups_delete_group( $group_id ) ); 109 } 96 110 97 $result = groups_delete_group( $group_id );98 99 111 if ( $result ) { 100 $redirect_to = add_query_arg( 'deleted', '1', $redirect_to );112 $redirect_to = add_query_arg( 'deleted', $result, $redirect_to ); 101 113 } else { 102 114 $redirect_to = add_query_arg( array( 103 115 'deleted' => 0, … … 409 421 function bp_groups_admin() { 410 422 // Decide whether to load the index or edit screen 411 423 $doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : ''; 424 425 /* 426 at line 80 $_REQUEST['action'] = $_REQUEST['action2']; doesn't allow $doaction to be set as delete 427 in case of bulk actions 428 this is a quick and dirty fix :( 429 */ 430 if( $doaction == -1 && $_GET['action'] == 'delete' && ! empty( $_GET['gid'] ) ) 431 $doaction = $_GET['action']; 432 /* end of dirty fix */ 412 433 413 434 // Display the single group edit screen 414 435 if ( 'edit' == $doaction && ! empty( $_GET['gid'] ) ) { … … 613 634 $deleted = ! empty( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0; 614 635 615 636 if ( $deleted > 0 ) { 616 $messages[] = sprintf( _n( '%s activity has been permanently deleted.', '%s activity items have been permanently deleted.', $deleted, 'buddypress' ), number_format_i18n( $deleted ) );637 $messages[] = sprintf( _n( '%s group has been permanently deleted.', '%s groups have been permanently deleted.', $deleted, 'buddypress' ), number_format_i18n( $deleted ) ); 617 638 } 618 639 } 619 640