Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/24/2011 10:51:38 PM (15 years ago)
Author:
boonebgorges
Message:

Global/slug review in Settings and Messages component. See #3325

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-messages/bp-messages-screens.php

    r4825 r4842  
    1212        global $bp;
    1313
    14         if ( !empty( $bp->action_variables ) ) {
     14        if ( bp_action_variables() ) {
    1515                bp_do_404();
    1616                return;
     
    2424        global $bp;
    2525
    26         if ( !empty( $bp->action_variables ) ) {
     26        if ( bp_action_variables() ) {
    2727                bp_do_404();
    2828                return;
     
    3636        global $bp;
    3737
    38         if ( !empty( $bp->action_variables ) ) {
     38        if ( bp_action_variables() ) {
    3939                bp_do_404();
    4040                return;
     
    8686
    8787function messages_screen_notices() {
    88         global $bp, $notice_id;
     88        global $notice_id;
    8989
    9090        if ( !is_super_admin() )
    9191                return false;
    9292
    93         $notice_id = isset( $bp->action_variables[1] ) ? $bp->action_variables[1] : 0;
    94 
     93        $notice_id = (int)bp_action_variable( 1 );
     94       
    9595        if ( !empty( $notice_id ) && is_numeric( $notice_id ) ) {
    9696                $notice = new BP_Messages_Notice( $notice_id );
    9797
    98                 if ( 'deactivate' == $bp->action_variables[0] ) {
     98                if ( bp_is_action_variable( 'deactivate', 0 ) ) {
    9999                        if ( !$notice->deactivate() ) {
    100100                                bp_core_add_message( __('There was a problem deactivating that notice.', 'buddypress'), 'error' );
     
    102102                                bp_core_add_message( __('Notice deactivated.', 'buddypress') );
    103103                        }
    104                 } else if ( 'activate' == $bp->action_variables[0] ) {
     104                } else if ( bp_is_action_variable( 'activate', 0 ) ) {
    105105                        if ( !$notice->activate() ) {
    106106                                bp_core_add_message( __('There was a problem activating that notice.', 'buddypress'), 'error' );
     
    108108                                bp_core_add_message( __('Notice activated.', 'buddypress') );
    109109                        }
    110                 } else if ( 'delete' == $bp->action_variables[0] ) {
     110                } else if ( bp_is_action_variable( 'delete' ) ) {
    111111                        if ( !$notice->delete() ) {
    112112                                bp_core_add_message( __('There was a problem deleting that notice.', 'buddypress'), 'buddypress' );
     
    115115                        }
    116116                }
    117                 bp_core_redirect( $bp->loggedin_user->domain . $bp->messages->slug . '/notices' );
     117                bp_core_redirect( bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices' );
    118118        }
    119119
    120         if ( !empty( $bp->action_variables ) ) {
     120        if ( bp_action_variables() ) {
    121121                bp_do_404();
    122122                return;
     
    131131        global $bp;
    132132
    133         if ( !empty( $bp->action_variables ) ) {
     133        if ( bp_action_variables() ) {
    134134                bp_do_404();
    135135                return;
Note: See TracChangeset for help on using the changeset viewer.