Skip to:
Content

BuddyPress.org

Changeset 13169


Ignore:
Timestamp:
12/10/2021 04:14:51 PM (22 months ago)
Author:
dcavins
Message:

Manage Signups Screen: Change labels and behavior for requests.

Change many labels in the WP Admin Signups Screen
to reflect the membership requests capability when enabled.

Add new "Profile Info" action link to User List Tables
so that the site admin can see submitted extended profile
info and any blog requests.

See #8582.

Location:
trunk/src
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/admin/js/hello.js

    r13140 r13169  
    2020
    2121        window.tb_show( 'BuddyPress', '#TB_inline?inlineId=bp-hello-container' );
    22 
    23         $( '#TB_window' ).attr( {
    24                             'role': 'dialog',
    25                             'aria-label': bpHelloStrings.modalLabel
    26                         } )
    27                         .addClass( 'plugin-details-modal' )
    28                         .removeClass( 'thickbox-loading' );
    29 
    30         $( '#TB_ajaxContent' ).prop( 'style', 'height: 100%; width: auto; padding: 0; border: none;' );
    31 
    32         var tabbables = $( ':tabbable', '#TB_ajaxContent' ), lastTabbable = tabbables.last();
    33 
    34         // Move the focus to the Modal's close button once the last Hello link was tabbed out.
    35         $( '#TB_window' ).on( 'keydown', function( event ) {
    36             if ( 9 === event.keyCode && ! event.shiftKey && $( lastTabbable ).prop( 'classList' ).value === $( event.target ).prop( 'classList' ).value ) {
    37                 event.preventDefault();
    38 
    39                 $( '#TB_closeWindowButton' ).focus();
    40             }
    41 
    42             if ( 9 === event.keyCode && event.shiftKey && 'TB_closeWindowButton' === $( event.target ).prop( 'id' ) ) {
    43                 event.preventDefault();
    44 
    45                 $( lastTabbable ).focus();
    46             }
    47         } );
     22        window.bpAdjustThickbox( bpHelloStrings.modalLabel );
    4823    };
    4924
  • trunk/src/bp-core/classes/class-bp-admin.php

    r13166 r13169  
    12961296            ),
    12971297
     1298            // 10.0
     1299            'bp-thickbox' => array(
     1300                'file'         => "{$url}bp-thickbox{$min}.js",
     1301                'dependencies' => array( 'thickbox' ),
     1302                'footer'       => true,
     1303            ),
     1304
    12981305            // 3.0
    12991306            'bp-hello-js' => array(
    13001307                'file'         => "{$url}hello{$min}.js",
    1301                 'dependencies' => array( 'thickbox', 'wp-api-request' ),
     1308                'dependencies' => array( 'bp-thickbox', 'wp-api-request' ),
    13021309                'footer'       => true,
    13031310            ),
  • trunk/src/bp-members/bp-members-admin.php

    r13131 r13169  
    113113}
    114114add_filter( 'term_updated_messages', 'bp_members_type_admin_updated_messages' );
     115
     116/**
     117 * Formats xprofile field data about a signup/membership request for display.
     118 *
     119 * Operates recursively on arrays, which are then imploded with commas.
     120 *
     121 * @since 10.0.0
     122 *
     123 * @param string|array $value Field value.
     124 */
     125function bp_members_admin_format_xprofile_field_for_display( $value ) {
     126    if ( is_array( $value ) ) {
     127        $value = array_map( 'bp_signup_format_xprofile_field_for_display', $value );
     128        $value = implode( ', ', $value );
     129    } else {
     130        $value = stripslashes( $value );
     131        $value = esc_html( $value );
     132    }
     133
     134    return $value;
     135}
     136
     137/**
     138 * Outputs Informations about a signup/membership request into a modal inside the Signups Admin Screen.
     139 *
     140 * @since 10.0.0
     141 *
     142 * @param array $signup_field_labels The Signup field labels.
     143 * @param object|null $signup_object The signup data object.
     144 */
     145function bp_members_admin_preview_signup_profile_info( $signup_field_labels = array(), $signup_object = null ) {
     146
     147    ?>
     148    <div id="signup-info-modal-<?php echo $signup_object->id; ?>" style="display:none;">
     149        <h1><?php printf( '%1$s (%2$s)', esc_html( $signup_object->user_name ), esc_html( $signup_object->user_email ) ); ?></h1>
     150
     151        <?php if ( bp_is_active( 'xprofile' ) && isset( $signup_object->meta ) && $signup_field_labels ) :
     152                // Init ids.
     153                $profile_field_ids = array();
     154
     155                // Get all xprofile field IDs except field 1.
     156                if ( ! empty( $signup_object->meta['profile_field_ids'] ) ) {
     157                    $profile_field_ids = array_flip( explode( ',', $signup_object->meta['profile_field_ids'] ) );
     158                    unset( $profile_field_ids[1] );
     159                }
     160            ?>
     161            <h2><?php esc_html_e( 'Extended Profile Information', 'buddypress' ); ?></h2>
     162
     163            <table class="signup-profile-data-drawer wp-list-table widefat fixed striped">
     164                <?php if ( 1 <= count( $profile_field_ids ) ): foreach ( array_keys( $profile_field_ids ) as $profile_field_id ) :
     165                    $field_value = isset( $signup_object->meta[ "field_{$profile_field_id}" ] ) ? $signup_object->meta[ "field_{$profile_field_id}" ] : ''; ?>
     166                    <tr>
     167                        <td class="column-fields"><?php echo esc_html( $signup_field_labels[ $profile_field_id ] ); ?></td>
     168                        <td><?php echo bp_members_admin_format_xprofile_field_for_display( $field_value ); ?></td>
     169                    </tr>
     170                <?php endforeach; else: ?>
     171                    <tr>
     172                        <td><?php esc_html_e( 'There is no additional information to display.', 'buddypress' ); ?></td>
     173                    </tr>
     174                <?php endif; ?>
     175            </table>
     176        <?php endif; ?>
     177
     178        <?php if ( bp_members_site_requests_enabled() ) : ?>
     179            <h2><?php esc_html_e( 'Site Request Information', 'buddypress' ); ?></h2>
     180            <table class="signup-profile-data-drawer wp-list-table widefat fixed striped">
     181                <?php if ( ! empty( $signup_object->domain ) || ! empty( $signup_object->path ) ) : ?>
     182                    <tr>
     183                        <td class="column-fields"><?php esc_html_e( 'Site Title', 'buddypress' ); ?></td>
     184                        <td><?php echo esc_html( $signup_object->title ); ?></td>
     185                    </tr>
     186                    <tr>
     187                        <td class="column-fields"><?php esc_html_e( 'Domain', 'buddypress' ); ?></td>
     188                        <td><?php echo esc_html( $signup_object->domain ); ?></td>
     189                    </tr>
     190                    <tr>
     191                        <td class="column-fields"><?php esc_html_e( 'Path', 'buddypress' ); ?></td>
     192                        <td><?php echo esc_html( $signup_object->path ); ?></td>
     193                    </tr>
     194                <?php else : ?>
     195                    <tr>
     196                        <td><?php esc_html_e( 'This user has not requested a blog.', 'buddypress' ); ?></td>
     197                    </tr>
     198                <?php endif; ?>
     199            </table>
     200        <?php endif; ?>
     201    </div>
     202    <?php
     203}
  • trunk/src/bp-members/bp-members-membership-requests.php

    r13168 r13169  
    259259add_action( 'bp_core_signup_after_delete',   'bp_members_membership_requests_delete_notifications_on_change' );
    260260
     261/**
     262 * Administration: Change certain behavior and labels
     263 * on the WP Admin > Users > Manage Signups screen.
     264 *********************************************************************/
     265
     266/**
     267 * Filter the actions available on the signups list table.
     268 *
     269 * @since 10.0.0
     270 *
     271 * @param array  $actions       Array of actions and corresponding links.
     272 * @param object $signup_object The signup data object.
     273 */
     274function bp_members_membership_requests_filter_signup_row_actions( $actions, $signup_object ) {
     275
     276    // Rename the "email" resend option when membership requests are active.
     277    $email_link = add_query_arg(
     278        array(
     279            'page'      => 'bp-signups',
     280            'signup_id' => $signup_object->id,
     281            'action'    => 'resend',
     282        ),
     283        bp_get_admin_url( 'users.php' )
     284    );
     285
     286    $resend_label = ( 0 === $signup_object->count_sent ) ? __( 'Approve Request', 'buddypress' ) : __( 'Resend Approval', 'buddypress' );
     287
     288    $actions['resend'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link ), esc_html( $resend_label ) );
     289
     290    // Add a link to view profile info when membership requests and xprofile are active.
     291    if ( bp_is_active( 'xprofile' ) || bp_members_site_requests_enabled() ) {
     292        $profile_link = add_query_arg(
     293            array(
     294                'page'     => 'bp-signups#TB_inline',
     295                'inlineId' => 'signup-info-modal-' . $signup_object->id,
     296            ),
     297            bp_get_admin_url( 'users.php' )
     298        );
     299
     300        $actions['profile'] = sprintf( '<a href="%1$s" class="bp-thickbox">%2$s</a>', esc_url( $profile_link ), esc_html__( 'Profile Info', 'buddypress' ) );
     301    }
     302
     303    return $actions;
     304}
     305add_filter( 'bp_members_ms_signup_row_actions', 'bp_members_membership_requests_filter_signup_row_actions', 10, 2 );
     306
     307/**
     308 * Filter the bulk actions available on the signups list table.
     309 *
     310 * @since 10.0.0
     311 *
     312 * @param array $actions Array of actions and corresponding links.
     313 * @return array         List of actions and corresponding links.
     314 */
     315function bp_members_membership_requests_filter_signup_bulk_actions( $actions ) {
     316    // Rename the "email" resend option when membership requests are active.
     317    $actions['resend'] = esc_html_x( 'Approve', 'Pending signup action', 'buddypress' );
     318    return $actions;
     319}
     320add_filter( 'bp_members_ms_signup_bulk_actions', 'bp_members_membership_requests_filter_signup_bulk_actions' );
     321
     322/**
     323 * Filter the "Last Sent" column header on the pending users table.
     324 *
     325 * @since 10.0.0
     326 *
     327 * @param array $columns Array of columns to display.
     328 * @return array List of columns to display.
     329 */
     330function bp_members_membership_requests_filter_signup_table_date_sent_header( $columns ) {
     331    $columns['date_sent'] = esc_html__( 'Approved', 'buddypress' );
     332    return $columns;
     333}
     334add_filter( 'bp_members_signup_columns', 'bp_members_membership_requests_filter_signup_table_date_sent_header' );
     335add_filter( 'bp_members_ms_signup_columns', 'bp_members_membership_requests_filter_signup_table_date_sent_header' );
     336
     337/**
     338 * Filter the "Last Sent" column message on the pending users table.
     339 *
     340 * @since 10.0.0
     341 *
     342 * @param string      $message "Not yet sent" message.
     343 * @param object|null $signup  Signup object instance.
     344 * @return string              "Not yet approved" message, if needed. Unchanged message otherwise.
     345 */
     346function bp_members_membership_requests_filter_signup_table_unsent_message( $message, $signup ) {
     347    if ( 0 === $signup->count_sent ) {
     348        $message = esc_html__( 'Not yet approved', 'buddypress' );
     349    }
     350
     351    return $message;
     352}
     353add_filter( 'bp_members_signup_date_sent_unsent_message', 'bp_members_membership_requests_filter_signup_table_unsent_message', 10, 2 );
     354add_filter( 'bp_members_ms_signup_date_sent_unsent_message', 'bp_members_membership_requests_filter_signup_table_unsent_message', 10, 2 );
     355
  • trunk/src/bp-members/classes/class-bp-members-admin.php

    r13165 r13169  
    515515        if ( ( ! bp_is_network_activated() && ! is_network_admin() ) || ( is_network_admin() && bp_is_network_activated() ) ) {
    516516
     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
    517523            // Manage signups.
    518524            $hooks['signups'] = $this->signups_page = add_users_page(
    519                 __( 'Manage Signups',  'buddypress' ),
    520                 __( 'Manage Signups',  'buddypress' ),
     525                $signups_menu_label,
     526                $signups_menu_label,
    521527                $this->capability,
    522528                'bp-signups',
     
    16881694        $allowed_actions = apply_filters( 'bp_signups_admin_allowed_actions', array( 'do_delete', 'do_activate', 'do_resend' ) );
    16891695
    1690         // Prepare the display of the Community Profile screen.
     1696        // Prepare the display of the Signups screen.
    16911697        if ( ! in_array( $doaction, $allowed_actions ) || ( -1 == $doaction ) ) {
    16921698
     
    17101716            ) );
    17111717
     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
    17121737            get_current_screen()->add_help_tab( array(
    17131738                'id'      => 'bp-signups-actions',
    17141739                '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
    17211741            ) );
    17221742
    17231743            // Help panel - sidebar links.
    17241744            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>' .
    17261746                '<p>' . __( '<a href="https://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>'
    17271747            );
     
    17361756                'heading_list'       => __( 'Pending users list', 'buddypress' ),
    17371757            ) );
     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            }
    17381777
    17391778        } else {
     
    22282267
    22292268            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                    }
    22332277                } 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                    }
    22352284                }
    22362285                break;
     2286
    22372287        }
    22382288
     
    22632313        // Prefetch registration field data.
    22642314        $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() ) ) ) {
    22662316            $field_groups = bp_xprofile_get_groups( array(
    22672317                'exclude_fields'    => 1,
     
    22872337            <ol class="bp-signups-list">
    22882338            <?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                }
    22902344                $profile_field_ids = array();
    22912345
     
    22992353                    <strong><?php echo esc_html( $signup->user_login ) ?></strong>
    23002354
    2301                     <?php if ( 'activate' == $action ) : ?>
     2355                    <?php if ( 'activate' == $action || ( 'resend' == $action && bp_get_membership_requests_required() ) ) : ?>
    23022356                        <table class="wp-list-table widefat fixed striped">
    23032357                            <tbody>
     
    23172371                                        <tr>
    23182372                                            <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>
    23202374                                        </tr>
    23212375
     
    26232677     *
    26242678     * @since 2.8.0
     2679     * @deprecated 10.0.0
    26252680     *
    26262681     * @param string|array $value Field value.
     
    26282683     */
    26292684    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 );
    26392688    }
    26402689
  • trunk/src/bp-members/classes/class-bp-members-list-table.php

    r12591 r13169  
    2828
    2929    /**
     30     * Signup profile fields.
     31     *
     32     * @since 10.0.0
     33     *
     34     * @var array
     35     */
     36    public $signup_field_labels = array();
     37
     38    /**
    3039     * Constructor.
    3140     *
     
    139148    public function get_columns() {
    140149
    141         /**
    142          * Filters the single site Members signup columns.
    143          *
    144          * @since 2.0.0
    145          *
    146          * @param array $value Array of columns to display.
    147          */
    148         return apply_filters( 'bp_members_signup_columns', array(
     150        $columns = array(
    149151            'cb'         => '<input type="checkbox" />',
    150152            'username'   => __( 'Username',    'buddypress' ),
     
    154156            'date_sent'  => __( 'Last Sent',   'buddypress' ),
    155157            'count_sent' => __( 'Emails Sent', 'buddypress' )
    156         ) );
     158        );
     159
     160        /**
     161         * Filters the single site Members signup columns.
     162         *
     163         * @since 2.0.0
     164         *
     165         * @param array $value Array of columns to display.
     166         */
     167        return apply_filters( 'bp_members_signup_columns', $columns );
    157168    }
    158169
     
    172183        }
    173184
    174         return $actions;
     185        /**
     186         * Filters the bulk actions for signups.
     187         *
     188         * @since 10.0.0
     189         *
     190         * @param array $actions Array of actions and corresponding labels.
     191         */
     192        return apply_filters( 'bp_members_ms_signup_bulk_actions', $actions );
    175193    }
    176194
     
    184202    public function no_items() {
    185203
    186         if ( bp_get_signup_allowed() ) {
     204        if ( bp_get_signup_allowed() || bp_get_membership_requests_required() ) {
    187205            esc_html_e( 'No pending accounts found.', 'buddypress' );
    188206        } else {
     
    343361    public function column_name( $signup_object = null ) {
    344362        echo esc_html( $signup_object->user_name );
     363
     364        // Insert the extended profile modal content required by thickbox.
     365        if ( ! bp_is_active( 'xprofile' ) ) {
     366            return;
     367        }
     368
     369        $profile_field_ids = array();
     370
     371        // Fetch registration field data once only.
     372        if ( ! $this->signup_field_labels ) {
     373            $field_groups = bp_xprofile_get_groups(
     374                array(
     375                    'fetch_fields'       => true,
     376                    'signup_fields_only' => true,
     377                )
     378            );
     379
     380            foreach ( $field_groups as $field_group ) {
     381                foreach ( $field_group->fields as $field ) {
     382                    $this->signup_field_labels[ $field->id ] = $field->name;
     383                }
     384            }
     385        }
     386
     387        bp_members_admin_preview_signup_profile_info( $this->signup_field_labels, $signup_object );
    345388    }
    346389
     
    364407     */
    365408    public function column_registered( $signup_object = null ) {
    366         echo mysql2date( 'Y/m/d', $signup_object->registered );
     409        echo mysql2date( 'Y/m/d g:i:s a', $signup_object->registered );
    367410    }
    368411
     
    375418     */
    376419    public function column_date_sent( $signup_object = null ) {
    377         echo mysql2date( 'Y/m/d', $signup_object->date_sent );
    378     }
    379 
    380     /**
    381      * Display number of time an activation email has been sent.
     420        if ( $signup_object->count_sent > 0 ) {
     421            echo mysql2date( 'Y/m/d g:i:s a', $signup_object->date_sent );
     422        } else {
     423            $message = __( 'Not yet notified', 'buddypress' );
     424
     425            /**
     426             * Filters the "not yet sent" message for "Last Sent"
     427             * column in Manage Signups list table.
     428             *
     429             * @since 10.0.0
     430             *
     431             * @param string      $message       "Not yet sent" message.
     432             * @param object|null $signup_object Signup object instance.
     433             */
     434            $message = apply_filters( 'bp_members_signup_date_sent_unsent_message', $message, $signup_object );
     435
     436            echo esc_html( $message );
     437        }
     438    }
     439
     440    /**
     441     * Display number of times an activation email has been sent.
    382442     *
    383443     * @since 2.0.0
  • trunk/src/bp-members/classes/class-bp-members-ms-list-table.php

    r12591 r13169  
    2828
    2929    /**
     30     * Signup profile fields.
     31     *
     32     * @since 10.0.0
     33     *
     34     * @var array
     35     */
     36    public $signup_field_labels = array();
     37
     38    /**
    3039     * Constructor.
    3140     *
     
    115124        // Reset the screen id.
    116125        $this->screen->id = $reset_screen_id;
     126
     127        // Use thickbox to display the extended profile information.
     128        if ( bp_is_active( 'xprofile' ) || bp_members_site_requests_enabled() ) {
     129            add_thickbox();
     130        }
    117131    }
    118132
     
    126140    public function get_columns() {
    127141
    128         /**
    129          * Filters the multisite Members signup columns.
    130          *
    131          * @since 2.0.0
    132          *
    133          * @param array $value Array of columns to display.
    134          */
    135         return apply_filters( 'bp_members_ms_signup_columns', array(
     142        $columns = array(
    136143            'cb'         => '<input type="checkbox" />',
    137144            'username'   => __( 'Username',    'buddypress' ),
     
    141148            'date_sent'  => __( 'Last Sent',   'buddypress' ),
    142149            'count_sent' => __( 'Emails Sent', 'buddypress' )
    143         ) );
     150        );
     151
     152        /**
     153         * Filters the multisite Members signup columns.
     154         *
     155         * @since 2.0.0
     156         *
     157         * @param array $value Array of columns to display.
     158         */
     159        return apply_filters( 'bp_members_ms_signup_columns', $columns );
    144160    }
    145161
     
    159175        }
    160176
    161         return $actions;
     177        /**
     178         * Filters the bulk actions for signups.
     179         *
     180         * @since 10.0.0
     181         *
     182         * @param array $actions Array of actions and corresponding labels.
     183         */
     184        return apply_filters( 'bp_members_ms_signup_bulk_actions', $actions );
    162185    }
    163186
     
    170193     */
    171194    public function no_items() {
    172         if ( bp_get_signup_allowed() ) {
     195        if ( bp_get_signup_allowed() || bp_get_membership_requests_required() ) {
    173196            esc_html_e( 'No pending accounts found.', 'buddypress' );
    174197        } else {
     
    329352    public function column_name( $signup_object = null ) {
    330353        echo esc_html( $signup_object->user_name );
     354
     355        // Insert the extended profile modal content required by thickbox.
     356        if ( ! bp_is_active( 'xprofile' ) && ! bp_members_site_requests_enabled() ) {
     357            return;
     358        }
     359
     360        if ( bp_is_active( 'xprofile' ) ) {
     361            $profile_field_ids = array();
     362
     363            // Fetch registration field data once only.
     364            if ( ! $this->signup_field_labels ) {
     365                $field_groups = bp_xprofile_get_groups(
     366                    array(
     367                        'fetch_fields'       => true,
     368                        'signup_fields_only' => true,
     369                    )
     370                );
     371
     372                foreach ( $field_groups as $field_group ) {
     373                    foreach ( $field_group->fields as $field ) {
     374                        $this->signup_field_labels[ $field->id ] = $field->name;
     375                    }
     376                }
     377            }
     378        }
     379
     380        bp_members_admin_preview_signup_profile_info( $this->signup_field_labels, $signup_object );
    331381    }
    332382
     
    377427        }
    378428
    379         echo mysql2date( $date, $signup_object->date_sent );
     429        if ( $signup_object->count_sent > 0 ) {
     430            echo mysql2date( $date, $signup_object->date_sent );
     431        } else {
     432            $message = __( 'Not yet notified', 'buddypress' );
     433
     434            /**
     435             * Filters the "not yet sent" message for "Last Sent"
     436             * column in Manage Signups list table.
     437             *
     438             * @since 10.0.0
     439             *
     440             * @param string      $message       "Not yet sent" message.
     441             * @param object|null $signup_object Signup object instance.
     442             */
     443            $message = apply_filters( 'bp_members_ms_signup_date_sent_unsent_message', $message, $signup_object );
     444
     445            echo esc_html( $message );
     446        }
    380447    }
    381448
Note: See TracChangeset for help on using the changeset viewer.