Skip to:
Content

BuddyPress.org

Ticket #7781: 7781.2.patch

File 7781.2.patch, 6.2 KB (added by imath, 7 years ago)
  • deleted file src/bp-templates/bp-nouveau/buddypress/groups/create-invites.php

    diff --git src/bp-templates/bp-nouveau/buddypress/groups/create-invites.php src/bp-templates/bp-nouveau/buddypress/groups/create-invites.php
    deleted file mode 100644
    index d2d2a9f65..000000000
    + -  
    1 <?php
    2 /**
    3 * Group create step invite friends
    4 *
    5 * This template include provides the standard BP invites step screen content
    6 *
    7 * @since 3.0.0
    8 */
    9 ?>
    10 
    11 <?php bp_nouveau_user_feedback( 'create-invite-friends' ); ?>
    12 
    13 <?php
    14 bp_new_group_invite_friend_list( array(  'before' => '<ul class="friends-list create-group-invites">', 'after' => '</ul>' ) );
  • src/bp-templates/bp-nouveau/buddypress/groups/create.php

    diff --git src/bp-templates/bp-nouveau/buddypress/groups/create.php src/bp-templates/bp-nouveau/buddypress/groups/create.php
    index 7d7b43fce..9d038a68b 100644
    bp_nouveau_groups_create_hook( 'before', 'page' ); ?> 
    99
    1010        <?php bp_nouveau_groups_create_hook( 'before', 'content_template' ); ?>
    1111
    12         <form action="<?php bp_group_creation_form_action(); ?>" method="post" id="create-group-form" class="standard-form" enctype="multipart/form-data">
     12        <?php if ( 'group-invites' !== bp_get_groups_current_create_step() ) : ?>
     13                <form action="<?php bp_group_creation_form_action(); ?>" method="post" id="create-group-form" class="standard-form" enctype="multipart/form-data">
     14        <?php else : ?>
     15                <div id="create-group-form" class="standard-form">
     16        <?php endif; ?>
    1317
    1418                <?php bp_nouveau_groups_create_hook( 'before' ); ?>
    1519
    bp_nouveau_groups_create_hook( 'before', 'page' ); ?> 
    3135
    3236                <?php bp_nouveau_groups_create_hook( 'after' ); ?>
    3337
    34         </form>
     38        <?php if ( 'group-invites' !== bp_get_groups_current_create_step() ) : ?>
     39                </form><!-- #create-group-form -->
     40        <?php else : ?>
     41                </div><!-- #create-group-form -->
     42        <?php endif; ?>
    3543
    3644        <?php bp_nouveau_groups_create_hook( 'after', 'content_template' ); ?>
    3745
  • src/bp-templates/bp-nouveau/includes/groups/functions.php

    diff --git src/bp-templates/bp-nouveau/includes/groups/functions.php src/bp-templates/bp-nouveau/includes/groups/functions.php
    index 0a593e763..44f235269 100644
    function bp_nouveau_groups_remove_home_widget_filters() { 
    10661066function bp_nouveau_group_get_core_create_screens( $id = '' ) {
    10671067        // screen id => dynamic part of the hooks, nonce & specific template to use.
    10681068        $screens = array(
    1069                 'group-details'     => array( 'hook' => 'group_details_creation_step',     'nonce' => 'groups_create_save_group-details',     'template' => 'groups/single/admin/edit-details' ),
    1070                 'group-settings'    => array( 'hook' => 'group_settings_creation_step',    'nonce' => 'groups_create_save_group-settings',                                                     ),
    1071                 'group-avatar'      => array( 'hook' => 'group_avatar_creation_step',      'nonce' => 'groups_create_save_group-avatar',                                                       ),
    1072                 'group-cover-image' => array( 'hook' => 'group_cover_image_creation_step', 'nonce' => 'groups_create_save_group-cover-image',                                                  ),
    1073                 'group-invites'     => array( 'hook' => 'group_invites_creation_step',     'nonce' => 'groups_create_save_group-invites',     'template' => 'groups/create-invites'      ),
     1069                'group-details' => array(
     1070                        'hook'     => 'group_details_creation_step',
     1071                        'nonce'    => 'groups_create_save_group-details',
     1072                        'template' => 'groups/single/admin/edit-details',
     1073                ),
     1074                'group-settings' => array(
     1075                        'hook'  => 'group_settings_creation_step',
     1076                        'nonce' => 'groups_create_save_group-settings',
     1077                ),
     1078                'group-avatar' => array(
     1079                        'hook'  => 'group_avatar_creation_step',
     1080                        'nonce' => 'groups_create_save_group-avatar',
     1081                ),
     1082                'group-cover-image' => array(
     1083                        'hook'  => 'group_cover_image_creation_step',
     1084                        'nonce' => 'groups_create_save_group-cover-image',
     1085                ),
     1086                'group-invites' => array(
     1087                        'hook'     => 'group_invites_creation_step',
     1088                        'nonce'    => 'groups_create_save_group-invites',
     1089                        'template' => 'common/js-templates/invites/index',
     1090                ),
    10741091        );
    10751092
    10761093        if ( isset( $screens[ $id ] ) ) {
  • src/bp-templates/bp-nouveau/includes/groups/template-tags.php

    diff --git src/bp-templates/bp-nouveau/includes/groups/template-tags.php src/bp-templates/bp-nouveau/includes/groups/template-tags.php
    index c4d9afc72..87f9d64ad 100644
    function bp_nouveau_group_manage_screen() { 
    356356                                        );
    357357                                }
    358358                        }
    359 
    360                         wp_nonce_field( $core_screen['nonce'] );
    361359                }
    362360        }
    363361
    function bp_nouveau_group_manage_screen() { 
    413411                do_action( 'bp_after_group_creation_step_buttons' );
    414412        }
    415413
     414        /**
     415         * Avoid nested forms with the Backbone views for the group invites step.
     416         */
     417        if ( 'group-invites' === bp_get_groups_current_create_step() ) {
     418                printf(
     419                        '<form action="%s" method="post" enctype="multipart/form-data">',
     420                        bp_get_group_creation_form_action()
     421                );
     422        }
     423
     424        if ( ! empty( $core_screen['nonce'] ) ) {
     425                wp_nonce_field( $core_screen['nonce'] );
     426        }
     427
    416428        printf(
    417429                '<input type="hidden" name="group-id" id="group-id" value="%s" />',
    418430                $is_group_create ? esc_attr( bp_get_new_group_id() ) : esc_attr( bp_get_group_id() )
    function bp_nouveau_group_manage_screen() { 
    437449                 */
    438450                do_action( 'bp_directory_groups_content' );
    439451        }
     452
     453        /**
     454         * Avoid nested forms with the Backbone views for the group invites step.
     455         */
     456        if ( 'group-invites' === bp_get_groups_current_create_step() ) {
     457                echo '</form>';
     458        }
    440459}
    441460
    442461/**
  • src/bp-templates/bp-nouveau/includes/template-tags.php

    diff --git src/bp-templates/bp-nouveau/includes/template-tags.php src/bp-templates/bp-nouveau/includes/template-tags.php
    index 6c6b44c64..79d4c3215 100644
    function bp_nouveau_single_item_subnav_classes() { 
    15931593                        $classes[] = 'group-subnav';
    15941594                }
    15951595
    1596                 if ( bp_is_group() && 'send-invites' === bp_current_action() ) {
     1596                if ( ( bp_is_group() && 'send-invites' === bp_current_action() ) || ( bp_is_group_create() && 'group-invites' === bp_get_groups_current_create_step() ) ) {
    15971597                        $classes[] = 'bp-invites-nav';
    15981598                }
    15991599