-
diff --git src/bp-core/admin/bp-core-admin-optouts.php src/bp-core/admin/bp-core-admin-optouts.php
index d47cf79de..95d789a08 100644
|
|
function bp_core_get_optouts_notice() { |
174 | 174 | ); |
175 | 175 | |
176 | 176 | if ( ! empty( $_REQUEST['deleted'] ) ) { |
| 177 | $deleted = absint( $_REQUEST['deleted'] ); |
177 | 178 | $notice['message'] .= sprintf( |
178 | | /* translators: %s: number of deleted optouts */ |
179 | | _nx( '%s opt-out successfully deleted!', '%s opt-outs successfully deleted!', |
180 | | absint( $_REQUEST['deleted'] ), |
181 | | 'nonmembers opt-out deleted', |
182 | | 'buddypress' |
| 179 | _nx( |
| 180 | /* translators: %s: number of deleted optouts */ |
| 181 | '%s opt-out successfully deleted!', '%s opt-outs successfully deleted!', |
| 182 | $deleted, |
| 183 | 'nonmembers opt-out deleted', |
| 184 | 'buddypress' |
183 | 185 | ), |
184 | 186 | number_format_i18n( absint( $_REQUEST['deleted'] ) ) |
185 | 187 | ); |
186 | 188 | } |
187 | 189 | |
188 | 190 | if ( ! empty( $_REQUEST['notdeleted'] ) ) { |
| 191 | $notdeleted = absint( $_REQUEST['notdeleted'] ); |
189 | 192 | $notice['message'] .= sprintf( |
190 | | /* translators: %s: number of optouts that failed to be deleted */ |
191 | | _nx( '%s opt-out was not deleted.', '%s opt-outs were not deleted.', |
192 | | absint( $_REQUEST['notdeleted'] ), |
193 | | 'nonmembers opt-out not deleted', |
194 | | 'buddypress' |
| 193 | _nx( |
| 194 | /* translators: %s: number of optouts that failed to be deleted */ |
| 195 | '%s opt-out was not deleted.', '%s opt-outs were not deleted.', |
| 196 | $notdeleted, |
| 197 | 'nonmembers opt-out not deleted', |
| 198 | 'buddypress' |
195 | 199 | ), |
196 | | number_format_i18n( absint( $_REQUEST['notdeleted'] ) ) |
| 200 | number_format_i18n( $notdeleted ) |
197 | 201 | ); |
198 | 202 | |
199 | 203 | if ( empty( $_REQUEST['deleted'] ) ) { |
-
diff --git src/bp-core/admin/css/common-rtl.css src/bp-core/admin/css/common-rtl.css
index d460dc8d2..1bbd8508a 100644
|
|
body.tools-php .bp-tools dd { |
317 | 317 | margin: 0; |
318 | 318 | } |
319 | 319 | |
| 320 | body.tools_page_bp-members-invitations .nav-tab-wrapper, |
| 321 | body.tools_page_bp-optouts .nav-tab-wrapper { |
| 322 | margin-bottom: 1em; |
| 323 | } |
| 324 | |
320 | 325 | /* |
321 | 326 | * 2.4 Tooltips |
322 | 327 | */ |
-
diff --git src/bp-core/admin/css/common.css src/bp-core/admin/css/common.css
index 0272626bb..d2730f9a9 100644
|
|
body.tools-php .bp-tools dd { |
317 | 317 | margin: 0; |
318 | 318 | } |
319 | 319 | |
| 320 | body.tools_page_bp-members-invitations .nav-tab-wrapper, |
| 321 | body.tools_page_bp-optouts .nav-tab-wrapper { |
| 322 | margin-bottom: 1em; |
| 323 | } |
| 324 | |
320 | 325 | /* |
321 | 326 | * 2.4 Tooltips |
322 | 327 | */ |
-
diff --git src/bp-core/bp-core-functions.php src/bp-core/bp-core-functions.php
index 854a1982d..9cdb33493 100644
|
|
function bp_email_unsubscribe_handler() { |
4113 | 4113 | $redirect_to = home_url(); |
4114 | 4114 | |
4115 | 4115 | $result_msg = $emails[ $raw_email_type ]['unsubscribe']['message']; |
4116 | | $unsub_msg = __( 'You have been unsubscribed.' ); |
| 4116 | $unsub_msg = __( 'You have been unsubscribed.', 'buddypress' ); |
4117 | 4117 | // This is an unsubscribe request from a current member. |
4118 | 4118 | } else { |
4119 | 4119 | if ( bp_is_active( 'settings' ) ) { |
-
diff --git src/bp-members/bp-members-activity.php src/bp-members/bp-members-activity.php
index c905ff79c..a110cd6e7 100644
|
|
add_action( 'bp_register_activity_actions', 'bp_members_register_activity_action |
58 | 58 | function bp_members_format_activity_action_new_member( $action, $activity ) { |
59 | 59 | $userlink = bp_core_get_userlink( $activity->user_id ); |
60 | 60 | $inviter_userlink = false; |
61 | | if ( $invite_id = bp_get_user_meta( $activity->user_id, 'accepted_members_invitation', true ) ) { |
62 | | $invite = new BP_Invitation( (int) $invite_id ); |
| 61 | $invite_id = bp_get_user_meta( $activity->user_id, 'accepted_members_invitation', true ); |
| 62 | |
| 63 | if ( $invite_id ) { |
| 64 | $invite = new BP_Invitation( (int) $invite_id ); |
| 65 | |
63 | 66 | if ( $invite->inviter_id ) { |
64 | 67 | $inviter_userlink = bp_core_get_userlink( $invite->inviter_id ); |
65 | 68 | } |
66 | 69 | } |
67 | 70 | |
68 | 71 | if ( $inviter_userlink ) { |
69 | | $action = sprintf( |
| 72 | $action = sprintf( |
70 | 73 | /* translators: 1: new user link. 2: inviter user link. */ |
71 | 74 | esc_html__( '%1$s accepted an invitation from %2$s and became a registered member', 'buddypress' ), |
72 | 75 | $userlink, |
… |
… |
function bp_members_format_activity_action_new_member( $action, $activity ) { |
85 | 88 | /** |
86 | 89 | * Filters the formatted 'new member' activity actions. |
87 | 90 | * |
88 | | * @since 2.2.0 |
| 91 | * @since 8.0.0 |
89 | 92 | * |
90 | | * @param string $action Static activity action. |
91 | | * @param object $activity Activity object. |
| 93 | * @param string $action Static activity action. |
| 94 | * @param object $activity Activity object. |
| 95 | * @param int $invite_id The ID of the invite. |
92 | 96 | */ |
93 | | return apply_filters( 'bp_members_format_activity_action_new_member', $action, $activity ); |
| 97 | return apply_filters( 'bp_members_format_activity_action_new_member', $action, $activity, $invite_id ); |
94 | 98 | } |
95 | 99 | |
96 | 100 | /** |
-
diff --git src/bp-members/bp-members-adminbar.php src/bp-members/bp-members-adminbar.php
index f9b45ad38..282be654c 100644
|
|
function bp_members_admin_bar_my_account_menu() { |
23 | 23 | global $wp_admin_bar; |
24 | 24 | |
25 | 25 | // Bail if this is an ajax request. |
26 | | if ( defined( 'DOING_AJAX' ) ) |
| 26 | if ( wp_doing_ajax() ) { |
27 | 27 | return; |
| 28 | } |
28 | 29 | |
29 | 30 | // Logged in user. |
30 | 31 | if ( is_user_logged_in() ) { |
… |
… |
function bp_members_admin_bar_add_invitations_menu() { |
188 | 189 | global $wp_admin_bar; |
189 | 190 | |
190 | 191 | // Bail if this is an ajax request. |
191 | | if ( defined( 'DOING_AJAX' ) ) { |
| 192 | if ( wp_doing_ajax() ) { |
192 | 193 | return; |
193 | 194 | } |
194 | 195 | |
-
diff --git src/bp-members/bp-members-filters.php src/bp-members/bp-members-filters.php
index 38f3433e6..e6a234b58 100644
|
|
add_filter( 'edit_profile_url', 'bp_members_edit_profile_url', 10, 3 ); |
141 | 141 | * |
142 | 142 | * @return bool |
143 | 143 | */ |
144 | | function bp_members_user_can_filter( $retval, $user_id, $capability, $site_id, $args ) { |
| 144 | function bp_members_user_can_filter( $retval, $user_id, $capability, $site_id, $args = array() ) { |
145 | 145 | |
146 | 146 | switch ( $capability ) { |
147 | 147 | case 'bp_members_manage_membership_requests': |
148 | 148 | $retval = bp_user_can( $user_id, 'bp_moderate' ); |
149 | 149 | break; |
| 150 | |
150 | 151 | case 'bp_members_send_invitation': |
151 | 152 | // @todo Add restrictions? |
152 | 153 | if ( bp_get_members_invitations_allowed() ) { |
153 | 154 | $retval = true; |
154 | 155 | } |
155 | 156 | break; |
| 157 | |
156 | 158 | case 'bp_members_receive_invitation': |
157 | 159 | if ( bp_get_members_invitations_allowed() ) { |
158 | 160 | $retval = true; |
… |
… |
function bp_members_user_can_filter( $retval, $user_id, $capability, $site_id, $ |
160 | 162 | if ( empty( $args['invitee_email'] ) || false !== get_user_by( 'email', $args['invitee_email'] ) ) { |
161 | 163 | $retval = false; |
162 | 164 | } |
163 | | // @TODO: The invited user must not have opted out from receiving invitations. |
| 165 | // @TODO: The invited user must not have opted out from receiving invitations. |
164 | 166 | } |
165 | | |
166 | 167 | break; |
167 | 168 | } |
168 | 169 | |
169 | 170 | return $retval; |
170 | | |
171 | 171 | } |
172 | 172 | add_filter( 'bp_user_can', 'bp_members_user_can_filter', 10, 5 ); |
173 | 173 | |
-
diff --git src/bp-members/bp-members-template.php src/bp-members/bp-members-template.php
index 117f6fcb6..b7f9c9afb 100644
|
|
function bp_members_invitations_pagination_count() { |
3056 | 3056 | /** |
3057 | 3057 | * Filters the pagination count for the current network invitation loop. |
3058 | 3058 | * |
3059 | | * @since 1.9.0 |
| 3059 | * @since 8.0.0 |
3060 | 3060 | * |
3061 | 3061 | * @param string $pag HTML for the pagination count. |
3062 | 3062 | */ |
… |
… |
function bp_the_members_invitation_action_links( $args = '' ) { |
3203 | 3203 | $retval = $r['before'] . implode( $r['sep'], $r['links'] ) . $r['after']; |
3204 | 3204 | |
3205 | 3205 | /** |
3206 | | * Filters the action links for the current notification. |
| 3206 | * Filters the action links for the current invitation. |
3207 | 3207 | * |
3208 | | * @since 1.9.0 |
3209 | | * @since 2.6.0 Added the `$r` parameter. |
| 3208 | * @since 8.0.0 |
3210 | 3209 | * |
3211 | | * @param string $retval HTML links for actions to take on single notifications. |
| 3210 | * @param string $retval HTML links for actions to take on single invitation. |
3212 | 3211 | * @param array $r Array of parsed arguments. |
3213 | 3212 | */ |
3214 | 3213 | return apply_filters( 'bp_get_the_members_invitation_action_links', $retval, $r ); |
… |
… |
function bp_the_members_invitations_resend_link( $user_id = 0 ) { |
3227 | 3226 | /** |
3228 | 3227 | * Return the resend link for the current notification. |
3229 | 3228 | * |
3230 | | * @since 78.0.0 |
| 3229 | * @since 8.0.0 |
3231 | 3230 | * |
3232 | 3231 | * @param int $user_id The user ID. |
3233 | 3232 | * @return string |
… |
… |
function bp_the_members_invitations_delete_link( $user_id = 0 ) { |
3334 | 3333 | $message = __( 'Cancel', 'buddypress' ); |
3335 | 3334 | } |
3336 | 3335 | |
3337 | | $retval = sprintf( '<a href="%1$s" class="delete secondary confirm bp-tooltip">%2$s</a>', esc_url( bp_get_the_members_invitations_delete_url( $user_id ) ), $message ); |
| 3336 | $retval = sprintf( |
| 3337 | '<a href="%1$s" class="delete secondary confirm bp-tooltip">%2$s</a>', |
| 3338 | esc_url( bp_get_the_members_invitations_delete_url( $user_id ) ), |
| 3339 | esc_html( $message ) |
| 3340 | ); |
3338 | 3341 | |
3339 | 3342 | /** |
3340 | 3343 | * Filters the delete link for the current invitation. |
… |
… |
function bp_members_invitations_send_invites_permalink( $user_id = 0 ) { |
3451 | 3454 | * |
3452 | 3455 | * @since 8.0.0 |
3453 | 3456 | * |
3454 | | * @return string Read notifications permalink. |
| 3457 | * @param int $user_id The user ID. |
| 3458 | * @return string The send invitations permalink. |
3455 | 3459 | */ |
3456 | 3460 | function bp_get_members_invitations_send_invites_permalink( $user_id = 0 ) { |
3457 | 3461 | if ( 0 === $user_id ) { |
… |
… |
function bp_members_invitations_send_invites_permalink( $user_id = 0 ) { |
3464 | 3468 | $retval = trailingslashit( $domain . bp_get_members_invitations_slug() . '/send-invites' ); |
3465 | 3469 | |
3466 | 3470 | /** |
3467 | | * Filters the read notifications permalink. |
| 3471 | * Filters the send invitations permalink. |
3468 | 3472 | * |
3469 | 3473 | * @since 8.0.0 |
3470 | 3474 | * |
-
diff --git src/bp-members/classes/class-bp-members-admin.php src/bp-members/classes/class-bp-members-admin.php
index 3294a7765..8c1d68b46 100644
|
|
class BP_Members_Admin { |
224 | 224 | |
225 | 225 | // Member invitations are enabled. |
226 | 226 | if ( bp_is_network_activated() ) { |
227 | | add_action( 'update_site_option_bp-enable-members-invitations', array( $this, 'multisite_registration_on' ), 10, 2 ); |
| 227 | add_action( 'update_site_option_bp-enable-members-invitations', array( $this, 'multisite_registration_on' ), 10, 2 ); |
228 | 228 | } else { |
229 | 229 | add_action( 'update_option_bp-enable-members-invitations', array( $this, 'single_site_registration_on' ), 10, 2 ); |
230 | 230 | } |
… |
… |
class BP_Members_Admin { |
557 | 557 | foreach ( $page_head as $head ) { |
558 | 558 | add_action( "admin_head-{$head}", array( $this, 'profile_admin_head' ) ); |
559 | 559 | } |
| 560 | |
| 561 | // Highlight the BuddyPress tools submenu when managing invitations. |
| 562 | add_action( "admin_head-{$this->members_invites_page}", 'bp_core_modify_admin_menu_highlight' ); |
560 | 563 | } |
561 | 564 | |
562 | 565 | /** |
… |
… |
class BP_Members_Admin { |
1940 | 1943 | } |
1941 | 1944 | |
1942 | 1945 | if ( ! empty( $_REQUEST['notdeleted'] ) ) { |
| 1946 | $notdeleted = absint( $_REQUEST['notdeleted'] ); |
1943 | 1947 | $notice['message'] .= sprintf( |
1944 | | /* translators: %s: number of deleted signups not deleted */ |
1945 | | _nx( '%s sign-up was not deleted.', '%s sign-ups were not deleted.', |
1946 | | absint( $_REQUEST['notdeleted'] ), |
1947 | | 'signup notdeleted', |
1948 | | 'buddypress' |
| 1948 | _nx( |
| 1949 | /* translators: %s: number of deleted signups not deleted */ |
| 1950 | '%s sign-up was not deleted.', '%s sign-ups were not deleted.', |
| 1951 | $notdeleted, |
| 1952 | 'signup notdeleted', |
| 1953 | 'buddypress' |
1949 | 1954 | ), |
1950 | | number_format_i18n( absint( $_REQUEST['notdeleted'] ) ) |
| 1955 | number_format_i18n( $notdeleted ) |
1951 | 1956 | ); |
1952 | 1957 | |
1953 | 1958 | if ( empty( $_REQUEST['deleted'] ) ) { |
… |
… |
class BP_Members_Admin { |
2788 | 2793 | ); |
2789 | 2794 | |
2790 | 2795 | if ( ! empty( $_REQUEST['resent'] ) ) { |
| 2796 | $resent = absint( $_REQUEST['resent'] ); |
2791 | 2797 | $notice['message'] .= sprintf( |
2792 | | /* translators: %s: number of invitation emails sent */ |
2793 | | _nx( '%s invtitation email successfully sent! ', '%s invitation emails successfully sent! ', |
2794 | | absint( $_REQUEST['resent'] ), |
2795 | | 'members invitation resent', |
2796 | | 'buddypress' |
| 2798 | _nx( |
| 2799 | /* translators: %s: number of invitation emails sent */ |
| 2800 | '%s invtitation email successfully sent! ', '%s invitation emails successfully sent! ', |
| 2801 | $resent, |
| 2802 | 'members invitation resent', |
| 2803 | 'buddypress' |
2797 | 2804 | ), |
2798 | | number_format_i18n( absint( $_REQUEST['resent'] ) ) |
| 2805 | number_format_i18n( $resent ) |
2799 | 2806 | ); |
2800 | 2807 | } |
2801 | 2808 | |
2802 | 2809 | if ( ! empty( $_REQUEST['notsent'] ) ) { |
| 2810 | $notsent = absint( $_REQUEST['notsent'] ); |
2803 | 2811 | $notice['message'] .= sprintf( |
2804 | | /* translators: %s: number of unsent invitation emails */ |
2805 | | _nx( '%s invitation email was not sent.', '%s invitation emails were not sent.', |
2806 | | absint( $_REQUEST['notsent'] ), |
2807 | | 'members invitation notsent', |
2808 | | 'buddypress' |
| 2812 | _nx( |
| 2813 | /* translators: %s: number of unsent invitation emails */ |
| 2814 | '%s invitation email was not sent.', '%s invitation emails were not sent.', |
| 2815 | $notsent, |
| 2816 | 'members invitation notsent', |
| 2817 | 'buddypress' |
2809 | 2818 | ), |
2810 | | number_format_i18n( absint( $_REQUEST['notsent'] ) ) |
| 2819 | number_format_i18n( $notsent ) |
2811 | 2820 | ); |
2812 | 2821 | |
2813 | 2822 | if ( empty( $_REQUEST['resent'] ) ) { |
… |
… |
class BP_Members_Admin { |
2824 | 2833 | ); |
2825 | 2834 | |
2826 | 2835 | if ( ! empty( $_REQUEST['deleted'] ) ) { |
| 2836 | $deleted = absint( $_REQUEST['deleted'] ); |
2827 | 2837 | $notice['message'] .= sprintf( |
2828 | | /* translators: %s: number of deleted invitations */ |
2829 | | _nx( '%s invitation successfully deleted!', '%s invitations successfully deleted!', |
2830 | | absint( $_REQUEST['deleted'] ), |
2831 | | 'members invitation deleted', |
2832 | | 'buddypress' |
| 2838 | _nx( |
| 2839 | /* translators: %s: number of deleted invitations */ |
| 2840 | '%s invitation successfully deleted!', '%s invitations successfully deleted!', |
| 2841 | $deleted, |
| 2842 | 'members invitation deleted', |
| 2843 | 'buddypress' |
2833 | 2844 | ), |
2834 | | number_format_i18n( absint( $_REQUEST['deleted'] ) ) |
| 2845 | number_format_i18n( $deleted ) |
2835 | 2846 | ); |
2836 | 2847 | } |
2837 | 2848 | |
2838 | 2849 | if ( ! empty( $_REQUEST['notdeleted'] ) ) { |
| 2850 | $notdeleted = absint( $_REQUEST['notdeleted'] ); |
2839 | 2851 | $notice['message'] .= sprintf( |
2840 | | /* translators: %s: number of invitations that failed to be deleted */ |
2841 | | _nx( '%s invitation was not deleted.', '%s invitations were not deleted.', |
2842 | | absint( $_REQUEST['notdeleted'] ), |
2843 | | 'members invitation notdeleted', |
2844 | | 'buddypress' |
| 2852 | _nx( |
| 2853 | /* translators: %s: number of invitations that failed to be deleted */ |
| 2854 | '%s invitation was not deleted.', '%s invitations were not deleted.', |
| 2855 | $notdeleted, |
| 2856 | 'members invitation notdeleted', |
| 2857 | 'buddypress' |
2845 | 2858 | ), |
2846 | | number_format_i18n( absint( $_REQUEST['notdeleted'] ) ) |
| 2859 | number_format_i18n( $notdeleted ) |
2847 | 2860 | ); |
2848 | 2861 | |
2849 | 2862 | if ( empty( $_REQUEST['deleted'] ) ) { |
… |
… |
class BP_Members_Admin { |
3011 | 3024 | /** |
3012 | 3025 | * This is the confirmation screen for actions. |
3013 | 3026 | * |
3014 | | * @since 2.0.0 |
| 3027 | * @since 8.0.0 |
3015 | 3028 | * |
3016 | 3029 | * @param string $action Delete or resend invitation. |
3017 | | * |
3018 | 3030 | * @return null|false |
3019 | 3031 | */ |
3020 | 3032 | public function invitations_admin_manage( $action = '' ) { |
… |
… |
class BP_Members_Admin { |
3087 | 3099 | ); |
3088 | 3100 | |
3089 | 3101 | if ( is_network_admin() ) { |
3090 | | $form_url = network_admin_url( 'admin.php' ); |
| 3102 | $base_url = network_admin_url( 'admin.php' ); |
3091 | 3103 | } else { |
3092 | | $form_url = bp_get_admin_url( 'tools.php' ); |
| 3104 | $base_url = bp_get_admin_url( 'tools.php' ); |
3093 | 3105 | } |
3094 | 3106 | |
3095 | 3107 | $cancel_url = add_query_arg( $url_args, $base_url ); |
-
diff --git src/bp-members/classes/class-bp-members-component.php src/bp-members/classes/class-bp-members-component.php
index ec10398ae..2037224f3 100644
|
|
class BP_Members_Component extends BP_Component { |
624 | 624 | } else { |
625 | 625 | add_filter( 'bp_xprofile_admin_nav', array( $this, 'setup_xprofile_admin_nav' ), 2 ); |
626 | 626 | } |
627 | | |
628 | | // $wp_admin_nav = array_merge( $wp_admin_nav, $this->get_members_invitations_admin_navs() ); |
629 | 627 | } |
630 | 628 | |
631 | 629 | parent::setup_admin_bar( $wp_admin_nav ); |
-
diff --git src/bp-members/classes/class-bp-members-invitation-manager.php src/bp-members/classes/class-bp-members-invitation-manager.php
index 139caf279..1ba89d286 100644
|
|
class BP_Members_Invitation_Manager extends BP_Invitation_Manager { |
58 | 58 | array( |
59 | 59 | 'inv' => $invitation->id, |
60 | 60 | 'ih' => bp_members_invitations_get_hash( $invitation ), |
61 | | ), bp_get_signup_page() |
| 61 | ), |
| 62 | bp_get_signup_page() |
62 | 63 | ) |
63 | 64 | ); |
64 | 65 | $unsubscribe_args = array( |
… |
… |
class BP_Members_Invitation_Manager extends BP_Invitation_Manager { |
69 | 70 | |
70 | 71 | $args = array( |
71 | 72 | 'tokens' => array( |
72 | | 'inviter.name' => bp_core_get_userlink( $invitation->inviter_id, true, false, true ), |
73 | | 'inviter.url' => bp_core_get_user_domain( $invitation->inviter_id ), |
74 | | 'inviter.id' => $invitation->inviter_id, |
75 | | 'invite.accept_url' => esc_url( $invite_url ), |
76 | | 'usermessage' => $invitation->content, |
77 | | 'unsubscribe' => esc_url( bp_email_get_unsubscribe_link( $unsubscribe_args ) ), |
| 73 | 'inviter.name' => bp_core_get_userlink( $invitation->inviter_id, true, false, true ), |
| 74 | 'inviter.url' => bp_core_get_user_domain( $invitation->inviter_id ), |
| 75 | 'inviter.id' => $invitation->inviter_id, |
| 76 | 'invite.accept_url' => esc_url( $invite_url ), |
| 77 | 'usermessage' => wp_kses( $invitation->content, array() ), |
| 78 | 'unsubscribe' => esc_url( bp_email_get_unsubscribe_link( $unsubscribe_args ) ), |
78 | 79 | ), |
79 | 80 | ); |
80 | 81 | |
… |
… |
class BP_Members_Invitation_Manager extends BP_Invitation_Manager { |
92 | 93 | * @param array $r Parameters that describe the invitation being accepted. |
93 | 94 | * @return bool True on success, false on failure. |
94 | 95 | */ |
95 | | public function run_acceptance_action( $type = 'invite', $r ) { |
| 96 | public function run_acceptance_action( $type = 'invite', $r = array() ) { |
96 | 97 | // If the user is already a member (because BP at one point allowed two invitations to |
97 | 98 | // slip through), return early. |
98 | 99 | |
-
diff --git src/bp-members/classes/class-bp-members-invitations-list-table.php src/bp-members/classes/class-bp-members-invitations-list-table.php
index 90f35d921..db5468ee4 100644
|
|
|
11 | 11 | defined( 'ABSPATH' ) || exit; |
12 | 12 | |
13 | 13 | /** |
14 | | * List table class for signups admin page. |
| 14 | * List table class for Invitations admin page. |
15 | 15 | * |
16 | 16 | * @since 8.0.0 |
17 | 17 | */ |
… |
… |
class BP_Members_Invitations_List_Table extends WP_Users_List_Table { |
28 | 28 | public $active_filters = array(); |
29 | 29 | |
30 | 30 | /** |
31 | | * Signup counts. |
| 31 | * Invitation counts. |
32 | 32 | * |
33 | 33 | * @since 8.0.0 |
34 | | * |
35 | 34 | * @var int |
36 | 35 | */ |
37 | 36 | public $total_items = 0; |
… |
… |
class BP_Members_Invitations_List_Table extends WP_Users_List_Table { |
109 | 108 | * @since 8.0.0 |
110 | 109 | */ |
111 | 110 | public function views() { |
| 111 | $tools_url = bp_get_admin_url( 'tools.php' ); |
| 112 | |
| 113 | if ( is_network_admin() ) { |
| 114 | $tools_url = network_admin_url( 'admin.php' ); |
| 115 | } |
| 116 | |
112 | 117 | $url_base = add_query_arg( |
113 | 118 | array( |
114 | 119 | 'page' => 'bp-members-invitations', |
115 | 120 | ), |
116 | | bp_get_admin_url( 'users.php' ) |
| 121 | $tools_url |
117 | 122 | ); |
118 | | |
119 | 123 | ?> |
120 | 124 | |
121 | 125 | <h2 class="screen-reader-text"><?php |
122 | 126 | /* translators: accessibility text */ |
123 | | _e( 'Filter invitations list', 'buddypress' ); |
| 127 | esc_html_e( 'Filter invitations list', 'buddypress' ); |
124 | 128 | ?></h2> |
125 | 129 | <ul class="subsubsub"> |
126 | 130 | <li class="all"> |
… |
… |
class BP_Members_Invitations_List_Table extends WP_Users_List_Table { |
146 | 150 | <li class="sent"> |
147 | 151 | <a href="<?php echo esc_url( add_query_arg( 'sent', 'sent', $url_base ) ); ?>" class="<?php if ( in_array( 'sent', $this->active_filters, true ) ) echo 'current'; ?>"> |
148 | 152 | <?php esc_html_e( 'Sent', 'buddypress' ); ?> |
149 | | </a> | |
| 153 | </a> |
150 | 154 | </li> |
151 | 155 | |
152 | 156 | <?php |
… |
… |
class BP_Members_Invitations_List_Table extends WP_Users_List_Table { |
196 | 200 | */ |
197 | 201 | return apply_filters( 'bp_members_invitations_list_columns', array( |
198 | 202 | 'cb' => '<input type="checkbox" />', |
199 | | 'invitee_email' => __( 'Invitee', 'buddypress' ), |
200 | | 'username' => __( 'Inviter', 'buddypress' ), |
201 | | 'inviter_registered_date' => __( 'Inviter Registered', 'buddypress' ), |
202 | | 'invitation_date_modified' => __( 'Date Modified', 'buddypress' ), |
| 203 | 'invitee_email' => __( 'Invitee', 'buddypress' ), |
| 204 | 'username' => __( 'Inviter', 'buddypress' ), |
| 205 | 'inviter_registered_date' => __( 'Inviter Registered', 'buddypress' ), |
| 206 | 'invitation_date_modified' => __( 'Date Modified', 'buddypress' ), |
203 | 207 | 'invitation_sent' => __( 'Email Sent', 'buddypress' ), |
204 | 208 | 'invitation_accepted' => __( 'Accepted', 'buddypress' ) |
205 | 209 | ) ); |
… |
… |
class BP_Members_Invitations_List_Table extends WP_Users_List_Table { |
232 | 236 | public function no_items() { |
233 | 237 | |
234 | 238 | if ( bp_get_members_invitations_allowed() ) { |
235 | | esc_html_e( 'No pending invitations found.', 'buddypress' ); |
| 239 | esc_html_e( 'No invitations found.', 'buddypress' ); |
236 | 240 | } else { |
237 | 241 | $link = sprintf( '<a href="%1$s">%2$s</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ) ), esc_html__( 'Edit settings', 'buddypress' ) ); |
238 | 242 | |
… |
… |
class BP_Members_Invitations_List_Table extends WP_Users_List_Table { |
317 | 321 | echo esc_html( $invite->invitee_email ); |
318 | 322 | |
319 | 323 | $actions = array(); |
| 324 | $tools_url = bp_get_admin_url( 'tools.php' ); |
| 325 | |
| 326 | if ( is_network_admin() ) { |
| 327 | $tools_url = network_admin_url( 'admin.php' ); |
| 328 | } |
320 | 329 | |
321 | 330 | // Resend action only if pending |
322 | 331 | if ( ! $invite->accepted ) { |
… |
… |
class BP_Members_Invitations_List_Table extends WP_Users_List_Table { |
327 | 336 | 'invite_id' => $invite->id, |
328 | 337 | 'action' => 'resend', |
329 | 338 | ), |
330 | | bp_get_admin_url( 'users.php' ) |
| 339 | $tools_url |
331 | 340 | ); |
| 341 | |
332 | 342 | if ( ! $invite->invite_sent ) { |
333 | 343 | $resend_label = __( 'Send', 'buddypress' ); |
334 | 344 | } else { |
335 | 345 | $resend_label = __( 'Resend', 'buddypress' ); |
336 | 346 | } |
337 | | $actions['resend'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link ), $resend_label ); |
| 347 | |
| 348 | $actions['resend'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link ), esc_html( $resend_label ) ); |
338 | 349 | } |
339 | 350 | |
340 | 351 | // Delete link. Could be cleanup or revoking the invitation. |
… |
… |
class BP_Members_Invitations_List_Table extends WP_Users_List_Table { |
344 | 355 | 'invite_id' => $invite->id, |
345 | 356 | 'action' => 'delete', |
346 | 357 | ), |
347 | | bp_get_admin_url( 'users.php' ) |
| 358 | $tools_url |
348 | 359 | ); |
| 360 | |
349 | 361 | // Two cases: unsent and accepted (cleanup), and pending (cancels invite). |
350 | 362 | if ( ! $invite->invite_sent || $invite->accepted ) { |
351 | | $actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), __( 'Delete', 'buddypress' ) ); |
| 363 | $actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), esc_html__( 'Delete', 'buddypress' ) ); |
352 | 364 | } else { |
353 | | $actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), __( 'Cancel', 'buddypress' ) ); |
| 365 | $actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), esc_html__( 'Cancel', 'buddypress' ) ); |
354 | 366 | } |
355 | 367 | |
356 | 368 | /** |
… |
… |
class BP_Members_Invitations_List_Table extends WP_Users_List_Table { |
385 | 397 | * @param BP_Invitation $invite BP_Invitation object. |
386 | 398 | */ |
387 | 399 | public function column_username( $invite = null ) { |
388 | | $avatar = get_avatar( $invite->inviter_id, 32 ); |
| 400 | $avatar = get_avatar( $invite->inviter_id, 32 ); |
389 | 401 | $inviter = get_user_by( 'id', $invite->inviter_id ); |
390 | 402 | if ( ! $inviter ) { |
391 | 403 | return; |
392 | 404 | } |
| 405 | |
393 | 406 | $user_link = bp_core_get_user_domain( $invite->inviter_id ); |
394 | | echo $avatar . sprintf( '<strong><a href="%1$s" class="edit">%2$s</a></strong><br/>', esc_url( $user_link ), $inviter->user_login ); |
| 407 | |
| 408 | printf( '%1$s <strong><a href="%2$s" class="edit">%3$s</a></strong><br/>', $avatar, esc_url( $user_link ), esc_html( $inviter->user_login ) ); |
395 | 409 | } |
396 | 410 | |
397 | 411 | /** |
-
diff --git src/bp-members/classes/class-bp-members-invitations-template.php src/bp-members/classes/class-bp-members-invitations-template.php
index 1c5da5c42..7f1bd91af 100644
|
|
class BP_Members_Invitations_Template { |
142 | 142 | /** |
143 | 143 | * Array of variables used in this invitation query. |
144 | 144 | * |
145 | | * @since 2.2.2 |
| 145 | * @since 8.0.0 |
146 | 146 | * @var array |
147 | 147 | */ |
148 | 148 | public $query_vars; |
… |
… |
class BP_Members_Invitations_Template { |
310 | 310 | * |
311 | 311 | * @since 8.0.0 |
312 | 312 | */ |
313 | | do_action( 'members_invitations_loop_end'); |
| 313 | do_action( 'members_invitations_loop_end' ); |
314 | 314 | |
315 | 315 | $this->rewind_invitations(); |
316 | 316 | } |
… |
… |
class BP_Members_Invitations_Template { |
331 | 331 | * @see bp_the_invitation() |
332 | 332 | */ |
333 | 333 | public function the_invitation() { |
334 | | $this->in_the_loop = true; |
335 | | $this->invitation = $this->next_invitation(); |
| 334 | $this->in_the_loop = true; |
| 335 | $this->invitation = $this->next_invitation(); |
336 | 336 | |
337 | 337 | // Loop has just started. |
338 | 338 | if ( 0 === $this->current_invitation ) { |
-
diff --git src/bp-members/screens/list-invites.php src/bp-members/screens/list-invites.php
index 8242dd279..600cee733 100644
|
|
function bp_members_invitations_action_handling() { |
46 | 46 | } |
47 | 47 | |
48 | 48 | // Get the action. |
49 | | $action = ! empty( $_GET['action'] ) ? $_GET['action'] : ''; |
50 | | $nonce = ! empty( $_GET['_wpnonce'] ) ? $_GET['_wpnonce'] : ''; |
51 | | $id = ! empty( $_GET['invitation_id'] ) ? $_GET['invitation_id'] : ''; |
| 49 | $action = ! empty( $_GET['action'] ) ? $_GET['action'] : ''; |
| 50 | $nonce = ! empty( $_GET['_wpnonce'] ) ? $_GET['_wpnonce'] : ''; |
| 51 | $id = ! empty( $_GET['invitation_id'] ) ? $_GET['invitation_id'] : ''; |
52 | 52 | |
53 | 53 | // Bail if no action or no ID. |
54 | 54 | if ( empty( $action ) || empty( $id ) ) { |
… |
… |
function bp_members_invitations_action_handling() { |
58 | 58 | if ( 'cancel' === $action ) { |
59 | 59 | // Check the nonce and delete the invitation. |
60 | 60 | if ( bp_verify_nonce_request( 'bp_members_invitations_cancel_' . $id ) && bp_members_invitations_delete_by_id( $id ) ) { |
61 | | bp_core_add_message( __( 'Invitation successfully canceled.', 'buddypress' ) ); |
| 61 | bp_core_add_message( __( 'Invitation successfully canceled.', 'buddypress' ) ); |
62 | 62 | } else { |
63 | 63 | bp_core_add_message( __( 'There was a problem canceling that invitation.', 'buddypress' ), 'error' ); |
64 | 64 | } |
65 | 65 | } else if ( 'resend' === $action ) { |
66 | 66 | // Check the nonce and resend the invitation. |
67 | 67 | if ( bp_verify_nonce_request( 'bp_network_invitation_resend_' . $id ) && bp_members_invitation_resend_by_id( $id ) ) { |
68 | | bp_core_add_message( __( 'Invitation successfully resent.', 'buddypress' ) ); |
| 68 | bp_core_add_message( __( 'Invitation successfully resent.', 'buddypress' ) ); |
69 | 69 | } else { |
70 | 70 | bp_core_add_message( __( 'There was a problem resending that invitation.', 'buddypress' ), 'error' ); |
71 | 71 | } |
-
diff --git src/bp-templates/bp-nouveau/buddypress/members/single/invitations/invitations-loop.php src/bp-templates/bp-nouveau/buddypress/members/single/invitations/invitations-loop.php
index 48576e8cf..f4aa643ee 100644
|
|
|
6 | 6 | * @version 8.0.0 |
7 | 7 | */ |
8 | 8 | ?> |
9 | | <form action="" method="post" id="invitations-bulk-management"> |
| 9 | <form action="" method="post" id="invitations-bulk-management" class="standard-form"> |
10 | 10 | <table class="invitations"> |
11 | 11 | <thead> |
12 | 12 | <tr> |
13 | | <th class="icon"></th> |
14 | | <th class="bulk-select-all"><input id="select-all-invitations" type="checkbox"><label class="bp-screen-reader-text" for="select-all-invitations"><?php |
15 | | /* translators: accessibility text */ |
16 | | esc_html_e( 'Select all', 'buddypress' ); |
17 | | ?></label></th> |
| 13 | <th class="bulk-select-all"><input id="select-all-invitations" type="checkbox"> |
| 14 | <label class="bp-screen-reader-text" for="select-all-invitations"> |
| 15 | <?php |
| 16 | /* translators: accessibility text */ |
| 17 | esc_html_e( 'Select all', 'buddypress' ); |
| 18 | ?> |
| 19 | </label> |
| 20 | </th> |
18 | 21 | <th class="title"><?php esc_html_e( 'Invitee', 'buddypress' ); ?></th> |
19 | 22 | <th class="content"><?php esc_html_e( 'Message', 'buddypress' ); ?></th> |
20 | 23 | <th class="sent"><?php esc_html_e( 'Sent', 'buddypress' ); ?></th> |
… |
… |
|
29 | 32 | <?php while ( bp_the_members_invitations() ) : bp_the_members_invitation(); ?> |
30 | 33 | |
31 | 34 | <tr> |
32 | | <td></td> |
33 | 35 | <td class="bulk-select-check"> |
34 | 36 | <label for="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>"> |
35 | 37 | <input id="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>" type="checkbox" name="network_invitations[]" value="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>" class="invitation-check"> |
… |
… |
|
55 | 57 | </table> |
56 | 58 | |
57 | 59 | <div class="invitations-options-nav"> |
58 | | <?php // @TODO //bp_invitations_bulk_management_dropdown(); ?> |
| 60 | <?php bp_nouveau_invitations_bulk_management_dropdown(); ?> |
59 | 61 | </div><!-- .invitations-options-nav --> |
60 | 62 | |
61 | 63 | <?php wp_nonce_field( 'invitations_bulk_nonce', 'invitations_bulk_nonce' ); ?> |
-
diff --git src/bp-templates/bp-nouveau/buddypress/members/single/invitations/list-invites.php src/bp-templates/bp-nouveau/buddypress/members/single/invitations/list-invites.php
index 92d92879f..a83054098 100644
|
|
|
16 | 16 | ?> |
17 | 17 | </h2> |
18 | 18 | |
19 | | <div id="pag-top" class="pagination no-ajax"> |
| 19 | <div id="pag-top" class="bp-pagination no-ajax"> |
20 | 20 | <div class="pag-count" id="invitations-count-top"> |
21 | 21 | <?php bp_members_invitations_pagination_count(); ?> |
22 | 22 | </div> |
… |
… |
|
28 | 28 | |
29 | 29 | <?php bp_get_template_part( 'members/single/invitations/invitations-loop' ); ?> |
30 | 30 | |
31 | | <div id="pag-bottom" class="pagination no-ajax"> |
| 31 | <div id="pag-bottom" class="bp-pagination no-ajax"> |
32 | 32 | <div class="pag-count" id="invitations-count-bottom"> |
33 | 33 | <?php bp_members_invitations_pagination_count(); ?> |
34 | 34 | </div> |
-
diff --git src/bp-templates/bp-nouveau/common-styles/_bp_filters.scss src/bp-templates/bp-nouveau/common-styles/_bp_filters.scss
index 8ff5970f1..1317aee14 100644
|
|
|
181 | 181 | |
182 | 182 | } // close .subnav-filters |
183 | 183 | |
184 | | .notifications-options-nav { |
185 | | |
186 | | input#notification-bulk-manage { |
187 | | border: 0; |
188 | | border-radius: 0; |
189 | | line-height: 1.6; |
190 | | } |
| 184 | .notifications-options-nav input#notification-bulk-manage, |
| 185 | .invitations-options-nav input#invitation-bulk-manage { |
| 186 | border: 0; |
| 187 | border-radius: 0; |
| 188 | line-height: 1.6; |
191 | 189 | } |
192 | 190 | |
193 | 191 | .group-subnav-filters { |
-
diff --git src/bp-templates/bp-nouveau/common-styles/_bp_forms.scss src/bp-templates/bp-nouveau/common-styles/_bp_forms.scss
index b39d8a03c..9453a4452 100644
|
|
|
24 | 24 | opacity: 0.4; |
25 | 25 | } |
26 | 26 | |
27 | | #notification-bulk-manage[disabled] { |
| 27 | #notification-bulk-manage[disabled], |
| 28 | #invitation-bulk-manage[disabled] { |
28 | 29 | display: none; |
29 | 30 | } |
30 | 31 | |
… |
… |
body.no-js { |
399 | 400 | |
400 | 401 | @include medium-small-up() { |
401 | 402 | |
402 | | .notifications-options-nav { |
403 | | |
404 | | .select-wrap { |
405 | | float: left; |
406 | | } |
| 403 | .notifications-options-nav .select-wrap, |
| 404 | .invitations-options-nav .select-wrap { |
| 405 | float: left; |
407 | 406 | } |
408 | 407 | } |
409 | 408 | } |
-
diff --git src/bp-templates/bp-nouveau/common-styles/_bp_generic_and_typography.scss src/bp-templates/bp-nouveau/common-styles/_bp_generic_and_typography.scss
index 65cabf5e7..2d2799368 100644
|
|
body.buddypress { |
255 | 255 | } |
256 | 256 | } |
257 | 257 | |
258 | | #notification-select { |
| 258 | #notification-select, |
| 259 | #invitation-select { |
259 | 260 | |
260 | 261 | @include responsive-font(14); |
261 | 262 | } |
-
diff --git src/bp-templates/bp-nouveau/css/buddypress-rtl.css src/bp-templates/bp-nouveau/css/buddypress-rtl.css
index 38c0e2217..353fdb9c0 100644
|
|
body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en |
255 | 255 | } |
256 | 256 | } |
257 | 257 | |
258 | | .buddypress-wrap #notification-select { |
| 258 | .buddypress-wrap #notification-select, |
| 259 | .buddypress-wrap #invitation-select { |
259 | 260 | font-size: 12px; |
260 | 261 | } |
261 | 262 | |
262 | 263 | @media screen and (min-width: 46.8em) { |
263 | | .buddypress-wrap #notification-select { |
| 264 | .buddypress-wrap #notification-select, |
| 265 | .buddypress-wrap #invitation-select { |
264 | 266 | font-size: 14px; |
265 | 267 | } |
266 | 268 | } |
… |
… |
body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en |
794 | 796 | } |
795 | 797 | } |
796 | 798 | |
797 | | .buddypress-wrap .notifications-options-nav input#notification-bulk-manage { |
| 799 | .buddypress-wrap .notifications-options-nav input#notification-bulk-manage, |
| 800 | .buddypress-wrap .invitations-options-nav input#invitation-bulk-manage { |
798 | 801 | border: 0; |
799 | 802 | border-radius: 0; |
800 | 803 | line-height: 1.6; |
… |
… |
body.buddypress.settings.data #buddypress.buddypress-wrap .item-body p a { |
3430 | 3433 | opacity: 0.4; |
3431 | 3434 | } |
3432 | 3435 | |
3433 | | .buddypress-wrap #notification-bulk-manage[disabled] { |
| 3436 | .buddypress-wrap #notification-bulk-manage[disabled], |
| 3437 | .buddypress-wrap #invitation-bulk-manage[disabled] { |
3434 | 3438 | display: none; |
3435 | 3439 | } |
3436 | 3440 | |
… |
… |
body.no-js .buddypress #messages-bulk-management #select-all-messages { |
3727 | 3731 | } |
3728 | 3732 | |
3729 | 3733 | @media screen and (min-width: 32em) { |
3730 | | .buddypress-wrap .notifications-options-nav .select-wrap { |
| 3734 | .buddypress-wrap .notifications-options-nav .select-wrap, |
| 3735 | .buddypress-wrap .invitations-options-nav .select-wrap { |
3731 | 3736 | float: right; |
3732 | 3737 | } |
3733 | 3738 | } |
-
diff --git src/bp-templates/bp-nouveau/css/buddypress.css src/bp-templates/bp-nouveau/css/buddypress.css
index 15406b96e..b6c5f981f 100644
|
|
body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en |
255 | 255 | } |
256 | 256 | } |
257 | 257 | |
258 | | .buddypress-wrap #notification-select { |
| 258 | .buddypress-wrap #notification-select, |
| 259 | .buddypress-wrap #invitation-select { |
259 | 260 | font-size: 12px; |
260 | 261 | } |
261 | 262 | |
262 | 263 | @media screen and (min-width: 46.8em) { |
263 | | .buddypress-wrap #notification-select { |
| 264 | .buddypress-wrap #notification-select, |
| 265 | .buddypress-wrap #invitation-select { |
264 | 266 | font-size: 14px; |
265 | 267 | } |
266 | 268 | } |
… |
… |
body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en |
794 | 796 | } |
795 | 797 | } |
796 | 798 | |
797 | | .buddypress-wrap .notifications-options-nav input#notification-bulk-manage { |
| 799 | .buddypress-wrap .notifications-options-nav input#notification-bulk-manage, |
| 800 | .buddypress-wrap .invitations-options-nav input#invitation-bulk-manage { |
798 | 801 | border: 0; |
799 | 802 | border-radius: 0; |
800 | 803 | line-height: 1.6; |
… |
… |
body.buddypress.settings.data #buddypress.buddypress-wrap .item-body p a { |
3430 | 3433 | opacity: 0.4; |
3431 | 3434 | } |
3432 | 3435 | |
3433 | | .buddypress-wrap #notification-bulk-manage[disabled] { |
| 3436 | .buddypress-wrap #notification-bulk-manage[disabled], |
| 3437 | .buddypress-wrap #invitation-bulk-manage[disabled] { |
3434 | 3438 | display: none; |
3435 | 3439 | } |
3436 | 3440 | |
… |
… |
body.no-js .buddypress #messages-bulk-management #select-all-messages { |
3727 | 3731 | } |
3728 | 3732 | |
3729 | 3733 | @media screen and (min-width: 32em) { |
3730 | | .buddypress-wrap .notifications-options-nav .select-wrap { |
| 3734 | .buddypress-wrap .notifications-options-nav .select-wrap, |
| 3735 | .buddypress-wrap .invitations-options-nav .select-wrap { |
3731 | 3736 | float: left; |
3732 | 3737 | } |
3733 | 3738 | } |
-
diff --git src/bp-templates/bp-nouveau/css/twentytwentyone-rtl.css src/bp-templates/bp-nouveau/css/twentytwentyone-rtl.css
index 453826cd5..d3d05a346 100644
|
|
Hello, this is the BP Nouveau's Twenty Twenty-One companion stylesheet. |
154 | 154 | padding-right: 0; |
155 | 155 | } |
156 | 156 | |
157 | | #buddypress.twentytwentyone .notifications-options-nav { |
| 157 | #buddypress.twentytwentyone .notifications-options-nav, |
| 158 | #buddypress.twentytwentyone .invitations-options-nav { |
158 | 159 | margin-top: 1em; |
159 | 160 | } |
160 | 161 | |
161 | | #buddypress.twentytwentyone .notifications-options-nav input#notification-bulk-manage { |
| 162 | #buddypress.twentytwentyone .notifications-options-nav input#notification-bulk-manage, |
| 163 | #buddypress.twentytwentyone .invitations-options-nav input#invitation-bulk-manage { |
162 | 164 | line-height: 1.2; |
163 | 165 | } |
164 | 166 | |
-
diff --git src/bp-templates/bp-nouveau/css/twentytwentyone.css src/bp-templates/bp-nouveau/css/twentytwentyone.css
index ecfaf8d9e..a8837db02 100644
|
|
Hello, this is the BP Nouveau's Twenty Twenty-One companion stylesheet. |
154 | 154 | padding-left: 0; |
155 | 155 | } |
156 | 156 | |
157 | | #buddypress.twentytwentyone .notifications-options-nav { |
| 157 | #buddypress.twentytwentyone .notifications-options-nav, |
| 158 | #buddypress.twentytwentyone .invitations-options-nav { |
158 | 159 | margin-top: 1em; |
159 | 160 | } |
160 | 161 | |
161 | | #buddypress.twentytwentyone .notifications-options-nav input#notification-bulk-manage { |
| 162 | #buddypress.twentytwentyone .notifications-options-nav input#notification-bulk-manage, |
| 163 | #buddypress.twentytwentyone .invitations-options-nav input#invitation-bulk-manage { |
162 | 164 | line-height: 1.2; |
163 | 165 | } |
164 | 166 | |
-
diff --git src/bp-templates/bp-nouveau/includes/members/functions.php src/bp-templates/bp-nouveau/includes/members/functions.php
index de6bbea3b..82c38ee17 100644
|
|
|
3 | 3 | * Members functions |
4 | 4 | * |
5 | 5 | * @since 3.0.0 |
6 | | * @version 6.0.0 |
| 6 | * @version 8.0.0 |
7 | 7 | */ |
8 | 8 | |
9 | 9 | // Exit if accessed directly. |
10 | 10 | defined( 'ABSPATH' ) || exit; |
11 | 11 | |
| 12 | /** |
| 13 | * Register Scripts for the Members component |
| 14 | * |
| 15 | * @since 8.0.0 |
| 16 | * |
| 17 | * @param array $scripts Optional. The array of scripts to register. |
| 18 | * @return array The same array with the specific members scripts. |
| 19 | */ |
| 20 | function bp_nouveau_members_register_scripts( $scripts = array() ) { |
| 21 | if ( ! isset( $scripts['bp-nouveau'] ) || ! bp_get_members_invitations_allowed() ) { |
| 22 | return $scripts; |
| 23 | } |
| 24 | |
| 25 | return array_merge( $scripts, array( |
| 26 | 'bp-nouveau-member-invites' => array( |
| 27 | 'file' => 'js/buddypress-member-invites%s.js', |
| 28 | 'dependencies' => array(), |
| 29 | 'footer' => true, |
| 30 | ), |
| 31 | ) ); |
| 32 | } |
| 33 | |
12 | 34 | /** |
13 | 35 | * Enqueue the members scripts |
14 | 36 | * |
… |
… |
defined( 'ABSPATH' ) || exit; |
16 | 38 | */ |
17 | 39 | function bp_nouveau_members_enqueue_scripts() { |
18 | 40 | // Neutralize Ajax when using BuddyPress Groups & member widgets on default front page |
19 | | if ( ! bp_is_user_front() || ! bp_nouveau_get_appearance_settings( 'user_front_page' ) ) { |
20 | | return; |
| 41 | if ( bp_is_user_front() && bp_nouveau_get_appearance_settings( 'user_front_page' ) ) { |
| 42 | wp_add_inline_style( |
| 43 | 'bp-nouveau', |
| 44 | '#member-front-widgets #groups-list-options, |
| 45 | #member-front-widgets #members-list-options, |
| 46 | #member-front-widgets #friends-list-options { |
| 47 | display: none; |
| 48 | }' |
| 49 | ); |
21 | 50 | } |
22 | 51 | |
23 | | wp_add_inline_style( |
24 | | 'bp-nouveau', ' |
25 | | #member-front-widgets #groups-list-options, |
26 | | #member-front-widgets #members-list-options, |
27 | | #member-front-widgets #friends-list-options { |
28 | | display: none; |
29 | | } |
30 | | ' |
31 | | ); |
| 52 | if ( bp_is_user_members_invitations_list() ) { |
| 53 | wp_enqueue_script( 'bp-nouveau-member-invites' ); |
| 54 | } |
32 | 55 | } |
33 | 56 | |
34 | 57 | /** |
-
diff --git src/bp-templates/bp-nouveau/includes/members/loader.php src/bp-templates/bp-nouveau/includes/members/loader.php
index 0aca1fb52..6a13d1f30 100644
|
|
class BP_Nouveau_Members { |
88 | 88 | protected function setup_filters() { |
89 | 89 | // Add the default-front to User's front hierarchy if user enabled it (Enabled by default). |
90 | 90 | add_filter( 'bp_displayed_user_get_front_template', 'bp_nouveau_member_reset_front_template', 10, 1 ); |
| 91 | add_filter( 'bp_nouveau_register_scripts', 'bp_nouveau_members_register_scripts', 10, 1 ); |
91 | 92 | |
92 | 93 | // The number formatting is done into the `bp_nouveau_nav_count()` template tag. |
93 | 94 | remove_filter( 'bp_get_total_member_count', 'bp_core_number_format' ); |
-
diff --git src/bp-templates/bp-nouveau/includes/members/template-tags.php src/bp-templates/bp-nouveau/includes/members/template-tags.php
index 1c9385047..2d079f3ab 100644
|
|
|
3 | 3 | * Members template tags |
4 | 4 | * |
5 | 5 | * @since 3.0.0 |
6 | | * @version 6.0.0 |
| 6 | * @version 8.0.0 |
7 | 7 | */ |
8 | 8 | |
9 | 9 | // Exit if accessed directly. |
… |
… |
function bp_nouveau_wp_profile_field_data() { |
1039 | 1039 | $field = bp_nouveau()->members->wp_profile_current; |
1040 | 1040 | return $field->data; |
1041 | 1041 | } |
| 1042 | |
| 1043 | /** |
| 1044 | * Outputs the Invitations bulk actions dropdown list. |
| 1045 | * |
| 1046 | * @since 8.0.0 |
| 1047 | */ |
| 1048 | function bp_nouveau_invitations_bulk_management_dropdown() { |
| 1049 | ?> |
| 1050 | <div class="select-wrap"> |
| 1051 | |
| 1052 | <label class="bp-screen-reader-text" for="invitation-select"> |
| 1053 | <?php |
| 1054 | esc_html_e( 'Select Bulk Action', 'buddypress' ); |
| 1055 | ?> |
| 1056 | </label> |
| 1057 | |
| 1058 | <select name="invitation_bulk_action" id="invitation-select"> |
| 1059 | <option value="" selected="selected"><?php esc_html_e( 'Bulk Actions', 'buddypress' ); ?></option> |
| 1060 | <option value="resend"><?php echo esc_html_x( 'Resend', 'button', 'buddypress' ); ?></option> |
| 1061 | <option value="cancel"><?php echo esc_html_x( 'Cancel', 'button', 'buddypress' ); ?></option> |
| 1062 | </select> |
| 1063 | |
| 1064 | <span class="select-arrow"></span> |
| 1065 | |
| 1066 | </div><!-- // .select-wrap --> |
| 1067 | |
| 1068 | <input type="submit" id="invitation-bulk-manage" class="button action" value="<?php echo esc_attr_x( 'Apply', 'button', 'buddypress' ); ?>"> |
| 1069 | <?php |
| 1070 | } |
-
diff --git src/bp-templates/bp-nouveau/js/buddypress-member-invites.js src/bp-templates/bp-nouveau/js/buddypress-member-invites.js
new file mode 100644
index 000000000..38c066b5e
-
|
+
|
|
| 1 | /** |
| 2 | * Handles the dynamic parts of the Member's Pending Invitations screen. |
| 3 | * |
| 4 | * @since 8.0.0 |
| 5 | * @version 8.0.0 |
| 6 | */ |
| 7 | ( function() { |
| 8 | /** |
| 9 | * Organizes the dynamic parts of the Member's Pending Invitations screen. |
| 10 | * |
| 11 | * @namespace bp.Nouveau.Invitations |
| 12 | * @memberof bp.Nouveau |
| 13 | * |
| 14 | * @since 8.0.0 |
| 15 | * @type {Object} |
| 16 | */ |
| 17 | var Invitations = { |
| 18 | /** |
| 19 | * Selects/Unselects all invitations. |
| 20 | * |
| 21 | * @since 8.0.0 |
| 22 | * |
| 23 | * @param {Object} event The click event. |
| 24 | */ |
| 25 | toggleSelection: function( event ) { |
| 26 | document.querySelectorAll( '.invitation-check' ).forEach( function( cb ) { |
| 27 | cb.checked = event.target.checked; |
| 28 | } ); |
| 29 | }, |
| 30 | /** |
| 31 | * Selects/Unselects all invitations. |
| 32 | * |
| 33 | * @since 8.0.0 |
| 34 | * |
| 35 | * @param {Object} event The click event. |
| 36 | */ |
| 37 | toggleSubmit: function( event ) { |
| 38 | if ( ! event.target.value ) { |
| 39 | document.querySelector( '#invitation-bulk-manage' ).setAttribute( 'disabled', 'disabled' ); |
| 40 | } else { |
| 41 | document.querySelector( '#invitation-bulk-manage' ).removeAttribute( 'disabled' ); |
| 42 | } |
| 43 | }, |
| 44 | /** |
| 45 | * Adds listeners. |
| 46 | * |
| 47 | * @since 8.0.0 |
| 48 | */ |
| 49 | start: function() { |
| 50 | // Disable the submit button. |
| 51 | document.querySelector( '#invitation-bulk-manage' ).setAttribute( 'disabled', 'disabled' ); |
| 52 | |
| 53 | // Select/UnSelect all invitations. |
| 54 | document.querySelector( '#select-all-invitations' ).addEventListener( 'click', this.toggleSelection ); |
| 55 | |
| 56 | // Enable/Disable the submit button. |
| 57 | document.querySelector( '#invitation-select' ).addEventListener( 'change', this.toggleSubmit ); |
| 58 | } |
| 59 | }; |
| 60 | |
| 61 | window.bp = window.bp || {}; |
| 62 | if ( window.bp.Nouveau ) { |
| 63 | window.bp.Nouveau.Invitations = Invitations; |
| 64 | |
| 65 | Invitations.start(); |
| 66 | } |
| 67 | } )(); |
-
diff --git src/bp-templates/bp-nouveau/sass/twentytwentyone.scss src/bp-templates/bp-nouveau/sass/twentytwentyone.scss
index af56e9a79..2bc6a8de3 100644
|
|
Hello, this is the BP Nouveau's Twenty Twenty-One companion stylesheet. |
221 | 221 | } |
222 | 222 | } |
223 | 223 | |
224 | | .notifications-options-nav { |
| 224 | .notifications-options-nav, |
| 225 | .invitations-options-nav { |
225 | 226 | margin-top: 1em; |
| 227 | } |
226 | 228 | |
227 | | input#notification-bulk-manage { |
228 | | line-height: 1.2; |
229 | | } |
| 229 | .notifications-options-nav input#notification-bulk-manage, |
| 230 | .invitations-options-nav input#invitation-bulk-manage { |
| 231 | line-height: 1.2; |
230 | 232 | } |
231 | 233 | } |
232 | 234 | |