Skip to:
Content

BuddyPress.org

Changeset 12935


Ignore:
Timestamp:
04/29/2021 03:53:20 PM (3 months ago)
Author:
dcavins
Message:

Member Invites: Add BP Legacy bulk management template parts.

Add the template function
bp_members_invitations_bulk_management_dropdown()
and the JavaScript required to check/uncheck all invites.
Also remove an unneeded empty column from the
legacy pending invites view.

See #8139.

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-functions.php

    r12933 r12935  
    34523452function bp_members_invitation_resend_by_id( $id = 0 ) {
    34533453
    3454     // Find the invitation before deleting it.
     3454    // Find the invitation before resending it.
    34553455    $existing_invite = new BP_Invitation( $id );
    34563456    $invites_class   = new BP_Members_Invitation_Manager();
  • trunk/src/bp-members/bp-members-template.php

    r12933 r12935  
    34783478        return apply_filters( 'bp_get_members_invitations_send_invites_permalink', $retval, $user_id );
    34793479    }
     3480
     3481/**
     3482 * Output the dropdown for bulk management of invitations.
     3483 *
     3484 * @since 8.0.0
     3485 */
     3486function bp_members_invitations_bulk_management_dropdown() {
     3487    ?>
     3488    <label class="bp-screen-reader-text" for="invitation-select">
     3489        <?php
     3490        esc_html_e( 'Select Bulk Action', 'buddypress' );
     3491        ?>
     3492    </label>
     3493
     3494    <select name="invitation_bulk_action" id="invitation-select">
     3495        <option value="" selected="selected"><?php esc_html_e( 'Bulk Actions', 'buddypress' ); ?></option>
     3496        <option value="resend"><?php echo esc_html_x( 'Resend', 'button', 'buddypress' ); ?></option>
     3497        <option value="cancel"><?php echo esc_html_x( 'Cancel', 'button', 'buddypress' ); ?></option>
     3498    </select>
     3499
     3500    <input type="submit" id="invitation-bulk-manage" class="button action" value="<?php echo esc_attr_x( 'Apply', 'button', 'buddypress' ); ?>">
     3501    <?php
     3502}
  • trunk/src/bp-templates/bp-legacy/buddypress/members/single/invitations/invitations-loop.php

    r12922 r12935  
    1313        <thead>
    1414            <tr>
    15                 <th class="icon"></th>
    1615                <th class="bulk-select-all"><input id="select-all-invitations" type="checkbox">
    1716                    <label class="bp-screen-reader-text" for="select-all-invitations">
     
    3635
    3736                <tr>
    38                     <td></td>
    3937                    <td class="bulk-select-check">
    4038                        <label for="<?php bp_the_members_invitation_property( 'id', 'attribute' ); ?>">
     
    6260
    6361    <div class="invitations-options-nav">
    64         <?php // @TODO //bp_invitations_bulk_management_dropdown(); ?>
     62        <?php bp_members_invitations_bulk_management_dropdown(); ?>
    6563    </div><!-- .invitations-options-nav -->
    6664
  • trunk/src/bp-templates/bp-legacy/js/buddypress.js

    r12856 r12935  
    16101610    jq('#notification-select').on('change', function(){
    16111611        jq('#notification-bulk-manage').attr('disabled', jq(this).val().length <= 0);
     1612    });
     1613
     1614    /** Members Invitations *****************************************/
     1615
     1616    /* Selecting/Deselecting all invitations */
     1617    jq( '#select-all-invitations' ).on( 'click', function() {
     1618        if ( this.checked ) {
     1619            jq( '.invitation-check' ).each( function() {
     1620                this.checked = true;
     1621            } );
     1622        } else {
     1623            jq( '.invitation-check' ).each( function() {
     1624                this.checked = false;
     1625            } );
     1626        }
     1627    } );
     1628
     1629    /* Make sure a 'Bulk Action' is selected before submitting the form */
     1630    jq('#invitation-bulk-manage').attr('disabled', 'disabled');
     1631
     1632    /* Remove the disabled attribute from the form submit button when bulk action has a value */
     1633    jq('#invitation-select').on('change', function(){
     1634        jq('#invitation-bulk-manage').attr('disabled', jq(this).val().length <= 0);
    16121635    });
    16131636
Note: See TracChangeset for help on using the changeset viewer.