Skip to:
Content

BuddyPress.org

Changeset 4649


Ignore:
Timestamp:
07/12/2011 02:49:17 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Audit the usage of $bp->groups->root_slug. See #3325.

Location:
trunk
Files:
5 edited

Legend:

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

    r4631 r4649  
    482482            <?php if ( bp_is_active( 'groups' ) ) : ?>
    483483
    484                 <li class="alt"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . $bp->groups->root_slug ) . '?random-group' ?>"  rel="nofollow"><?php _e( 'Random Group', 'buddypress' ) ?></a></li>
     484                <li class="alt"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '?random-group' ?>"  rel="nofollow"><?php _e( 'Random Group', 'buddypress' ) ?></a></li>
    485485
    486486            <?php endif; ?>
  • trunk/bp-core/bp-core-functions.php

    r4638 r4649  
    837837
    838838            case 'groups':
    839                 $slug = bp_is_active( 'groups' ) ? $bp->groups->root_slug : '';
     839                $slug = bp_is_active( 'groups' ) ? bp_get_groups_root_slug() : '';
    840840                break;
    841841
  • trunk/bp-groups/bp-groups-actions.php

    r4648 r4649  
    3838
    3939        $reset_steps = true;
    40         bp_core_redirect( bp_get_root_domain() . '/' . $bp->groups->root_slug . '/create/step/' . array_shift( array_keys( $bp->groups->group_creation_steps ) ) . '/' );
     40        bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . array_shift( array_keys( $bp->groups->group_creation_steps ) ) . '/' );
    4141    }
    4242
     
    4444    if ( $bp->action_variables[1] && !$bp->groups->group_creation_steps[$bp->action_variables[1]] ) {
    4545        bp_core_add_message( __('There was an error saving group details. Please try again.', 'buddypress'), 'error' );
    46         bp_core_redirect( bp_get_root_domain() . '/' . $bp->groups->root_slug . '/create/' );
     46        bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/' );
    4747    }
    4848
     
    6666            if ( empty( $_POST['group-name'] ) || empty( $_POST['group-desc'] ) || !strlen( trim( $_POST['group-name'] ) ) || !strlen( trim( $_POST['group-desc'] ) ) ) {
    6767                bp_core_add_message( __( 'Please fill in all of the required fields', 'buddypress' ), 'error' );
    68                 bp_core_redirect( bp_get_root_domain() . '/' . $bp->groups->root_slug . '/create/step/' . $bp->groups->current_create_step . '/' );
     68                bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . $bp->groups->current_create_step . '/' );
    6969            }
    7070
     
    7373            if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $new_group_id, 'name' => $_POST['group-name'], 'description' => $_POST['group-desc'], 'slug' => groups_check_slug( sanitize_title( esc_attr( $_POST['group-name'] ) ) ), 'date_created' => bp_core_current_time(), 'status' => 'public' ) ) ) {
    7474                bp_core_add_message( __( 'There was an error saving group details, please try again.', 'buddypress' ), 'error' );
    75                 bp_core_redirect( bp_get_root_domain() . '/' . $bp->groups->root_slug . '/create/step/' . $bp->groups->current_create_step . '/' );
     75                bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . $bp->groups->current_create_step . '/' );
    7676            }
    7777
     
    100100            if ( !$bp->groups->new_group_id = groups_create_group( array( 'group_id' => $bp->groups->new_group_id, 'status' => $group_status, 'enable_forum' => $group_enable_forum ) ) ) {
    101101                bp_core_add_message( __( 'There was an error saving group details, please try again.', 'buddypress' ), 'error' );
    102                 bp_core_redirect( bp_get_root_domain() . '/' . $bp->groups->root_slug . '/create/step/' . $bp->groups->current_create_step . '/' );
     102                bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . $bp->groups->current_create_step . '/' );
    103103            }
    104104           
     
    163163            }
    164164
    165             bp_core_redirect( bp_get_root_domain() . '/' . $bp->groups->root_slug . '/create/step/' . $next_step . '/' );
     165            bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . $next_step . '/' );
    166166        }
    167167    }
  • trunk/bp-groups/bp-groups-classes.php

    r4648 r4649  
    11981198        // Construct the admin edit tab for the new group extension
    11991199        if ( !empty( $this->enable_edit_item ) && !empty( $bp->is_item_admin ) ) {
    1200             add_action( 'groups_admin_tabs', create_function( '$current, $group_slug', '$selected = ""; if ( "' . esc_attr( $this->slug ) . '" == $current ) $selected = " class=\"current\""; echo "<li{$selected}><a href=\"' . bp_get_root_domain() . '/' . $bp->groups->root_slug . '/{$group_slug}/admin/' . esc_attr( $this->slug ) . '\">' . esc_attr( $this->name ) . '</a></li>";' ), 10, 2 );
     1200            add_action( 'groups_admin_tabs', create_function( '$current, $group_slug', '$selected = ""; if ( "' . esc_attr( $this->slug ) . '" == $current ) $selected = " class=\"current\""; echo "<li{$selected}><a href=\"' . bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/{$group_slug}/admin/' . esc_attr( $this->slug ) . '\">' . esc_attr( $this->name ) . '</a></li>";' ), 10, 2 );
    12011201
    12021202            // Catch the edit screen and forward it to the plugin template
  • trunk/bp-groups/bp-groups-template.php

    r4648 r4649  
    415415            $group =& $groups_template->group;
    416416
    417         return apply_filters( 'bp_get_group_permalink', bp_get_root_domain() . '/' . $bp->groups->root_slug . '/' . $group->slug . '/' );
     417        return apply_filters( 'bp_get_group_permalink', bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/' );
    418418    }
    419419
     
    427427            $group =& $groups_template->group;
    428428
    429         return apply_filters( 'bp_get_group_admin_permalink', bp_get_root_domain() . '/' . $bp->groups->root_slug . '/' . $group->slug . '/admin' );
     429        return apply_filters( 'bp_get_group_admin_permalink', bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin' );
    430430    }
    431431
     
    12411241?>
    12421242    <?php if ( $bp->is_item_admin || $bp->is_item_mod ) { ?>
    1243         <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/edit-details"><?php _e( 'Details', 'buddypress' ); ?></a></li>
     1243        <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/edit-details"><?php _e( 'Details', 'buddypress' ); ?></a></li>
    12441244    <?php } ?>
    12451245
     
    12481248            return false;
    12491249    ?>
    1250     <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/group-settings"><?php _e( 'Settings', 'buddypress' ); ?></a></li>
    1251     <li<?php if ( 'group-avatar' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/group-avatar"><?php _e( 'Avatar', 'buddypress' ); ?></a></li>
    1252     <li<?php if ( 'manage-members' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/manage-members"><?php _e( 'Members', 'buddypress' ); ?></a></li>
     1250    <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/group-settings"><?php _e( 'Settings', 'buddypress' ); ?></a></li>
     1251    <li<?php if ( 'group-avatar'   == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/group-avatar"><?php _e( 'Avatar', 'buddypress' ); ?></a></li>
     1252    <li<?php if ( 'manage-members' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/manage-members"><?php _e( 'Members', 'buddypress' ); ?></a></li>
    12531253
    12541254    <?php if ( $groups_template->group->status == 'private' ) : ?>
    1255         <li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/membership-requests"><?php _e( 'Requests', 'buddypress' ); ?></a></li>
     1255        <li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/membership-requests"><?php _e( 'Requests', 'buddypress' ); ?></a></li>
    12561256    <?php endif; ?>
    12571257
    12581258    <?php do_action( 'groups_admin_tabs', $current_tab, $group->slug ) ?>
    12591259
    1260     <li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/delete-group"><?php _e( 'Delete', 'buddypress' ); ?></a></li>
     1260    <li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/delete-group"><?php _e( 'Delete', 'buddypress' ); ?></a></li>
    12611261<?php
    12621262}
     
    19651965        $is_enabled = bp_are_previous_group_creation_steps_complete( $slug ); ?>
    19661966
    1967         <li<?php if ( $bp->groups->current_create_step == $slug ) : ?> class="current"<?php endif; ?>><?php if ( $is_enabled ) : ?><a href="<?php echo bp_get_root_domain() . '/' . $bp->groups->root_slug ?>/create/step/<?php echo $slug ?>/"><?php else: ?><span><?php endif; ?><?php echo $counter ?>. <?php echo $step['name'] ?><?php if ( $is_enabled ) : ?></a><?php else: ?></span><?php endif ?></li><?php
     1967        <li<?php if ( $bp->groups->current_create_step == $slug ) : ?> class="current"<?php endif; ?>><?php if ( $is_enabled ) : ?><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() ?>/create/step/<?php echo $slug ?>/"><?php else: ?><span><?php endif; ?><?php echo $counter ?>. <?php echo $step['name'] ?><?php if ( $is_enabled ) : ?></a><?php else: ?></span><?php endif ?></li><?php
    19681968        $counter++;
    19691969    }
     
    19891989            $bp->action_variables[1] = array_shift( array_keys( $bp->groups->group_creation_steps ) );
    19901990
    1991         return apply_filters( 'bp_get_group_creation_form_action', bp_get_root_domain() . '/' . $bp->groups->root_slug . '/create/step/' . $bp->action_variables[1] );
     1991        return apply_filters( 'bp_get_group_creation_form_action', bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . $bp->action_variables[1] );
    19921992    }
    19931993
     
    27302730        // Append $action to $url if there is no $type
    27312731        if ( !empty( $action ) )
    2732             $url = bp_get_root_domain() . '/' . $bp->groups->root_slug . '/' . $bp->groups->current_group->slug . '/' . $action;
     2732            $url = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $bp->groups->current_group->slug . '/' . $action;
    27332733        else
    2734             $url = bp_get_root_domain() . '/' . $bp->groups->root_slug . '/' . $bp->groups->current_group->slug;
     2734            $url = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $bp->groups->current_group->slug;
    27352735
    27362736        // Add a slash at the end of our user url
Note: See TracChangeset for help on using the changeset viewer.