Skip to:
Content

BuddyPress.org

Changeset 4667


Ignore:
Timestamp:
07/16/2011 10:34:49 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Add 'View' link to each enabled and populated BuddyPress component in Pages settings

File:
1 edited

Legend:

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

    r4666 r4667  
    196196    global $wpdb, $bp;
    197197
    198     if ( isset( $_POST['bp-admin-pages-submit'] ) ) {
    199         if ( !check_admin_referer('bp-admin-pages-setup') )
     198    if ( isset( $_POST['bp-admin-pages-submit'] ) || isset( $_POST['bp-admin-pages-single'] ) ) {
     199        if ( !check_admin_referer( 'bp-admin-pages-setup' ) )
    200200            return false;
    201201
     
    307307
    308308            <p class="submit clear">
    309                 <input class="button-primary" type="submit" name="bp-admin-page-submit" id="bp-admin-page-submit" value="<?php _e( 'Save All', 'buddypress' ) ?>"/>
     309                <input class="button-primary" type="submit" name="bp-admin-pages-submit" id="bp-admin-pages-submit" value="<?php _e( 'Save All', 'buddypress' ) ?>"/>
    310310            </p>
    311311
     
    487487        'forums'   => __( 'Discussion Forums', 'buddypress' ),
    488488    );
    489    
     489
    490490    if ( is_multisite() )
    491491        $directory_pages['blogs'] = __( "Site Directory", 'buddypress' ); ?>
     
    515515
    516516                        <a href="<?php echo admin_url( add_query_arg( array( 'post_type' => 'page' ), 'post-new.php' ) ); ?>" class="button-secondary"><?php _e( 'New Page' ); ?></a>
    517                         <input class="button-primary" type="submit" value="<?php _e( 'Save', 'buddypress' ) ?>" />
     517                        <input class="button-primary" type="submit" name="bp-admin-pages-single" value="<?php _e( 'Save', 'buddypress' ) ?>" />
     518
     519                        <?php if ( !empty( $existing_pages[$name] ) ) : ?>
     520
     521                            <a href="<?php echo get_permalink( $existing_pages[$name] ); ?>" class="button-secondary" target="_bp"><?php _e( 'View' ); ?></a>
     522
     523                        <?php endif; ?>
     524
    518525                    </td>
    519526                </tr>
     
    558565
    559566                        <a href="<?php echo admin_url( add_query_arg( array( 'post_type' => 'page' ), 'post-new.php' ) ); ?>" class="button-secondary"><?php _e( 'New Page' ); ?></a>
    560                         <input class="button-primary" type="submit" value="<?php _e( 'Save', 'buddypress' ) ?>" />
     567                        <input class="button-primary" type="submit" name="bp-admin-pages-single" value="<?php _e( 'Save', 'buddypress' ) ?>" />
     568
     569                        <?php if ( !empty( $existing_pages[$name] ) ) : ?>
     570
     571                            <a href="<?php echo get_permalink( $existing_pages[$name] ); ?>" class="button-secondary" target="_bp"><?php _e( 'View' ); ?></a>
     572
     573                        <?php endif; ?>
     574
    561575                    </td>
    562576                </tr>
Note: See TracChangeset for help on using the changeset viewer.