Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/09/2011 05:32:00 PM (15 years ago)
Author:
boonebgorges
Message:

Adds warning notices to Dashboard when required BP component directory pages are missing. Fixes #3026. Adds warning notices to Dashboard when bp-pages are present but the corresponding component is deactivated. Fixes #3025. Removes root_slug declaration from components that should not have top-level directories.

File:
1 edited

Legend:

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

    r4175 r4183  
    359359    <h3><?php _e( 'Directory Pages', 'buddypress' ); ?></h3>
    360360   
    361     <p><?php _e( 'Choose a WordPress Page to associate with each BuddyPress component directory. Setting to "None" will render that page inaccessible.', 'buddypress' ); ?></p>
     361    <p><?php _e( 'Choose a WordPress Page to associate with each BuddyPress component directory. Deactivated components should be set to "None".', 'buddypress' ); ?></p>
    362362
    363363    <table class="form-table">
     
    365365
    366366            <?php foreach ( $directory_pages as $name => $label ) : ?>
    367 
    368                 <?php if ( bp_is_active( $name ) ) : ?>
    369 
    370                     <tr valign="top">
    371                         <th scope="row">
    372                             <label for="bp_pages[<?php echo esc_attr( $name ) ?>]"><?php echo esc_html( $label ) ?></label>
    373                         </th>
    374 
    375                         <td>
    376                             <?php echo wp_dropdown_pages( array(
    377                                 'name'             => 'bp_pages[' . esc_attr( $name ) . ']',
    378                                 'echo'             => false,
    379                                 'show_option_none' => __( '- None -', 'buddypress' ),
    380                                 'selected'         => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
    381                             ) ) ?>
    382                         </td>
    383                     </tr>
    384 
    385                 <?php endif; ?>
    386 
    387             <?php endforeach ?>
    388 
    389             <?php do_action( 'bp_active_external_directories' ); ?>
    390 
    391         </tbody>
    392     </table>
    393    
    394     <?php
    395 
    396     // Static pages
    397     $static_pages = array(
    398         'register' => __( 'Sign up Page',    'buddypress' ),
    399         'activate' => __( 'Activation Page', 'buddypress' ),
    400     ); ?>
    401 
    402     <h3><?php _e( 'Other Pages', 'buddypress' ); ?></h3>
    403 
    404     <p><?php _e( 'Associate WordPress Pages with the following BuddyPress pages. Setting to "None" will render that page inaccessible.', 'buddypress' ); ?></p>
    405 
    406     <table class="form-table">
    407         <tbody>
    408 
    409             <?php foreach ( $static_pages as $name => $label ) : ?>
    410 
     367                <?php $disabled = !bp_is_active( $name ) ? ' disabled="disabled"' : ''; ?>
     368               
    411369                <tr valign="top">
    412370                    <th scope="row">
    413                         <label for="bp_pages[<?php echo esc_attr( $name ) ?>]"><?php echo esc_html( $label ) ?></label>
     371                        <label for="bp_pages[<?php echo esc_attr( $name ) ?>]"><?php echo esc_html( $label ) ?><?php if ( !bp_is_active( $name ) ) : ?> <span class="description">(deactivated)</span><?php endif ?></label>
    414372                    </th>
    415373
     
    424382                </tr>
    425383
     384
     385            <?php endforeach ?>
     386
     387            <?php do_action( 'bp_active_external_directories' ); ?>
     388
     389        </tbody>
     390    </table>
     391   
     392    <?php
     393
     394    // Static pages
     395    $static_pages = array(
     396        'register' => __( 'Sign up Page',    'buddypress' ),
     397        'activate' => __( 'Activation Page', 'buddypress' ),
     398    ); ?>
     399
     400    <h3><?php _e( 'Other Pages', 'buddypress' ); ?></h3>
     401
     402    <p><?php _e( 'Associate WordPress Pages with the following BuddyPress pages. Setting to "None" will render that page inaccessible.', 'buddypress' ); ?></p>
     403
     404    <table class="form-table">
     405        <tbody>
     406
     407            <?php foreach ( $static_pages as $name => $label ) : ?>
     408
     409                <tr valign="top">
     410                    <th scope="row">
     411                        <label for="bp_pages[<?php echo esc_attr( $name ) ?>]"><?php echo esc_html( $label ) ?></label>
     412                    </th>
     413
     414                    <td>
     415                        <?php echo wp_dropdown_pages( array(
     416                            'name'             => 'bp_pages[' . esc_attr( $name ) . ']',
     417                            'echo'             => false,
     418                            'show_option_none' => __( '- None -', 'buddypress' ),
     419                            'selected'         => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
     420                        ) ) ?>
     421                    </td>
     422                </tr>
     423
    426424            <?php endforeach ?>
    427425
Note: See TracChangeset for help on using the changeset viewer.