Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/18/2011 12:53:31 PM (15 years ago)
Author:
johnjamesjacoby
Message:

Code normalization and whitespace clean-up. Introduce bp-core-deprecated.php. Introduce root_slug globals into components with directories, to help with WP page slugs. Fixes #2600. Optimus Props boonebgorges

File:
1 edited

Legend:

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

    r3685 r3728  
    351351            $group =& $groups_template->group;
    352352
    353         return apply_filters( 'bp_get_group_permalink', $bp->root_domain . '/' . $bp->groups->slug . '/' . $group->slug . '/' );
     353        return apply_filters( 'bp_get_group_permalink', $bp->root_domain . '/' . $bp->groups->root_slug . '/' . $group->slug . '/' );
    354354    }
    355355
     
    363363            $group =& $groups_template->group;
    364364
    365         return apply_filters( 'bp_get_group_admin_permalink', $bp->root_domain . '/' . $bp->groups->slug . '/' . $group->slug . '/admin' );
     365        return apply_filters( 'bp_get_group_admin_permalink', $bp->root_domain . '/' . $bp->groups->root_slug . '/' . $group->slug . '/admin' );
    366366    }
    367367
     
    548548    global $bp;
    549549
    550     if ( !$bp->is_single_item || $bp->current_component != $bp->groups->slug || $bp->current_action != $bp->activity->slug )
     550    if ( !$bp->is_single_item || !bp_is_current_component( $bp->groups->slug ) || $bp->current_action != $bp->activity->slug )
    551551        return false;
    552552
     
    930930?>
    931931    <?php if ( $bp->is_item_admin || $bp->is_item_mod ) { ?>
    932         <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $group->slug ?>/admin/edit-details"><?php _e('Edit Details', 'buddypress') ?></a></li>
     932        <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/edit-details"><?php _e('Edit Details', 'buddypress') ?></a></li>
    933933    <?php } ?>
    934934
     
    937937            return false;
    938938    ?>
    939     <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $group->slug ?>/admin/group-settings"><?php _e('Group Settings', 'buddypress') ?></a></li>
    940     <li<?php if ( 'group-avatar' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $group->slug ?>/admin/group-avatar"><?php _e('Group Avatar', 'buddypress') ?></a></li>
    941     <li<?php if ( 'manage-members' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $group->slug ?>/admin/manage-members"><?php _e('Manage Members', 'buddypress') ?></a></li>
     939    <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/group-settings"><?php _e('Group Settings', 'buddypress') ?></a></li>
     940    <li<?php if ( 'group-avatar' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/group-avatar"><?php _e('Group Avatar', 'buddypress') ?></a></li>
     941    <li<?php if ( 'manage-members' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/manage-members"><?php _e('Manage Members', 'buddypress') ?></a></li>
    942942
    943943    <?php if ( $groups_template->group->status == 'private' ) : ?>
    944         <li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $group->slug ?>/admin/membership-requests"><?php _e('Membership Requests', 'buddypress') ?></a></li>
     944        <li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/membership-requests"><?php _e('Membership Requests', 'buddypress') ?></a></li>
    945945    <?php endif; ?>
    946946
    947947    <?php do_action( 'groups_admin_tabs', $current_tab, $group->slug ) ?>
    948948
    949     <li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->slug ?>/<?php echo $group->slug ?>/admin/delete-group"><?php _e('Delete Group', 'buddypress') ?></a></li>
     949    <li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->root_domain . '/' . $bp->groups->root_slug ?>/<?php echo $group->slug ?>/admin/delete-group"><?php _e('Delete Group', 'buddypress') ?></a></li>
    950950<?php
    951951}
     
    16201620        $is_enabled = bp_are_previous_group_creation_steps_complete( $slug ); ?>
    16211621
    1622         <li<?php if ( $bp->groups->current_create_step == $slug ) : ?> class="current"<?php endif; ?>><?php if ( $is_enabled ) : ?><a href="<?php echo $bp->root_domain . '/' . $bp->groups->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
     1622        <li<?php if ( $bp->groups->current_create_step == $slug ) : ?> class="current"<?php endif; ?>><?php if ( $is_enabled ) : ?><a href="<?php echo $bp->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
    16231623        $counter++;
    16241624    }
     
    16441644            $bp->action_variables[1] = array_shift( array_keys( $bp->groups->group_creation_steps ) );
    16451645
    1646         return apply_filters( 'bp_get_group_creation_form_action', $bp->root_domain . '/' . $bp->groups->slug . '/create/step/' . $bp->action_variables[1] );
     1646        return apply_filters( 'bp_get_group_creation_form_action', $bp->root_domain . '/' . $bp->groups->root_slug . '/create/step/' . $bp->action_variables[1] );
    16471647    }
    16481648
     
    16511651
    16521652    /* Make sure we are in the groups component */
    1653     if ( $bp->current_component != BP_GROUPS_SLUG || 'create' != $bp->current_action )
     1653    if ( !bp_is_current_component( $bp->groups->slug ) || 'create' != $bp->current_action )
    16541654        return false;
    16551655
     
    19301930    global $bp;
    19311931
    1932     if ( $bp->current_component != BP_GROUPS_SLUG || 'admin' != $bp->current_action )
     1932    if ( !bp_is_current_component( $bp->groups->slug ) || 'admin' != $bp->current_action )
    19331933        return false;
    19341934
     
    19471947
    19481948    if ( $bp->groups->current_group->avatar_full ) { ?>
     1949
    19491950        <img src="<?php echo esc_attr( $bp->groups->current_group->avatar_full ) ?>" alt="<?php _e( 'Group Avatar', 'buddypress' ) ?>" class="avatar" />
     1951
    19501952    <?php } else { ?>
     1953
    19511954        <img src="<?php echo $bp->groups->image_base . '/none.gif' ?>" alt="<?php _e( 'No Group Avatar', 'buddypress' ) ?>" class="avatar" />
     1955
    19521956    <?php }
    19531957}
     
    20412045            'next_text' => '&rarr;',
    20422046            'mid_size' => 1
    2043         ));
     2047        ) );
    20442048    }
    20452049
     
    20602064    function rewind_requests() {
    20612065        $this->current_request = -1;
    2062         if ( $this->request_count > 0 ) {
     2066
     2067        if ( $this->request_count > 0 )
    20632068            $this->request = $this->requests[0];
    2064         }
    20652069    }
    20662070
     
    20952099        'group_id' => $groups_template->group->id,
    20962100        'per_page' => 10,
    2097         'max' => false
     2101        'max'      => false
    20982102    );
    20992103
     
    22022206    function rewind_invites() {
    22032207        $this->current_invite = -1;
    2204         if ( $this->invite_count > 0 ) {
     2208        if ( $this->invite_count > 0 )
    22052209            $this->invite = $this->invites[0];
    2206         }
    22072210    }
    22082211
     
    22472250
    22482251    if ( !$group_id ) {
    2249         /* Backwards compatibility */
     2252        // Backwards compatibility
    22502253        if ( !empty( $bp->groups->current_group ) )
    22512254            $group_id = $bp->groups->current_group->id;
     2255
    22522256        if ( !empty( $bp->groups->new_group_id ) )
    22532257            $group_id = $bp->groups->new_group_id;
Note: See TracChangeset for help on using the changeset viewer.