Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/09/2012 11:00:59 PM (14 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.