Changeset 4844
- Timestamp:
- 07/25/2011 12:01:55 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-template.php
r4840 r4844 761 761 } else { 762 762 // When no $position is specified, check the entire array 763 $is_action_variable = in_array( $action_variable, bp_action_variables() );763 $is_action_variable = in_array( $action_variable, (array)bp_action_variables() ); 764 764 } 765 765 -
trunk/bp-forums/bp-forums-template.php
r4821 r4844 1380 1380 } 1381 1381 function bp_get_forum_topic_action() { 1382 global $bp; 1383 1384 return apply_filters( 'bp_get_forum_topic_action', bp_get_root_domain() . esc_attr( $_SERVER['REQUEST_URI'] ) ); 1382 return apply_filters( 'bp_get_forum_topic_action', $_SERVER['REQUEST_URI'] ); 1385 1383 } 1386 1384 -
trunk/bp-groups/bp-groups-actions.php
r4823 r4844 30 30 31 31 // If no current step is set, reset everything so we can start a fresh group creation 32 if ( ! isset( $bp->action_variables[1] ) || !$bp->groups->current_create_step = $bp->action_variables[1]) {32 if ( !bp_action_variable( 1 ) ) { 33 33 34 34 unset( $bp->groups->current_create_step ); … … 43 43 44 44 // If this is a creation step that is not recognized, just redirect them back to the first screen 45 if ( $ bp->action_variables[1] && !$bp->groups->group_creation_steps[$bp->action_variables[1]] ) {45 if ( $step = bp_action_variable( 1 ) && !$bp->groups->group_creation_steps[$step] ) { 46 46 bp_core_add_message( __('There was an error saving group details. Please try again.', 'buddypress'), 'error' ); 47 47 bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/' ); -
trunk/bp-groups/bp-groups-classes.php
r4823 r4844 1251 1251 1252 1252 // Catch the edit screen and forward it to the plugin template 1253 if ( bp_is_groups_component() && bp_is_current_action( 'admin' ) && !empty( $bp->action_variables[0] ) && $this->slug == $bp->action_variables[0]) {1253 if ( bp_is_groups_component() && bp_is_current_action( 'admin' ) && bp_is_action_variable( $this->slug, 0 ) ) { 1254 1254 // Check whether the user is saving changes 1255 1255 $this->edit_screen_save(); -
trunk/bp-groups/bp-groups-loader.php
r4823 r4844 97 97 // When in a single group, the first action is bumped down one because of the 98 98 // group name, so we need to adjust this and set the group name to current_item. 99 $bp->current_item = isset( $bp->current_action ) ? $bp->current_action : false;100 $bp->current_action = isset( $bp->action_variables[0] ) ? $bp->action_variables[0] : false;99 $bp->current_item = bp_current_action(); 100 $bp->current_action = bp_action_variable( 0 ); 101 101 array_shift( $bp->action_variables ); 102 102 -
trunk/bp-groups/bp-groups-screens.php
r4823 r4844 39 39 40 40 function groups_screen_group_invites() { 41 global $bp; 42 43 $group_id = 0; 44 if ( isset( $bp->action_variables[1] ) ) 45 $group_id = $bp->action_variables[1]; 46 47 if ( isset( $bp->action_variables ) && in_array( 'accept', (array)$bp->action_variables ) && is_numeric( $group_id ) ) { 41 $group_id = (int)bp_action_variable( 1 ); 42 43 if ( bp_is_action_variable( 'accept' ) && is_numeric( $group_id ) ) { 48 44 // Check the nonce 49 45 if ( !check_admin_referer( 'groups_accept_invite' ) ) 50 46 return false; 51 47 52 if ( !groups_accept_invite( $bp->loggedin_user->id, $group_id ) ) {48 if ( !groups_accept_invite( bp_loggedin_user_id(), $group_id ) ) { 53 49 bp_core_add_message( __('Group invite could not be accepted', 'buddypress'), 'error' ); 54 50 } else { … … 59 55 60 56 groups_record_activity( array( 61 'action' => apply_filters_ref_array( 'groups_activity_accepted_invite_action', array( sprintf( __( '%1$s joined the group %2$s', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $group ) . '">' . esc_attr( $group->name ) . '</a>' ), $bp->loggedin_user->id, &$group ) ),57 'action' => apply_filters_ref_array( 'groups_activity_accepted_invite_action', array( sprintf( __( '%1$s joined the group %2$s', 'buddypress'), bp_core_get_userlink( bp_loggedin_user_id() ), '<a href="' . bp_get_group_permalink( $group ) . '">' . esc_attr( $group->name ) . '</a>' ), bp_loggedin_user_id(), &$group ) ), 62 58 'type' => 'joined_group', 63 59 'item_id' => $group->id … … 65 61 } 66 62 67 bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action);68 69 } else if ( isset( $bp->action_variables ) && in_array( 'reject', (array)$bp->action_variables) && is_numeric( $group_id ) ) {63 bp_core_redirect( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() ); 64 65 } else if ( bp_is_action_variable( 'reject' ) && is_numeric( $group_id ) ) { 70 66 // Check the nonce 71 67 if ( !check_admin_referer( 'groups_reject_invite' ) ) 72 68 return false; 73 69 74 if ( !groups_reject_invite( $bp->loggedin_user->id, $group_id ) )70 if ( !groups_reject_invite( bp_loggedin_user_id(), $group_id ) ) 75 71 bp_core_add_message( __('Group invite could not be rejected', 'buddypress'), 'error' ); 76 72 else 77 73 bp_core_add_message( __('Group invite rejected', 'buddypress') ); 78 74 79 bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action);75 bp_core_redirect( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() ); 80 76 } 81 77 82 78 // Remove notifications 83 bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->groups->id, 'group_invite' );79 bp_core_delete_notifications_by_type( bp_loggedin_user_id(), 'groups', 'group_invite' ); 84 80 85 81 do_action( 'groups_screen_group_invites', $group_id ); … … 105 101 } 106 102 103 /** 104 * This screen function handles actions related to group forums 105 * 106 * @package BuddyPress 107 */ 107 108 function groups_screen_group_forum() { 108 109 global $bp; … … 111 112 return false; 112 113 113 if ( !empty( $bp->action_variables[0] ) && 'topic' != $bp->action_variables[0]) {114 if ( bp_action_variable( 0 ) && !bp_is_action_variable( 'topic', 0 ) ) { 114 115 bp_do_404(); 115 116 return; … … 124 125 125 126 // Fetch the details we need 126 $topic_slug = !empty( $bp->action_variables[1] ) ? $bp->action_variables[1] : false;127 $topic_slug = (string)bp_action_variable( 1 ); 127 128 $topic_id = bp_forums_get_topic_id_from_slug( $topic_slug ); 128 129 $forum_id = groups_get_groupmeta( $bp->groups->current_group->id, 'forum_id' ); … … 135 136 136 137 // Posting a reply 137 if ( !$user_is_banned && ! isset( $bp->action_variables[2]) && isset( $_POST['submit_reply'] ) ) {138 if ( !$user_is_banned && !bp_action_variable( 2 ) && isset( $_POST['submit_reply'] ) ) { 138 139 // Check the nonce 139 140 check_admin_referer( 'bp_forums_new_reply' ); … … 153 154 $query_vars = '?' . $_SERVER['QUERY_STRING']; 154 155 155 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group) . 'forum/topic/' . $topic_slug . '/' . $query_vars . '#post-' . $post_id );156 bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' . $query_vars . '#post-' . $post_id ); 156 157 } 157 158 158 159 // Sticky a topic 159 else if ( isset( $bp->action_variables[2] ) && 'stick' == $bp->action_variables[2]&& ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) {160 else if ( bp_is_action_variable( 'stick', 2 ) && ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) { 160 161 // Check the nonce 161 162 check_admin_referer( 'bp_forums_stick_topic' ); … … 171 172 172 173 // Un-Sticky a topic 173 else if ( isset( $bp->action_variables[2] ) && 'unstick' == $bp->action_variables[2]&& ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) {174 else if ( bp_is_action_variable( 'unstick', 2 ) && ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) { 174 175 // Check the nonce 175 176 check_admin_referer( 'bp_forums_unstick_topic' ); … … 185 186 186 187 // Close a topic 187 else if ( isset( $bp->action_variables[2] ) && 'close' == $bp->action_variables[2]&& ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) {188 else if ( bp_is_action_variable( 'close', 2 ) && ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) { 188 189 // Check the nonce 189 190 check_admin_referer( 'bp_forums_close_topic' ); … … 199 200 200 201 // Open a topic 201 else if ( isset( $bp->action_variables[2] ) && 'open' == $bp->action_variables[2]&& ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) {202 else if ( bp_is_action_variable( 'open', 2 ) && ( isset( $bp->is_item_admin ) || isset( $bp->is_item_mod ) ) ) { 202 203 // Check the nonce 203 204 check_admin_referer( 'bp_forums_open_topic' ); … … 213 214 214 215 // Delete a topic 215 else if ( empty( $user_is_banned ) && isset( $bp->action_variables[2] ) && 'delete' == $bp->action_variables[2] && empty( $bp->action_variables[3]) ) {216 else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && !bp_action_variable( 3 ) ) { 216 217 // Fetch the topic 217 218 $topic = bp_forums_get_topic_details( $topic_id ); … … 232 233 233 234 do_action( 'groups_delete_forum_topic', $topic_id ); 234 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group) . 'forum/' );235 bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/' ); 235 236 } 236 237 237 238 // Editing a topic 238 else if ( empty( $user_is_banned ) && isset( $bp->action_variables[2] ) && 'edit' == $bp->action_variables[2] && empty( $bp->action_variables[3]) ) {239 else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && !bp_action_variable( 3 ) ) { 239 240 // Fetch the topic 240 241 $topic = bp_forums_get_topic_details( $topic_id ); … … 256 257 257 258 do_action( 'groups_edit_forum_topic', $topic_id ); 258 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group) . 'forum/topic/' . $topic_slug . '/' );259 bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' ); 259 260 } 260 261 … … 263 264 264 265 // Delete a post 265 else if ( empty( $user_is_banned ) && isset( $bp->action_variables[2] ) && 'delete' == $bp->action_variables[2] && isset( $bp->action_variables[4] ) && $post_id = $bp->action_variables[4]) {266 else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && $post_id = bp_action_variable( 4 ) ) { 266 267 // Fetch the post 267 268 $post = bp_forums_get_post( $post_id ); … … 276 277 do_action( 'groups_before_delete_forum_post', $post_id ); 277 278 278 if ( !groups_delete_group_forum_post( $ bp->action_variables[4], $topic_id ) )279 if ( !groups_delete_group_forum_post( $post_id ) ) 279 280 bp_core_add_message( __( 'There was an error deleting that post', 'buddypress'), 'error' ); 280 281 else … … 286 287 287 288 // Editing a post 288 else if ( empty( $user_is_banned ) && isset( $bp->action_variables[2] ) && 'edit' == $bp->action_variables[2] && isset( $bp->action_variables[4] ) && $post_id = $bp->action_variables[4]) {289 else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && $post_id = bp_action_variable( 4 ) ) { 289 290 // Fetch the post 290 $post = bp_forums_get_post( $ bp->action_variables[4]);291 $post = bp_forums_get_post( $post_id ); 291 292 292 293 // Check the logged in user can edit this topic … … 298 299 check_admin_referer( 'bp_forums_edit_post' ); 299 300 300 if ( !$post_id = groups_update_group_forum_post( $post_id, $_POST['post_text'], $topic_id, $_GET['topic_page'] ) ) 301 $topic_page = isset( $_GET['topic_page'] ) ? $_GET['topic_page'] : false; 302 303 if ( !$post_id = groups_update_group_forum_post( $post_id, $_POST['post_text'], $topic_id, $topic_page ) ) 301 304 bp_core_add_message( __( 'There was an error when editing that post', 'buddypress'), 'error' ); 302 305 else … … 387 390 388 391 if ( $bp->is_single_item ) { 389 if ( !empty( $bp->action_variables[0] ) && 'send' == $bp->action_variables[0]) {392 if ( bp_is_action_variable( 'send', 0 ) ) { 390 393 391 394 if ( !check_admin_referer( 'groups_send_invites', '_wpnonce_send_invites' ) ) … … 404 407 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) ); 405 408 406 } elseif ( empty( $bp->action_variables[0]) ) {409 } elseif ( !bp_action_variable( 0 ) ) { 407 410 // Show send invite page 408 411 bp_core_load_template( apply_filters( 'groups_template_group_invite', 'groups/single/home' ) ); … … 444 447 global $bp; 445 448 446 if ( !bp_is_groups_component() || !bp_is_active( 'activity' ) || ( bp_is_active( 'activity' ) && !bp_is_current_action( bp_get_activity_slug() ) ) || empty( $bp->action_variables[0]) )449 if ( !bp_is_groups_component() || !bp_is_active( 'activity' ) || ( bp_is_active( 'activity' ) && !bp_is_current_action( bp_get_activity_slug() ) ) || !bp_action_variable( 0 ) ) 447 450 return false; 448 451 … … 454 457 455 458 function groups_screen_group_admin() { 456 global $bp;457 458 459 if ( !bp_is_groups_component() || !bp_is_current_action( 'admin' ) ) 459 460 return false; 460 461 461 if ( !empty( $bp->action_variables[0]) )462 if ( bp_action_variables() ) 462 463 return false; 463 464 464 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group) . 'admin/edit-details/' );465 bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/edit-details/' ); 465 466 } 466 467 … … 468 469 global $bp; 469 470 470 if ( bp_is_groups_component() && isset( $bp->action_variables[0] ) && 'edit-details' == $bp->action_variables[0]) {471 if ( bp_is_groups_component() && bp_is_action_variable( 'edit-details', 0 ) ) { 471 472 472 473 if ( $bp->is_item_admin || $bp->is_item_mod ) { … … 486 487 do_action( 'groups_group_details_edited', $bp->groups->current_group->id ); 487 488 488 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group) . 'admin/edit-details/' );489 bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/edit-details/' ); 489 490 } 490 491 … … 500 501 global $bp; 501 502 502 if ( bp_is_groups_component() && isset( $bp->action_variables[0] ) && 'group-settings' == $bp->action_variables[0]) {503 if ( bp_is_groups_component() && bp_is_action_variable( 'group-settings', 0 ) ) { 503 504 504 505 if ( !$bp->is_item_admin ) … … 529 530 do_action( 'groups_group_settings_edited', $bp->groups->current_group->id ); 530 531 531 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group) . 'admin/group-settings/' );532 bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/group-settings/' ); 532 533 } 533 534 … … 542 543 global $bp; 543 544 544 if ( bp_is_groups_component() && isset( $bp->action_variables[0] ) && 'group-avatar' == $bp->action_variables[0]) {545 if ( bp_is_groups_component() && bp_is_action_variable( 'group-avatar', 0 ) ) { 545 546 546 547 if ( !$bp->is_item_admin ) … … 548 549 549 550 // If the group admin has deleted the admin avatar 550 if ( isset( $bp->action_variables[1] ) && 'delete' == $bp->action_variables[1]) {551 if ( bp_is_action_variable( 'delete', 1 ) ) { 551 552 552 553 // Check the nonce … … 597 598 add_action( 'bp_screens', 'groups_screen_group_admin_avatar' ); 598 599 600 /** 601 * This function handles actions related to member management on the group admin. 602 * 603 * @package BuddyPress 604 */ 599 605 function groups_screen_group_admin_manage_members() { 600 606 global $bp; 601 607 602 if ( bp_is_groups_component() && isset( $bp->action_variables[0] ) && 'manage-members' == $bp->action_variables[0]) {608 if ( bp_is_groups_component() && bp_is_action_variable( 'manage-members', 0 ) ) { 603 609 604 610 if ( !$bp->is_item_admin ) 605 611 return false; 606 612 607 if ( isset( $bp->action_variables[1] ) && isset( $bp->action_variables[2] ) && isset( $bp->action_variables[3]) ) {608 if ( 'promote' == $bp->action_variables[1] && ( 'mod' == $bp->action_variables[2] || 'admin' == $bp->action_variables[2] ) && is_numeric( $bp->action_variables[3]) ) {609 $user_id = $bp->action_variables[3];610 $status = $bp->action_variables[2];611 613 if ( bp_action_variable( 1 ) && bp_action_variable( 2 ) && bp_action_variable( 3 ) ) { 614 if ( bp_is_action_variable( 'promote', 1 ) && ( bp_is_action_variable( 'mod', 2 ) || bp_is_action_variable( 'admin', 2 ) ) && is_numeric( bp_action_variable( 3 ) ) ) { 615 $user_id = bp_action_variable( 3 ); 616 $status = bp_action_variable( 2 ); 617 612 618 // Check the nonce first. 613 619 if ( !check_admin_referer( 'groups_promote_member' ) ) … … 622 628 do_action( 'groups_promoted_member', $user_id, $bp->groups->current_group->id ); 623 629 624 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group) . 'admin/manage-members/' );625 } 626 } 627 628 if ( isset( $bp->action_variables[1] ) && isset( $bp->action_variables[2]) ) {629 if ( 'demote' == $bp->action_variables[1] && is_numeric( $bp->action_variables[2]) ) {630 $user_id = $bp->action_variables[2];630 bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' ); 631 } 632 } 633 634 if ( bp_action_variable( 1 ) && bp_action_variable( 2 ) ) { 635 if ( bp_is_action_variable( 'demote', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) { 636 $user_id = bp_action_variable( 2 ); 631 637 632 638 // Check the nonce first. … … 642 648 do_action( 'groups_demoted_member', $user_id, $bp->groups->current_group->id ); 643 649 644 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group) . 'admin/manage-members/' );645 } 646 647 if ( 'ban' == $bp->action_variables[1] && is_numeric( $bp->action_variables[2]) ) {648 $user_id = $bp->action_variables[2];649 650 bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' ); 651 } 652 653 if ( bp_is_action_variable( 'ban', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) { 654 $user_id = bp_action_variable( 2 ); 655 650 656 // Check the nonce first. 651 657 if ( !check_admin_referer( 'groups_ban_member' ) ) … … 660 666 do_action( 'groups_banned_member', $user_id, $bp->groups->current_group->id ); 661 667 662 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group) . 'admin/manage-members/' );663 } 664 665 if ( 'unban' == $bp->action_variables[1] && is_numeric( $bp->action_variables[2]) ) {666 $user_id = $bp->action_variables[2];667 668 bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' ); 669 } 670 671 if ( bp_is_action_variable( 'unban', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) { 672 $user_id = bp_action_variable( 2 ); 673 668 674 // Check the nonce first. 669 675 if ( !check_admin_referer( 'groups_unban_member' ) ) … … 678 684 do_action( 'groups_unbanned_member', $user_id, $bp->groups->current_group->id ); 679 685 680 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group) . 'admin/manage-members/' );681 } 682 683 if ( 'remove' == $bp->action_variables[1] && is_numeric( $bp->action_variables[2]) ) {684 $user_id = $bp->action_variables[2];685 686 bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' ); 687 } 688 689 if ( bp_is_action_variable( 'remove', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) { 690 $user_id = bp_action_variable( 2 ); 691 686 692 // Check the nonce first. 687 693 if ( !check_admin_referer( 'groups_remove_member' ) ) … … 696 702 do_action( 'groups_removed_member', $user_id, $bp->groups->current_group->id ); 697 703 698 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group) . 'admin/manage-members/' );704 bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' ); 699 705 } 700 706 } … … 710 716 global $bp; 711 717 712 if ( bp_is_groups_component() && isset( $bp->action_variables[0] ) && 'membership-requests' == $bp->action_variables[0] ) { 713 714 // Ask for a login if the user is coming here via an email notification 715 if ( !is_user_logged_in() ) 716 bp_core_redirect( site_url( 'wp-login.php?redirect_to=' . bp_get_root_domain() . '/' . $bp->current_component . '/' . bp_current_item() . '/admin/membership-requests/' ) ); 718 if ( bp_is_groups_component() && bp_is_action_variable( 'membership-requests', 0 ) ) { 717 719 718 720 if ( !$bp->is_item_admin || 'public' == $bp->groups->current_group->status ) … … 720 722 721 723 // Remove any screen notifications 722 bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->groups->id, 'new_membership_request' );723 724 $request_action = ( !empty( $bp->action_variables[1] ) ? $bp->action_variables[1] : '');725 $membership_id = ( !empty( $bp->action_variables[2] ) ? $bp->action_variables[2] : 0);724 bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'new_membership_request' ); 725 726 $request_action = (string)bp_action_variable( 1 ); 727 $membership_id = (int)bp_action_variable( 2 ); 726 728 727 729 if ( !empty( $request_action ) && !empty( $membership_id ) ) { … … 751 753 752 754 do_action( 'groups_group_request_managed', $bp->groups->current_group->id, $request_action, $membership_id ); 753 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group) . 'admin/membership-requests/' );755 bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/membership-requests/' ); 754 756 } 755 757 … … 763 765 global $bp; 764 766 765 if ( bp_is_groups_component() && isset( $bp->action_variables[0] ) && 'delete-group' == $bp->action_variables[0]) {767 if ( bp_is_groups_component() && bp_is_action_variable( 'delete-group', 0 ) ) { 766 768 767 769 if ( !$bp->is_item_admin && !is_super_admin() ) … … 783 785 do_action( 'groups_group_deleted', $bp->groups->current_group->id ); 784 786 785 bp_core_redirect( $bp->loggedin_user->domain. bp_get_groups_slug() . '/' );786 } 787 788 bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component);787 bp_core_redirect( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' ); 788 } 789 790 bp_core_redirect( bp_loggedin_user_domain() . bp_get_groups_slug() ); 789 791 } 790 792 -
trunk/bp-groups/bp-groups-template.php
r4823 r4844 1267 1267 $group = ( $groups_template->group ) ? $groups_template->group : $bp->groups->current_group; 1268 1268 1269 $current_tab = $bp->action_variables[0];1269 $current_tab = bp_action_variable( 0 ); 1270 1270 ?> 1271 1271 <?php if ( $bp->is_item_admin || $bp->is_item_mod ) { ?> … … 1314 1314 } 1315 1315 function bp_get_group_admin_form_action( $page = false, $group = false ) { 1316 global $ bp, $groups_template;1316 global $groups_template; 1317 1317 1318 1318 if ( !$group ) … … 1320 1320 1321 1321 if ( !$page ) 1322 $page = $bp->action_variables[0];1322 $page = bp_action_variable( 0 ); 1323 1323 1324 1324 return apply_filters( 'bp_group_admin_form_action', bp_get_group_permalink( $group ) . 'admin/' . $page ); … … 1326 1326 1327 1327 function bp_group_has_requested_membership( $group = false ) { 1328 global $ bp, $groups_template;1328 global $groups_template; 1329 1329 1330 1330 if ( !$group ) 1331 1331 $group =& $groups_template->group; 1332 1332 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 ) ) 1334 1334 return true; 1335 1335 … … 2015 2015 global $bp; 2016 2016 2017 if ( empty( $bp->action_variables[1]) )2017 if ( !bp_action_variable( 1 ) ) 2018 2018 $bp->action_variables[1] = array_shift( array_keys( $bp->groups->group_creation_steps ) ); 2019 2019 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 ) ); 2021 2021 } 2022 2022 … … 2029 2029 2030 2030 /* 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 ) 2032 2032 return true; 2033 2033 … … 2039 2039 2040 2040 /* Check the current step against the step parameter */ 2041 if ( $bp->action_variables[1] == $step_slug)2041 if ( bp_is_action_variable( $step_slug ) ) 2042 2042 return true; 2043 2043 … … 2175 2175 2176 2176 foreach ( (array)$bp->groups->group_creation_steps as $slug => $name ) { 2177 if ( $slug == $bp->action_variables[1])2177 if ( bp_is_action_variable( $slug ) ) 2178 2178 break; 2179 2179 … … 2181 2181 } 2182 2182 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 ) ); 2184 2184 } 2185 2185 … … 2261 2261 } 2262 2262 2263 /** 2264 * Displays group header tabs 2265 * 2266 * @package BuddyPress 2267 * @todo Deprecate? 2268 */ 2263 2269 function bp_groups_header_tabs() { 2264 global $ bp, $create_group_step, $completed_to_step;2270 global $create_group_step, $completed_to_step; 2265 2271 ?> 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> 2272 2278 <?php 2273 2279 do_action( 'groups_header_tabs' ); 2274 2280 } 2275 2281 2282 /** 2283 * Displays group filter titles 2284 * 2285 * @package BuddyPress 2286 * @todo Deprecate? 2287 */ 2276 2288 function bp_groups_filter_title() { 2277 global $bp; 2278 2279 $current_filter = $bp->action_variables[0]; 2289 $current_filter = bp_action_variable( 0 ); 2280 2290 2281 2291 switch ( $current_filter ) { … … 2303 2313 2304 2314 function bp_is_group_admin_screen( $slug ) { 2305 global $bp;2306 2307 2315 if ( !bp_is_groups_component() || !bp_is_current_action( 'admin' ) ) 2308 2316 return false; 2309 2317 2310 if ( $bp->action_variables[0] == $slug)2318 if ( bp_is_action_variable( $slug ) ) 2311 2319 return true; 2312 2320
Note: See TracChangeset
for help on using the changeset viewer.