Skip to:
Content

BuddyPress.org

Changeset 5687


Ignore:
Timestamp:
02/09/2012 11:00:59 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Audit the usage of $bp->is_item_admin and $bp->is_item_mod to use the _is_ functions isntead. Also fix some $bp globals in the process. See #3989.

Location:
trunk
Files:
7 edited

Legend:

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

    r5480 r5687  
    775775}
    776776    function bp_get_the_topic_is_mine() {
    777         global $bp, $forum_template;
     777        global $forum_template;
    778778
    779779        return bp_loggedin_user_id() == $forum_template->topic->topic_poster;
     
    784784}
    785785    function bp_get_the_topic_admin_links( $args = '' ) {
    786         global $bp, $forum_template;
     786        global $forum_template;
    787787
    788788        $defaults = array(
     
    795795        $links[] = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'edit', 'bp_forums_edit_topic' ) . '">' . __( 'Edit Topic', 'buddypress' ) . '</a>';
    796796
    797         if ( $bp->is_item_admin || $bp->is_item_mod || bp_current_user_can( 'bp_moderate' ) ) {
     797        if ( bp_is_item_admin() || bp_is_item_mod() || bp_current_user_can( 'bp_moderate' ) ) {
    798798            if ( 0 == (int)$forum_template->topic->topic_sticky )
    799799                $links[] = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'stick', 'bp_forums_stick_topic' ) . '">' . __( 'Sticky Topic', 'buddypress' ) . '</a>';
  • trunk/bp-groups/bp-groups-buddybar.php

    r5329 r5687  
    44
    55function bp_groups_adminbar_admin_menu() {
    6     global $bp, $groups_template;
     6    global $bp;
    77
    88    if ( empty( $bp->groups->current_group ) )
     
    1010
    1111    // Don't show this menu to non site admins or if you're viewing your own profile
    12     if ( !current_user_can( 'edit_users' ) || !bp_current_user_can( 'bp_moderate' ) || ( !$bp->is_item_admin && !$bp->is_item_mod ) )
     12    if ( !current_user_can( 'edit_users' ) || !bp_current_user_can( 'bp_moderate' ) || ( bp_is_item_admin() && ! bp_is_item_mod() ) )
    1313        return false; ?>
    1414
  • trunk/bp-groups/bp-groups-classes.php

    r5644 r5687  
    13041304
    13051305        // Construct the admin edit tab for the new group extension
    1306         if ( !empty( $this->enable_edit_item ) && !empty( $bp->is_item_admin ) ) {
     1306        if ( !empty( $this->enable_edit_item ) && bp_is_item_admin() ) {
    13071307            add_action( 'groups_admin_tabs', create_function( '$current, $group_slug', '$selected = ""; if ( "' . esc_attr( $this->admin_slug ) . '" == $current ) $selected = " class=\"current\""; echo "<li{$selected}><a href=\"' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/{$group_slug}/admin/' . esc_attr( $this->admin_slug ) ) . '\">' . esc_attr( $this->admin_name ) . '</a></li>";' ), 10, 2 );
    13081308
     
    13321332
    13331333function bp_register_group_extension( $group_extension_class ) {
    1334     global $bp;
    13351334
    13361335    if ( !class_exists( $group_extension_class ) )
  • trunk/bp-groups/bp-groups-functions.php

    r5460 r5687  
    198198
    199199    // Check the user is the group admin.
    200     if ( !$bp->is_item_admin )
     200    if ( ! bp_is_item_admin() )
    201201        return false;
    202202
     
    699699
    700700function groups_promote_member( $user_id, $group_id, $status ) {
    701     global $bp;
    702 
    703     if ( !$bp->is_item_admin )
     701
     702    if ( ! bp_is_item_admin() )
    704703        return false;
    705704
     
    722721
    723722function groups_ban_member( $user_id, $group_id ) {
    724     global $bp;
    725 
    726     if ( !$bp->is_item_admin )
     723
     724    if ( ! bp_is_item_admin() )
    727725        return false;
    728726
     
    735733
    736734function groups_unban_member( $user_id, $group_id ) {
    737     global $bp;
    738 
    739     if ( !$bp->is_item_admin )
     735
     736    if ( ! bp_is_item_admin() )
    740737        return false;
    741738
     
    750747
    751748function groups_remove_member( $user_id, $group_id ) {
    752     global $bp;
    753 
    754     if ( !$bp->is_item_admin )
     749
     750    if ( ! bp_is_item_admin() )
    755751        return false;
    756752
  • trunk/bp-groups/bp-groups-loader.php

    r5518 r5687  
    384384                    'screen_function' => 'groups_screen_group_admin',
    385385                    'position'        => 1000,
    386                     'user_has_access' => ( $bp->is_item_admin + (int)$bp->is_item_mod ),
     386                    'user_has_access' => true,
    387387                    'item_css_id'     => 'admin'
    388388                );
  • trunk/bp-groups/bp-groups-screens.php

    r5567 r5687  
    168168
    169169            // Sticky a topic
    170             else if ( bp_is_action_variable( 'stick', 2 ) && ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) {
     170            else if ( bp_is_action_variable( 'stick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
    171171                // Check the nonce
    172172                check_admin_referer( 'bp_forums_stick_topic' );
     
    182182
    183183            // Un-Sticky a topic
    184             else if ( bp_is_action_variable( 'unstick', 2 ) && ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) {
     184            else if ( bp_is_action_variable( 'unstick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
    185185                // Check the nonce
    186186                check_admin_referer( 'bp_forums_unstick_topic' );
     
    196196
    197197            // Close a topic
    198             else if ( bp_is_action_variable( 'close', 2 ) && ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) {
     198            else if ( bp_is_action_variable( 'close', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
    199199                // Check the nonce
    200200                check_admin_referer( 'bp_forums_close_topic' );
     
    210210
    211211            // Open a topic
    212             else if ( bp_is_action_variable( 'open', 2 ) && ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) {
     212            else if ( bp_is_action_variable( 'open', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) {
    213213                // Check the nonce
    214214                check_admin_referer( 'bp_forums_open_topic' );
     
    229229
    230230                /* Check the logged in user can delete this topic */
    231                 if ( !$bp->is_item_admin && !$bp->is_item_mod && (int)bp_loggedin_user_id() != (int)$topic->topic_poster )
     231                if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $topic->topic_poster ) )
    232232                    bp_core_redirect( wp_get_referer() );
    233233
     
    252252
    253253                // Check the logged in user can edit this topic
    254                 if ( !$bp->is_item_admin && !$bp->is_item_mod && (int)bp_loggedin_user_id() != (int)$topic->topic_poster )
     254                if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $topic->topic_poster ) )
    255255                    bp_core_redirect( wp_get_referer() );
    256256
     
    279279
    280280                // Check the logged in user can edit this topic
    281                 if ( !$bp->is_item_admin && !$bp->is_item_mod && (int)bp_loggedin_user_id() != (int)$post->poster_id )
     281                if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $post->poster_id ) )
    282282                    bp_core_redirect( wp_get_referer() );
    283283
     
    302302
    303303                // Check the logged in user can edit this topic
    304                 if ( !$bp->is_item_admin && !$bp->is_item_mod && (int)bp_loggedin_user_id() != (int)$post->poster_id )
     304                if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $post->poster_id ) )
    305305                    bp_core_redirect( wp_get_referer() );
    306306
     
    481481    if ( bp_is_groups_component() && bp_is_action_variable( 'edit-details', 0 ) ) {
    482482
    483         if ( $bp->is_item_admin || $bp->is_item_mod ) {
     483        if ( bp_is_item_admin() || bp_is_item_mod() ) {
    484484
    485485            // If the edit form has been submitted, save the edited details
     
    513513    if ( bp_is_groups_component() && bp_is_action_variable( 'group-settings', 0 ) ) {
    514514
    515         if ( !$bp->is_item_admin )
     515        if ( ! bp_is_item_admin() )
    516516            return false;
    517517
     
    556556
    557557        // If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here
    558         if ( !$bp->is_item_admin || (int)bp_get_option( 'bp-disable-avatar-uploads' ) )
     558        if ( ! bp_is_item_admin() || (int) bp_get_option( 'bp-disable-avatar-uploads' ) )
    559559            return false;
    560560
     
    619619    if ( bp_is_groups_component() && bp_is_action_variable( 'manage-members', 0 ) ) {
    620620
    621         if ( !$bp->is_item_admin )
     621        if ( ! bp_is_item_admin() )
    622622            return false;
    623623
     
    734734    if ( bp_is_groups_component() && bp_is_action_variable( 'membership-requests', 0 ) ) {
    735735
    736         if ( !$bp->is_item_admin || 'public' == $bp->groups->current_group->status )
     736        if ( ! bp_is_item_admin() || ( 'public' == $bp->groups->current_group->status ) )
    737737            return false;
    738738
     
    783783    if ( bp_is_groups_component() && bp_is_action_variable( 'delete-group', 0 ) ) {
    784784
    785         if ( !$bp->is_item_admin && !bp_current_user_can( 'bp_moderate' ) )
     785        if ( ! bp_is_item_admin() && !bp_current_user_can( 'bp_moderate' ) )
    786786            return false;
    787787
  • trunk/bp-groups/bp-groups-template.php

    r5673 r5687  
    303303        return true;
    304304
    305     if ( !$group )
     305    if ( empty( $group ) )
    306306        $group =& $groups_template->group;
    307307
     
    323323        global $groups_template;
    324324
    325         if ( !$group )
     325        if ( empty( $group ) )
    326326            $group =& $groups_template->group;
    327327
     
    335335        global $groups_template;
    336336
    337         if ( !$group )
     337        if ( empty( $group ) )
    338338            $group =& $groups_template->group;
    339339
     
    347347        global $groups_template;
    348348
    349         if ( !$group )
     349        if ( empty( $group ) )
    350350            $group =& $groups_template->group;
    351351
     
    369369        global $groups_template;
    370370
    371         if ( !$group )
     371        if ( empty( $group ) )
    372372            $group =& $groups_template->group;
    373373
     
    420420        global $groups_template;
    421421
    422         if ( !$group )
     422        if ( empty( $group ) )
    423423            $group =& $groups_template->group;
    424424
     
    441441        global $groups_template, $bp;
    442442
    443         if ( !$group )
     443        if ( empty( $group ) )
    444444            $group =& $groups_template->group;
    445445
     
    453453        global $groups_template, $bp;
    454454
    455         if ( !$group )
     455        if ( empty( $group ) )
    456456            $group =& $groups_template->group;
    457457
     
    465465        global $groups_template;
    466466
    467         if ( !$group )
     467        if ( empty( $group ) )
    468468            $group =& $groups_template->group;
    469469
     
    477477        global $groups_template;
    478478
    479         if ( !$group )
     479        if ( empty( $group ) )
    480480            $group =& $groups_template->group;
    481481
     
    489489        global $groups_template;
    490490
    491         if ( !$group )
     491        if ( empty( $group ) )
    492492            $group =& $groups_template->group;
    493493
     
    501501        global $groups_template;
    502502
    503         if ( !$group )
     503        if ( empty( $group ) )
    504504            $group =& $groups_template->group;
    505505
     
    514514        global $groups_template;
    515515
    516         if ( !$group )
     516        if ( empty( $group ) )
    517517            $group =& $groups_template->group;
    518518
     
    530530        global $groups_template;
    531531
    532         if ( !$group )
     532        if ( empty( $group ) )
    533533            $group =& $groups_template->group;
    534534
     
    542542        global $groups_template;
    543543
    544         if ( !$group )
     544        if ( empty( $group ) )
    545545            $group =& $groups_template->group;
    546546
     
    549549
    550550function bp_group_is_admin() {
    551     global $bp;
    552 
    553     return $bp->is_item_admin;
     551    return bp_is_item_admin();
    554552}
    555553
    556554function bp_group_is_mod() {
    557     global $bp;
    558 
    559     return $bp->is_item_mod;
     555    return bp_is_item_mod();
    560556}
    561557
     
    563559    global $groups_template;
    564560
    565     if ( !$group )
     561    if ( empty( $group ) )
    566562        $group =& $groups_template->group;
    567563
     
    621617    global $groups_template;
    622618
    623     if ( !$group )
     619    if ( empty( $group ) )
    624620        $group =& $groups_template->group;
    625621
     
    651647    global $groups_template;
    652648
    653     if ( !$group )
     649    if ( empty( $group ) )
    654650        $group =& $groups_template->group;
    655651
     
    674670        global $groups_template, $bp;
    675671
    676         if ( !$group )
     672        if ( empty( $group ) )
    677673            $group =& $groups_template->group;
    678674
     
    747743        global $groups_template;
    748744
    749         if ( !$group )
     745        if ( empty( $group ) )
    750746            $group =& $groups_template->group;
    751747
     
    771767        global $groups_template;
    772768
    773         if ( !$group )
     769        if ( empty( $group ) )
    774770            $group =& $groups_template->group;
    775771
     
    848844    global $groups_template;
    849845
    850     if ( !$group )
     846    if ( empty( $group ) )
    851847        $group =& $groups_template->group;
    852848
     
    868864    global $groups_template;
    869865
    870     if ( !$group )
     866    if ( empty( $group ) )
    871867        $group =& $groups_template->group;
    872868
     
    878874    global $groups_template;
    879875
    880     if ( !$group )
     876    if ( empty( $group ) )
    881877        $group =& $groups_template->group;
    882878
     
    11441140    global $group_mods, $groups_template;
    11451141
    1146     if ( !$group )
     1142    if ( empty( $group ) )
    11471143        $group =& $groups_template->group;
    11481144
     
    11951191        global $members_template, $groups_template, $bp;
    11961192
    1197         if ( !$group )
     1193        if ( empty( $group ) )
    11981194            $group =& $groups_template->group;
    11991195
     
    12151211        global $members_template, $groups_template, $bp;
    12161212
    1217         if ( !$group )
     1213        if ( empty( $group ) )
    12181214            $group =& $groups_template->group;
    12191215
     
    12351231            $user_id = $members_template->member->user_id;
    12361232
    1237         if ( !$group )
     1233        if ( empty( $group ) )
    12381234            $group =& $groups_template->group;
    12391235
     
    12531249        global $members_template, $groups_template;
    12541250
    1255         if ( !$group )
     1251        if ( empty( $group ) )
    12561252            $group =& $groups_template->group;
    12571253
     
    12621258    global $bp, $groups_template;
    12631259
    1264     if ( !$group )
     1260    if ( empty( $group ) )
    12651261        $group = ( $groups_template->group ) ? $groups_template->group : $bp->groups->current_group;
    12661262
    12671263    $current_tab = bp_action_variable( 0 );
    1268 ?>
    1269     <?php if ( $bp->is_item_admin || $bp->is_item_mod ) { ?>
     1264
     1265    if ( bp_is_item_admin() || bp_is_item_mod() ) : ?>
     1266
    12701267        <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/edit-details' ) ?>"><?php _e( 'Details', 'buddypress' ); ?></a></li>
    1271     <?php } ?>
    1272 
    1273     <?php
    1274         if ( !$bp->is_item_admin )
    1275             return false;
    1276     ?>
     1268
     1269    <?php endif; ?>
     1270
     1271    <?php if ( ! bp_is_item_admin() )
     1272            return false; ?>
     1273
    12771274    <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/group-settings' ) ?>"><?php _e( 'Settings', 'buddypress' ); ?></a></li>
    12781275
    12791276    <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
     1277
    12801278        <li<?php if ( 'group-avatar'   == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/group-avatar' ) ?>"><?php _e( 'Avatar', 'buddypress' ); ?></a></li>
     1279
    12811280    <?php endif; ?>
    12821281
     
    12841283
    12851284    <?php if ( $groups_template->group->status == 'private' ) : ?>
     1285
    12861286        <li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/membership-requests' ) ?>"><?php _e( 'Requests', 'buddypress' ); ?></a></li>
     1287
    12871288    <?php endif; ?>
    12881289
     
    12901291
    12911292    <li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/delete-group' ) ?>"><?php _e( 'Delete', 'buddypress' ); ?></a></li>
     1293
    12921294<?php
    12931295}
     
    13041306}
    13051307    function bp_get_group_form_action( $page, $group = false ) {
    1306         global $bp, $groups_template;
    1307 
    1308         if ( !$group )
     1308        global $groups_template;
     1309
     1310        if ( empty( $group ) )
    13091311            $group =& $groups_template->group;
    13101312
     
    13181320        global $groups_template;
    13191321
    1320         if ( !$group )
    1321             $group =& $groups_template->group;
    1322 
    1323         if ( !$page )
     1322        if ( empty( $group ) )
     1323            $group =& $groups_template->group;
     1324
     1325        if ( empty( $page ) )
    13241326            $page = bp_action_variable( 0 );
    13251327
     
    13301332    global $groups_template;
    13311333
    1332     if ( !$group )
     1334    if ( empty( $group ) )
    13331335        $group =& $groups_template->group;
    13341336
     
    13471349 * @uses apply_filters Creates bp_group_is_member filter and passes $is_member
    13481350 * @usedby groups/activity.php, groups/single/forum/edit.php, groups/single/forum/topic.php to determine template part visibility
    1349  * @global array $bp BuddyPress Master global
    13501351 * @global object $groups_template Current Group (usually in template loop)
    13511352 * @param object $group Group to check is_member
     
    13531354 */
    13541355function bp_group_is_member( $group = false ) {
    1355     global $bp, $groups_template;
     1356    global $groups_template;
    13561357
    13571358    // Site admins always have access
     
    13591360        return true;
    13601361
    1361     if ( !$group )
     1362    if ( empty( $group ) )
    13621363        $group =& $groups_template->group;
    13631364
     
    13851386        return false;
    13861387
    1387     if ( !$group ) {
     1388    if ( empty( $group ) ) {
    13881389        $group =& $groups_template->group;
    13891390
     
    14041405        global $groups_template, $bp;
    14051406
    1406         if ( !$group )
     1407        if ( empty( $group ) )
    14071408            $group =& $groups_template->group;
    14081409
     
    14161417        global $groups_template, $bp;
    14171418
    1418         if ( !$group )
     1419        if ( empty( $group ) )
    14191420            $group =& $groups_template->group;
    14201421
     
    14261427}
    14271428    function bp_get_group_leave_confirm_link( $group = false ) {
    1428         global $groups_template, $bp;
    1429 
    1430         if ( !$group )
     1429        global $groups_template;
     1430
     1431        if ( empty( $group ) )
    14311432            $group =& $groups_template->group;
    14321433
     
    14381439}
    14391440    function bp_get_group_leave_reject_link( $group = false ) {
    1440         global $groups_template, $bp;
    1441 
    1442         if ( !$group )
     1441        global $groups_template;
     1442
     1443        if ( empty( $group ) )
    14431444            $group =& $groups_template->group;
    14441445
     
    14501451}
    14511452    function bp_get_group_send_invite_form_action( $group = false ) {
    1452         global $groups_template, $bp;
    1453 
    1454         if ( !$group )
     1453        global $groups_template;
     1454
     1455        if ( empty( $group ) )
    14551456            $group =& $groups_template->group;
    14561457
     
    14591460
    14601461function bp_has_friends_to_invite( $group = false ) {
    1461     global $groups_template, $bp;
     1462    global $groups_template;
    14621463
    14631464    if ( !bp_is_active( 'friends' ) )
    14641465        return false;
    14651466
    1466     if ( !$group )
     1467    if ( empty( $group ) )
    14671468        $group =& $groups_template->group;
    14681469
     
    14741475
    14751476function bp_group_new_topic_button( $group = false ) {
    1476     echo bp_get_group_new_topic_button();
     1477    echo bp_get_group_new_topic_button( $group );
    14771478}
    14781479    function bp_get_group_new_topic_button( $group = false ) {
    14791480        global $groups_template;
    14801481
    1481         if ( !$group )
     1482        if ( empty( $group ) )
    14821483            $group =& $groups_template->group;
    14831484
     
    15061507}
    15071508    function bp_get_group_join_button( $group = false ) {
    1508         global $bp, $groups_template;
    1509 
    1510         if ( !$group )
     1509        global $groups_template;
     1510
     1511        if ( empty( $group ) )
    15111512            $group =& $groups_template->group;
    15121513
     
    16871688
    16881689    function __construct( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude ) {
    1689         global $bp;
    16901690
    16911691        $this->pag_page = isset( $_REQUEST['mlpage'] ) ? intval( $_REQUEST['mlpage'] ) : 1;
    1692         $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
    1693 
    1694         $this->members = BP_Groups_Member::get_all_for_group( $group_id, $this->pag_num, $this->pag_page, $exclude_admins_mods, $exclude_banned, $exclude );
     1692        $this->pag_num  = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
     1693        $this->members  = BP_Groups_Member::get_all_for_group( $group_id, $this->pag_num, $this->pag_page, $exclude_admins_mods, $exclude_banned, $exclude );
    16951694
    16961695        if ( !$max || $max >= (int)$this->members['count'] )
     
    17561755
    17571756    function the_member() {
    1758         global $member;
    17591757
    17601758        $this->in_the_loop = true;
    1761         $this->member = $this->next_member();
     1759        $this->member      = $this->next_member();
    17621760
    17631761        if ( 0 == $this->current_member ) // loop has just started
     
    17671765
    17681766function bp_group_has_members( $args = '' ) {
    1769     global $bp, $members_template;
     1767    global $members_template;
    17701768
    17711769    $defaults = array(
     
    18781876}
    18791877    function bp_get_group_member_is_banned() {
    1880         global $members_template, $groups_template;
     1878        global $members_template;
    18811879
    18821880        return apply_filters( 'bp_get_group_member_is_banned', $members_template->member->is_banned );
     
    19211919}
    19221920    function bp_get_group_pag_id() {
    1923         global $bp;
    1924 
    19251921        return apply_filters( 'bp_get_group_pag_id', 'pag' );
    19261922    }
     
    22622258
    22632259function bp_directory_groups_search_form() {
    2264     global $bp;
    22652260
    22662261    $default_search_value = bp_get_search_default_text( 'groups' );
     
    22822277 */
    22832278function bp_groups_header_tabs() {
    2284     global $create_group_step, $completed_to_step;
    2285 ?>
     2279    global $bp;?>
     2280
    22862281    <li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/recently-active' ) ?>"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
    22872282    <li<?php if ( bp_is_action_variable( 'recently-joined', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/recently-joined' ) ?>"><?php _e( 'Recently Joined', 'buddypress' ) ?></a></li>
     
    22902285    <li<?php if ( bp_is_action_variable( 'mod-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/mod-of' ) ?>"><?php _e( 'Moderator Of', 'buddypress' ) ?></a></li>
    22912286    <li<?php if ( bp_is_action_variable( 'alphabetically' ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/alphabetically' ) ?>"><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
     2287
    22922288<?php
    22932289    do_action( 'groups_header_tabs' );
     
    24172413    function __construct( $group_id, $per_page, $max ) {
    24182414
    2419         global $bp;
    2420 
    24212415        $this->pag_page = isset( $_REQUEST['mrpage'] ) ? intval( $_REQUEST['mrpage'] ) : 1;
    2422         $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
    2423 
     2416        $this->pag_num  = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
    24242417        $this->requests = BP_Groups_Group::get_membership_requests( $group_id, $this->pag_num, $this->pag_page );
    24252418
     
    24862479
    24872480    function the_request() {
    2488         global $request;
    2489 
    24902481        $this->in_the_loop = true;
    2491         $this->request = $this->next_request();
     2482        $this->request     = $this->next_request();
    24922483
    24932484        if ( 0 == $this->current_request ) // loop has just started
     
    25912582
    25922583    function __construct( $user_id, $group_id ) {
    2593 
    2594         global $bp;
    2595 
    2596         $this->invites = groups_get_invites_for_group( $user_id, $group_id );
     2584        $this->invites      = groups_get_invites_for_group( $user_id, $group_id );
    25972585        $this->invite_count = count( $this->invites );
    2598 
    25992586    }
    26002587
     
    26332620
    26342621    function the_invite() {
    2635         global $invite, $group_id;
    2636 
    2637         $this->in_the_loop = true;
    2638         $user_id = $this->next_invite();
    2639 
    2640         $this->invite = new stdClass;
    2641         $this->invite->user = new BP_Core_User( $user_id );
     2622        global $group_id;
     2623
     2624        $this->in_the_loop      = true;
     2625        $user_id                = $this->next_invite();
     2626        $this->invite           = new stdClass;
     2627        $this->invite->user     = new BP_Core_User( $user_id );
    26422628        $this->invite->group_id = $group_id; // Globaled in bp_group_has_invites()
    26432629
Note: See TracChangeset for help on using the changeset viewer.