Changeset 13169 for trunk/src/bp-members/classes/class-bp-members-admin.php
- Timestamp:
- 12/10/2021 04:14:51 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/classes/class-bp-members-admin.php
r13165 r13169 515 515 if ( ( ! bp_is_network_activated() && ! is_network_admin() ) || ( is_network_admin() && bp_is_network_activated() ) ) { 516 516 517 $signups_menu_label = __( 'Manage Signups', 'buddypress' ); 518 519 if ( bp_get_membership_requests_required() ) { 520 $signups_menu_label = __( 'Manage Pending Memberships', 'buddypress' ); 521 } 522 517 523 // Manage signups. 518 524 $hooks['signups'] = $this->signups_page = add_users_page( 519 __( 'Manage Signups', 'buddypress' ),520 __( 'Manage Signups', 'buddypress' ),525 $signups_menu_label, 526 $signups_menu_label, 521 527 $this->capability, 522 528 'bp-signups', … … 1688 1694 $allowed_actions = apply_filters( 'bp_signups_admin_allowed_actions', array( 'do_delete', 'do_activate', 'do_resend' ) ); 1689 1695 1690 // Prepare the display of the Community Profilescreen.1696 // Prepare the display of the Signups screen. 1691 1697 if ( ! in_array( $doaction, $allowed_actions ) || ( -1 == $doaction ) ) { 1692 1698 … … 1710 1716 ) ); 1711 1717 1718 $signup_help_content = '<p>' . esc_html__( 'Hovering over a row in the pending accounts list will display action links that allow you to manage pending accounts. You can perform the following actions:', 'buddypress' ) . '</p>'; 1719 1720 if ( bp_get_membership_requests_required() ) { 1721 $signup_help_content .= '<ul><li>' . esc_html__( '"Activate" will activate the user immediately without requiring that they validate their email.', 'buddypress' ) .'</li>' . 1722 '<li>' . esc_html__( '"Approve Request" or "Resend Approval" takes you to the confirmation screen before being able to send the activation link to the desired pending request. You can only send the activation email once per day.', 'buddypress' ) . '</li>'; 1723 1724 if ( bp_is_active( 'xprofile' ) ) { 1725 $signup_help_content .= '<li>' . esc_html__( '"Profile Info" will display extended profile information for the request.', 'buddypress' ) . '</li>'; 1726 } 1727 1728 $signup_help_content .= '<li>' . esc_html__( '"Delete" allows you to delete a pending account from your site. You will be asked to confirm this deletion.', 'buddypress' ) . '</li></ul>'; 1729 } else { 1730 $signup_help_content .= '<ul><li>' . esc_html__( '"Email" takes you to the confirmation screen before being able to send the activation link to the desired pending account. You can only send the activation email once per day.', 'buddypress' ) . '</li>' . 1731 '<li>' . __( '"Delete" allows you to delete a pending account from your site. You will be asked to confirm this deletion.', 'buddypress' ) . '</li></ul>'; 1732 } 1733 1734 $signup_help_content .= '<p>' . esc_html__( 'By clicking on a Username you will be able to activate a pending account from the confirmation screen.', 'buddypress' ) . '</p>' . 1735 '<p>' . __( 'Bulk actions allow you to perform these 3 actions for the selected rows.', 'buddypress' ) . '</p>'; 1736 1712 1737 get_current_screen()->add_help_tab( array( 1713 1738 'id' => 'bp-signups-actions', 1714 1739 'title' => __( 'Actions', 'buddypress' ), 1715 'content' => 1716 '<p>' . __( 'Hovering over a row in the pending accounts list will display action links that allow you to manage pending accounts. You can perform the following actions:', 'buddypress' ) . '</p>' . 1717 '<ul><li>' . __( '"Email" takes you to the confirmation screen before being able to send the activation link to the desired pending account. You can only send the activation email once per day.', 'buddypress' ) . '</li>' . 1718 '<li>' . __( '"Delete" allows you to delete a pending account from your site. You will be asked to confirm this deletion.', 'buddypress' ) . '</li></ul>' . 1719 '<p>' . __( 'By clicking on a Username you will be able to activate a pending account from the confirmation screen.', 'buddypress' ) . '</p>' . 1720 '<p>' . __( 'Bulk actions allow you to perform these 3 actions for the selected rows.', 'buddypress' ) . '</p>' 1740 'content' => $signup_help_content 1721 1741 ) ); 1722 1742 1723 1743 // Help panel - sidebar links. 1724 1744 get_current_screen()->set_help_sidebar( 1725 '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' .1745 '<p><strong>' . esc_html__( 'For more information:', 'buddypress' ) . '</strong></p>' . 1726 1746 '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' 1727 1747 ); … … 1736 1756 'heading_list' => __( 'Pending users list', 'buddypress' ), 1737 1757 ) ); 1758 1759 // Use thickbox to display the extended profile information. 1760 if ( bp_is_active( 'xprofile' ) || bp_members_site_requests_enabled() ) { 1761 wp_enqueue_style( 'thickbox' ); 1762 wp_enqueue_script( 1763 'bp-signup-preview', 1764 $this->js_url . 'signup-preview' . bp_core_get_minified_asset_suffix() . '.js', 1765 array( 'bp-thickbox', 'jquery' ), 1766 bp_get_version(), 1767 true 1768 ); 1769 wp_localize_script( 1770 'bp-signup-preview', 1771 'bpSignupPreview', 1772 array( 1773 'modalLabel' => __( 'Profile info preview', 'buddypress' ), 1774 ) 1775 ); 1776 } 1738 1777 1739 1778 } else { … … 2228 2267 2229 2268 case 'resend' : 2230 $header_text = __( 'Resend Activation Emails', 'buddypress' ); 2231 if ( 1 == count( $signup_ids ) ) { 2232 $helper_text = __( 'You are about to resend an activation email to the following account:', 'buddypress' ); 2269 2270 if ( bp_get_membership_requests_required() ) { 2271 $header_text = __( 'Approve Membership Requests', 'buddypress' ); 2272 if ( 1 === count( $signup_ids ) ) { 2273 $helper_text = __( 'You are about to send an approval email to the following user:', 'buddypress' ); 2274 } else { 2275 $helper_text = __( 'You are about to send approval emails to the following users:', 'buddypress' ); 2276 } 2233 2277 } else { 2234 $helper_text = __( 'You are about to resend an activation email to the following accounts:', 'buddypress' ); 2278 $header_text = __( 'Resend Activation Emails', 'buddypress' ); 2279 if ( 1 === count( $signup_ids ) ) { 2280 $helper_text = __( 'You are about to resend an activation email to the following account:', 'buddypress' ); 2281 } else { 2282 $helper_text = __( 'You are about to resend an activation email to the following accounts:', 'buddypress' ); 2283 } 2235 2284 } 2236 2285 break; 2286 2237 2287 } 2238 2288 … … 2263 2313 // Prefetch registration field data. 2264 2314 $fdata = array(); 2265 if ( 'activate' === $action && bp_is_active( 'xprofile') ) {2315 if ( bp_is_active( 'xprofile' ) && ( 'activate' == $action || ( 'resend' == $action && bp_get_membership_requests_required() ) ) ) { 2266 2316 $field_groups = bp_xprofile_get_groups( array( 2267 2317 'exclude_fields' => 1, … … 2287 2337 <ol class="bp-signups-list"> 2288 2338 <?php foreach ( $signups as $signup ) : 2289 $last_notified = mysql2date( 'Y/m/d g:i:s a', $signup->date_sent ); 2339 if ( $signup->count_sent > 0 ) { 2340 $last_notified = mysql2date( 'Y/m/d g:i:s a', $signup->date_sent ); 2341 } else { 2342 $last_notified = __( 'Not yet notified', 'buddypress' ); 2343 } 2290 2344 $profile_field_ids = array(); 2291 2345 … … 2299 2353 <strong><?php echo esc_html( $signup->user_login ) ?></strong> 2300 2354 2301 <?php if ( 'activate' == $action ) : ?>2355 <?php if ( 'activate' == $action || ( 'resend' == $action && bp_get_membership_requests_required() ) ) : ?> 2302 2356 <table class="wp-list-table widefat fixed striped"> 2303 2357 <tbody> … … 2317 2371 <tr> 2318 2372 <td class="column-fields"><?php echo esc_html( $fdata[ $pid ] ); ?></td> 2319 <td><?php echo $this->format_xprofile_field_for_display( $field_value ); ?></td>2373 <td><?php echo bp_members_admin_format_xprofile_field_for_display( $field_value ); ?></td> 2320 2374 </tr> 2321 2375 … … 2623 2677 * 2624 2678 * @since 2.8.0 2679 * @deprecated 10.0.0 2625 2680 * 2626 2681 * @param string|array $value Field value. … … 2628 2683 */ 2629 2684 protected function format_xprofile_field_for_display( $value ) { 2630 if ( is_array( $value ) ) { 2631 $value = array_map( array( $this, 'format_xprofile_field_for_display' ), $value ); 2632 $value = implode( ', ', $value ); 2633 } else { 2634 $value = stripslashes( $value ); 2635 $value = esc_html( $value ); 2636 } 2637 2638 return $value; 2685 _deprecated_function( __METHOD__, '10.0.0', 'bp_members_admin_format_xprofile_field_for_display' ); 2686 2687 return bp_members_admin_format_xprofile_field_for_display( $value ); 2639 2688 } 2640 2689
Note: See TracChangeset
for help on using the changeset viewer.