Skip to:
Content

BuddyPress.org

Changeset 11801


Ignore:
Timestamp:
01/05/2018 08:24:06 PM (6 years ago)
Author:
slaffik
Message:

Administration: Ability to bulk select/deselect components.

The bulk selection checkbox for components was disabled. This commit enables it, plus makes every component name clickable, that checks appropriate component.

Props pavlo.opanasenko.
Fixes #7541.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/admin/bp-core-admin-components.php

    r11763 r11801  
    166166        <thead>
    167167            <tr>
    168                 <td id="cb" class="manage-column column-cb check-column"><input id="cb-select-all-1" type="checkbox" disabled><label class="screen-reader-text" for="cb-select-all-1"><?php
     168                <td id="cb" class="manage-column column-cb check-column"><input id="cb-select-all-1" type="checkbox" <?php checked( empty( $inactive_components ) ); ?>>
     169                    <label class="screen-reader-text" for="cb-select-all-1"><?php
    169170                    /* translators: accessibility text */
    170                     _e( 'Bulk selection is disabled', 'buddypress' );
     171                    _e( 'Enable or disable all optional components in bulk', 'buddypress' );
    171172                ?></label></td>
    172173                <th scope="col" id="name" class="manage-column column-title column-primary"><?php _e( 'Component', 'buddypress' ); ?></th>
     
    196197                                    printf( __( 'Select %s', 'buddypress' ), esc_html( $labels['title'] ) ); ?></label>
    197198
    198                             <?php else : ?>
    199 
    200                                 <input type="checkbox" id="<?php echo esc_attr( "bp_components[$name]" ); ?>" name="<?php echo esc_attr( "bp_components[$name]" ); ?>" value="1" checked="checked" disabled><label for="<?php echo esc_attr( "bp_components[$name]" ); ?>" class="screen-reader-text"><?php
    201                                     /* translators: accessibility text */
    202                                     printf( __( '%s is a required component', 'buddypress' ), esc_html( $labels['title'] ) ); ?></label>
    203 
    204199                            <?php endif; ?>
    205200
    206201                        </th>
    207202                        <td class="plugin-title column-primary">
    208                             <span aria-hidden="true"></span>
    209                             <strong><?php echo esc_html( $labels['title'] ); ?></strong>
     203                            <?php if ( !in_array( $name, array( 'core', 'members' ) ) ) : ?>
     204
     205                                <label for="<?php echo esc_attr( "bp_components[$name]" ); ?>" aria-label="<?php
     206                                /* translators: accessibility text */
     207                                printf( __( 'Select %s', 'buddypress' ), esc_html( $labels['title'] ) ); ?>">
     208                                    <span aria-hidden="true"></span>
     209                                    <strong><?php echo esc_html( $labels['title'] ); ?></strong>
     210                                </label>
     211
     212                            <?php else: ?>
     213
     214                                <span aria-hidden="true"></span>
     215                                <strong><?php echo esc_html( $labels['title'] ); ?></strong>
     216
     217                            <?php endif; ?>
    210218                        </td>
    211219
     
    232240        <tfoot>
    233241            <tr>
    234                 <td class="manage-column column-cb check-column"><input id="cb-select-all-2" type="checkbox" disabled><label class="screen-reader-text" for="cb-select-all-2"><?php
     242                <td class="manage-column column-cb check-column"><input id="cb-select-all-2" type="checkbox" <?php checked( empty( $inactive_components ) ); ?>>
     243                    <label class="screen-reader-text" for="cb-select-all-2"><?php
    235244                    /* translators: accessibility text */
    236                     _e( 'Bulk selection is disabled', 'buddypress' );
     245                    _e( 'Enable or disable all optional components in bulk', 'buddypress' );
    237246                ?></label></td>
    238247                <th class="manage-column column-title column-primary"><?php _e( 'Component', 'buddypress' ); ?></th>
Note: See TracChangeset for help on using the changeset viewer.