Skip to:
Content

BuddyPress.org

Changeset 10456


Ignore:
Timestamp:
01/19/2016 07:22:54 PM (11 years ago)
Author:
imath
Message:

Make sure the Sign-ups Administration page is available when BuddyPress is "multiblog" activated.

On multisite configs, when the constant BP_ENABLE_MULTIBLOG is set to true, Sign-ups can be managed from the Users administration of the network.

Props r-a-y, sbrajesh

Fixes #6371

Location:
trunk/src/bp-members
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/admin/bp-members-admin-classes.php

    r10422 r10456  
    483483                // Remove the 'current' class from the 'All' link.
    484484                $views['all']        = str_replace( 'class="current"', '', $views['all'] );
    485                 $views['registered'] = sprintf( '<a href="%1$s" class="current">%2$s</a>', esc_url( add_query_arg( 'page', 'bp-signups', bp_get_admin_url( 'users.php' ) ) ), sprintf( _x( 'Pending %s', 'signup users', 'buddypress' ), '<span class="count">(' . number_format_i18n( $this->signup_counts ) . ')</span>' ) );
     485                $views['registered'] = sprintf( '<a href="%1$s" class="current">%2$s</a>', esc_url( add_query_arg( 'page', 'bp-signups', network_admin_url( 'users.php' ) ) ), sprintf( _x( 'Pending %s', 'signup users', 'buddypress' ), '<span class="count">(' . number_format_i18n( $this->signup_counts ) . ')</span>' ) );
    486486
    487487                return $views;
     
    647647                                'action'    => 'resend',
    648648                        ),
    649                         bp_get_admin_url( 'users.php' )
     649                        network_admin_url( 'users.php' )
    650650                );
    651651
     
    657657                                'action'    => 'activate',
    658658                        ),
    659                         bp_get_admin_url( 'users.php' )
     659                        network_admin_url( 'users.php' )
    660660                );
    661661
     
    667667                                'action'    => 'delete',
    668668                        ),
    669                         bp_get_admin_url( 'users.php' )
     669                        network_admin_url( 'users.php' )
    670670                );
    671671
  • trunk/src/bp-members/bp-members-admin.php

    r10422 r10456  
    203203                        // Reorganise the views navigation in users.php and signups page.
    204204                        if ( current_user_can( $this->capability ) ) {
    205                                 add_filter( "views_{$this->users_screen}", array( $this, 'signup_filter_view'    ), 10, 1 );
    206                                 add_filter( 'set-screen-option',           array( $this, 'signup_screen_options' ), 10, 3 );
     205                                $user_screen = $this->users_screen;
     206
     207                                /**
     208                                 * Users screen on multiblog is users, but signups
     209                                 * need to be managed in the network for this case
     210                                 */
     211                                if ( bp_is_network_activated() && bp_is_multiblog_mode() && false === strpos( $user_screen, '-network' ) ) {
     212                                        $user_screen .= '-network';
     213                                }
     214
     215                                add_filter( "views_{$user_screen}", array( $this, 'signup_filter_view'    ), 10, 1 );
     216                                add_filter( 'set-screen-option',    array( $this, 'signup_screen_options' ), 10, 3 );
    207217                        }
    208218                }
     
    13251335
    13261336                $signups = BP_Signup::count_signups();
    1327                 $url     = add_query_arg( 'page', 'bp-signups', bp_get_admin_url( 'users.php' ) );
     1337
     1338                if ( is_network_admin() ) {
     1339                        $base_url = network_admin_url( 'users.php' );
     1340                } else {
     1341                        $base_url = bp_get_admin_url( 'users.php' );
     1342                }
     1343
     1344                $url     = add_query_arg( 'page', 'bp-signups', $base_url );
    13281345                $text    = sprintf( _x( 'Pending %s', 'signup users', 'buddypress' ), '<span class="count">(' . number_format_i18n( $signups ) . ')</span>' );
    13291346
     
    13951412                if ( ! in_array( $doaction, $allowed_actions ) || ( -1 == $doaction ) ) {
    13961413
    1397                         if ( bp_core_do_network_admin() ) {
     1414                        if ( is_network_admin() ) {
    13981415                                $bp_members_signup_list_table = self::get_list_table_class( 'BP_Members_MS_List_Table', 'ms-users' );
    13991416                        } else {
     
    17841801                $bp_members_signup_list_table->prepare_items();
    17851802
     1803                if ( is_network_admin() ) {
     1804                        $form_url = network_admin_url( 'users.php' );
     1805                } else {
     1806                        $form_url = bp_get_admin_url( 'users.php' );
     1807                }
     1808
    17861809                $form_url = add_query_arg(
    17871810                        array(
    17881811                                'page' => 'bp-signups',
    17891812                        ),
    1790                         bp_get_admin_url( 'users.php' )
     1813                        $form_url
    17911814                );
    17921815
     
    19241947                );
    19251948
    1926                 $cancel_url = add_query_arg( $url_args, bp_get_admin_url( 'users.php' ) );
     1949                if ( is_network_admin() ) {
     1950                        $base_url = network_admin_url( 'users.php' );
     1951                } else {
     1952                        $base_url = bp_get_admin_url( 'users.php' );
     1953                }
     1954
     1955                $cancel_url = add_query_arg( $url_args, $base_url );
    19271956                $action_url = wp_nonce_url(
    19281957                        add_query_arg(
    19291958                                array_merge( $url_args, $action_args ),
    1930                                 bp_get_admin_url( 'users.php' )
     1959                                $base_url
    19311960                        ),
    19321961                        'signups_' . $action
Note: See TracChangeset for help on using the changeset viewer.