Skip to:
Content

BuddyPress.org

Changeset 12039


Ignore:
Timestamp:
05/02/2018 04:46:28 PM (7 years ago)
Author:
imath
Message:

BP Nouveau: always include an invite screen to the Group create steps

As the Group Invites UI allows to invite friends or regular members, the Group create steps will include an invites screen even if the Friends component is not active.

Props hnla

Fixes #7781

Location:
trunk/src/bp-templates/bp-nouveau
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/buddypress/groups/create.php

    r11974 r12039  
    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' ); ?>
     
    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' ); ?>
  • trunk/src/bp-templates/bp-nouveau/includes/groups/functions.php

    r12018 r12039  
    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
  • trunk/src/bp-templates/bp-nouveau/includes/groups/template-tags.php

    r12008 r12039  
    357357                }
    358358            }
    359 
    360             wp_nonce_field( $core_screen['nonce'] );
    361359        }
    362360    }
     
    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" />',
     
    437449         */
    438450        do_action( 'bp_directory_groups_content' );
     451    }
     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>';
    439458    }
    440459}
  • trunk/src/bp-templates/bp-nouveau/includes/template-tags.php

    r12037 r12039  
    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        }
Note: See TracChangeset for help on using the changeset viewer.