Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/25/2011 12:01:55 AM (14 years ago)
Author:
boonebgorges
Message:

Global/slug audit for groups component. Also regularizes the way that some group forum actions are concatenated. See #3325

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-template.php

    r4823 r4844  
    12671267        $group = ( $groups_template->group ) ? $groups_template->group : $bp->groups->current_group;
    12681268
    1269     $current_tab = $bp->action_variables[0];
     1269    $current_tab = bp_action_variable( 0 );
    12701270?>
    12711271    <?php if ( $bp->is_item_admin || $bp->is_item_mod ) { ?>
     
    13141314}
    13151315    function bp_get_group_admin_form_action( $page = false, $group = false ) {
    1316         global $bp, $groups_template;
     1316        global $groups_template;
    13171317
    13181318        if ( !$group )
     
    13201320
    13211321        if ( !$page )
    1322             $page = $bp->action_variables[0];
     1322            $page = bp_action_variable( 0 );
    13231323
    13241324        return apply_filters( 'bp_group_admin_form_action', bp_get_group_permalink( $group ) . 'admin/' . $page );
     
    13261326
    13271327function bp_group_has_requested_membership( $group = false ) {
    1328     global $bp, $groups_template;
     1328    global $groups_template;
    13291329
    13301330    if ( !$group )
    13311331        $group =& $groups_template->group;
    13321332
    1333     if ( groups_check_for_membership_request( $bp->loggedin_user->id, $group->id ) )
     1333    if ( groups_check_for_membership_request( bp_loggedin_user_id(), $group->id ) )
    13341334        return true;
    13351335
     
    20152015        global $bp;
    20162016
    2017         if ( empty( $bp->action_variables[1] ) )
     2017        if ( !bp_action_variable( 1 ) )
    20182018            $bp->action_variables[1] = array_shift( array_keys( $bp->groups->group_creation_steps ) );
    20192019
    2020         return apply_filters( 'bp_get_group_creation_form_action', bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . $bp->action_variables[1] );
     2020        return apply_filters( 'bp_get_group_creation_form_action', bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . bp_action_variable( 1 ) );
    20212021    }
    20222022
     
    20292029
    20302030    /* If this the first step, we can just accept and return true */
    2031     if ( !$bp->action_variables[1] && array_shift( array_keys( $bp->groups->group_creation_steps ) ) == $step_slug )
     2031    if ( !bp_action_variable( 1 ) && array_shift( array_keys( $bp->groups->group_creation_steps ) ) == $step_slug )
    20322032        return true;
    20332033
     
    20392039
    20402040    /* Check the current step against the step parameter */
    2041     if ( $bp->action_variables[1] == $step_slug )
     2041    if ( bp_is_action_variable( $step_slug ) )
    20422042        return true;
    20432043
     
    21752175
    21762176        foreach ( (array)$bp->groups->group_creation_steps as $slug => $name ) {
    2177             if ( $slug == $bp->action_variables[1] )
     2177            if ( bp_is_action_variable( $slug ) )
    21782178                break;
    21792179
     
    21812181        }
    21822182
    2183         return apply_filters( 'bp_get_group_creation_previous_link', $bp->loggedin_user->domain . bp_get_groups_slug() . '/create/step/' . array_pop( $previous_steps ) );
     2183        return apply_filters( 'bp_get_group_creation_previous_link', bp_get_root_domain() . bp_get_groups_slug() . '/create/step/' . array_pop( $previous_steps ) );
    21842184    }
    21852185
     
    22612261}
    22622262
     2263/**
     2264 * Displays group header tabs
     2265 *
     2266 * @package BuddyPress
     2267 * @todo Deprecate?
     2268 */
    22632269function bp_groups_header_tabs() {
    2264     global $bp, $create_group_step, $completed_to_step;
     2270    global $create_group_step, $completed_to_step;
    22652271?>
    2266     <li<?php if ( !isset($bp->action_variables[0]) || 'recently-active' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/recently-active"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
    2267     <li<?php if ( 'recently-joined' == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/recently-joined"><?php _e( 'Recently Joined', 'buddypress' ) ?></a></li>
    2268     <li<?php if ( 'most-popular'    == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/most-popular"><?php _e( 'Most Popular', 'buddypress' ) ?></a></li>
    2269     <li<?php if ( 'admin-of'        == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/admin-of"><?php _e( 'Administrator Of', 'buddypress' ) ?></a></li>
    2270     <li<?php if ( 'mod-of'          == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/mod-of"><?php _e( 'Moderator Of', 'buddypress' ) ?></a></li>
    2271     <li<?php if ( 'alphabetically'  == $bp->action_variables[0] ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/alphabetically"><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
     2272    <li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/recently-active"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
     2273    <li<?php if ( bp_is_action_variable( 'recently-joined', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/recently-joined"><?php _e( 'Recently Joined', 'buddypress' ) ?></a></li>
     2274    <li<?php if ( bp_is_action_variable( 'most-popular', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/most-popular"><?php _e( 'Most Popular', 'buddypress' ) ?></a></li>
     2275    <li<?php if ( bp_is_action_variable( 'admin-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/admin-of"><?php _e( 'Administrator Of', 'buddypress' ) ?></a></li>
     2276    <li<?php if ( bp_is_action_variable( 'mod-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/mod-of"><?php _e( 'Moderator Of', 'buddypress' ) ?></a></li>
     2277    <li<?php if ( bp_is_action_variable( 'alphabetically' ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/alphabetically"><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
    22722278<?php
    22732279    do_action( 'groups_header_tabs' );
    22742280}
    22752281
     2282/**
     2283 * Displays group filter titles
     2284 *
     2285 * @package BuddyPress
     2286 * @todo Deprecate?
     2287 */
    22762288function bp_groups_filter_title() {
    2277     global $bp;
    2278 
    2279     $current_filter = $bp->action_variables[0];
     2289    $current_filter = bp_action_variable( 0 );
    22802290
    22812291    switch ( $current_filter ) {
     
    23032313
    23042314function bp_is_group_admin_screen( $slug ) {
    2305     global $bp;
    2306 
    23072315    if ( !bp_is_groups_component() || !bp_is_current_action( 'admin' ) )
    23082316        return false;
    23092317
    2310     if ( $bp->action_variables[0] == $slug )
     2318    if ( bp_is_action_variable( $slug ) )
    23112319        return true;
    23122320
Note: See TracChangeset for help on using the changeset viewer.