Changeset 7146
- Timestamp:
- 06/04/2013 03:04:33 AM (12 years ago)
- Location:
- trunk/bp-groups
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/admin/js/admin.js
r6606 r7146 12 12 } 13 13 14 var id = 'undefined' !== typeof group_ members ? '&group_members=' + group_members: '';14 var id = 'undefined' !== typeof group_id ? '&group_id=' + group_id : ''; 15 15 $(document).ready( function() { 16 16 /* Initialize autocomplete */ -
trunk/bp-groups/bp-groups-admin.php
r7088 r7146 719 719 'mod' => array(), 720 720 'member' => array(), 721 'banned' => array() 721 'banned' => array(), 722 722 ); 723 723 724 if ( bp_group_has_members( array( 725 'group_id' => $item->id, 726 'exclude_admins_mods' => false, 727 'exclude_banned' => false 728 ) ) ) { 729 // Get a list of admins and mods, to reduce lookups 730 // We'll rekey them by user_id for convenience 731 $admins = $mods = array(); 732 733 foreach ( (array) groups_get_group_admins( $item->id ) as $admin_obj ) { 734 $admins[ $admin_obj->user_id ] = $admin_obj; 735 } 736 737 foreach ( (array) groups_get_group_mods( $item->id ) as $admin_obj ) { 738 $mods[ $admin_obj->user_id ] = $admin_obj; 739 } 740 741 while ( bp_group_members() ) { 742 bp_group_the_member(); 743 if ( bp_get_group_member_is_banned() ) { 744 $members['banned'][] = $members_template->member; 745 } else if ( isset( $admins[ bp_get_group_member_id() ] ) ) { 746 $members['admin'][] = $members_template->member; 747 } else if ( isset( $mods[ bp_get_group_member_id() ] ) ) { 748 $members['mod'][] = $members_template->member; 749 } else { 750 $members['member'][] = $members_template->member; 751 } 752 753 $member_ids[] = bp_get_group_member_id(); 754 } 724 foreach ( $members as $type => &$member_type_users ) { 725 $member_type_query = new BP_Group_Member_Query( array( 726 'group_id' => $item->id, 727 'group_role' => array( $type ), 728 'type' => 'alphabetical', 729 'per_page' => 10, 730 ) ); 731 732 $member_type_users = $member_type_query->results; 755 733 } 756 734 757 735 // Echo out the javascript variable 758 $member_ids = ! empty( $member_ids ) ? implode( ',', $member_ids ) : ''; 759 echo '<script type="text/javascript">var group_members = "' . $member_ids . '";</script>'; 736 echo '<script type="text/javascript">var group_id = "' . $item->id . '";</script>'; 760 737 761 738 // Loop through each member type … … 787 764 788 765 <?php foreach ( $type_users as $type_user ) : ?> 789 790 766 <tr> 791 <th scope="row" class="uid-column"><?php echo esc_html( $type_user-> user_id); ?></th>767 <th scope="row" class="uid-column"><?php echo esc_html( $type_user->ID ); ?></th> 792 768 793 769 <td class="uname-column"> 794 <a style="float: left;" href="<?php echo bp_core_get_user_domain( $type_user-> user_id); ?>"><?php echo bp_core_fetch_avatar( array(795 'item_id' => $type_user-> user_id,770 <a style="float: left;" href="<?php echo bp_core_get_user_domain( $type_user->ID ); ?>"><?php echo bp_core_fetch_avatar( array( 771 'item_id' => $type_user->ID, 796 772 'width' => '32', 797 773 'height' => '32' 798 774 ) ); ?></a> 799 775 800 <span style="margin: 8px; float: left;"><?php echo bp_core_get_userlink( $type_user-> user_id) ?></span>776 <span style="margin: 8px; float: left;"><?php echo bp_core_get_userlink( $type_user->ID ) ?></span> 801 777 </td> 802 778 803 779 <td class="urole-column"> 804 <select class="bp-groups-role" id="bp-groups-role-<?php echo esc_attr( $type_user-> user_id ); ?>" name="bp-groups-role[<?php echo esc_attr( $type_user->user_id); ?>]">780 <select class="bp-groups-role" id="bp-groups-role-<?php echo esc_attr( $type_user->ID ); ?>" name="bp-groups-role[<?php echo esc_attr( $type_user->ID ); ?>]"> 805 781 <option value="admin" <?php selected( 'admin', $member_type ) ?>><?php _e( 'Administrator', 'buddypress' ) ?></option> 806 782 <option value="mod" <?php selected( 'mod', $member_type ) ?>><?php _e( 'Moderator', 'buddypress' ) ?></option> … … 817 793 * @todo remove this, and do database detection on save 818 794 */ ?> 819 <input type="hidden" name="bp-groups-existing-role[<?php echo esc_attr( $type_user-> user_id); ?>]" value="<?php echo esc_attr( $member_type ); ?>" />795 <input type="hidden" name="bp-groups-existing-role[<?php echo esc_attr( $type_user->ID ); ?>]" value="<?php echo esc_attr( $member_type ); ?>" /> 820 796 </td> 821 797 </tr> … … 824 800 <tr> 825 801 <td colspan="3"> 826 <?php do_action( 'bp_groups_admin_manage_member_row', $type_user-> user_id, $item ); ?>802 <?php do_action( 'bp_groups_admin_manage_member_row', $type_user->ID, $item ); ?> 827 803 </td> 828 804 </tr> … … 905 881 906 882 // Exclude current group members 907 $group_members = isset( $_REQUEST['group_members'] ) ? wp_parse_id_list( $_REQUEST['group_members'] ) : array(); 908 $terms = isset( $_REQUEST['term'] ) ? $_REQUEST['term'] : ''; 909 $users = get_users( array( 883 $group_id = isset( $_GET['group_id'] ) ? wp_parse_id_list( $_GET['group_id'] ) : array(); 884 $group_member_query = new BP_Group_Member_Query( array( 885 'group_id' => $group_id, 886 'per_page' => 0, // show all 887 'group_type' => array( 'member', 'mod', 'admin', ), 888 'populate_extras' => false, 889 'count_total' => false, 890 ) ); 891 892 $group_members = ! empty( $group_member_query->results ) ? wp_list_pluck( $group_member_query->results, 'ID' ) : array(); 893 894 $terms = isset( $_GET['term'] ) ? $_GET['term'] : ''; 895 $users = get_users( array( 910 896 'blog_id' => false, 911 897 'search' => '*' . $terms . '*',
Note: See TracChangeset
for help on using the changeset viewer.