Changeset 12955
- Timestamp:
- 05/22/2021 12:52:18 PM (2 years ago)
- Location:
- trunk/src/bp-xprofile
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-admin.php
r12886 r12955 189 189 <?php endforeach; endif; ?> 190 190 191 <?php if ( bp_get_signup_allowed() ) : ?> 192 <li id="signup-group" class="not-sortable last"> 193 <a href="#tabs-signup-group" class="ui-tab"> 194 <?php esc_html_e( 'Signup Fields', 'buddypress' ); ?> 195 </a> 196 </li> 197 <?php endif; ?> 191 <li id="signup-group" class="not-sortable last"> 192 <a href="#tabs-signup-group" class="ui-tab"> 193 <?php esc_html_e( 'Signup Fields', 'buddypress' ); ?> 194 </a> 195 </li> 198 196 199 197 </ul> … … 313 311 314 312 <?php 315 // List fields to use into the signup form. 316 if ( bp_get_signup_allowed() ) { 317 $signup_groups = bp_xprofile_get_groups( 318 array( 319 'fetch_fields' => true, 320 'signup_fields_only' => true, 321 ) 322 ); 323 $has_signup_fields = false; 324 $signup_fields = array(); 325 $signup_fields_order = bp_xprofile_get_signup_field_ids(); 326 ?> 327 <div id="tabs-signup-group"" class="tab-wrapper"> 328 <div class="tab-toolbar"> 329 <p class="description"><?php esc_html_e( 'Drag fields from other groups and drop them on the above tab to include them into your registration form.', 'buddypress' ); ?></a> 330 </div> 331 <fieldset id="signup-fields" class="connectedSortable field-group" aria-live="polite" aria-atomic="true" aria-relevant="all"> 332 <legend class="screen-reader-text"> 333 <?php esc_html_e( 'Fields to use into the registration form', 'buddypress' );?> 334 </legend> 335 336 <?php 337 if ( ! empty( $signup_groups ) ) { 338 foreach ( $signup_groups as $signup_group ) { 339 if ( ! empty( $signup_group->fields ) ) { 340 $has_signup_fields = true; 341 342 foreach ( $signup_group->fields as $signup_field ) { 343 // Load the field. 344 $_signup_field = xprofile_get_field( $signup_field, null, false ); 345 346 /** 347 * This function handles the WYSIWYG profile field 348 * display for the xprofile admin setup screen. 349 */ 350 $signup_fields[ $_signup_field->id ] = bp_xprofile_admin_get_signup_field( $_signup_field, $signup_group, '' ); 351 } 313 $signup_groups = bp_xprofile_get_groups( 314 array( 315 'fetch_fields' => true, 316 'signup_fields_only' => true, 317 ) 318 ); 319 $has_signup_fields = false; 320 $signup_fields = array(); 321 $signup_fields_order = bp_xprofile_get_signup_field_ids(); 322 ?> 323 <div id="tabs-signup-group"" class="tab-wrapper"> 324 <div class="tab-toolbar"> 325 <p class="description"><?php esc_html_e( 'Drag fields from other groups and drop them on the above tab to include them into your registration form.', 'buddypress' ); ?></a> 326 </div> 327 <fieldset id="signup-fields" class="connectedSortable field-group" aria-live="polite" aria-atomic="true" aria-relevant="all"> 328 <legend class="screen-reader-text"> 329 <?php esc_html_e( 'Fields to use into the registration form', 'buddypress' );?> 330 </legend> 331 332 <?php 333 if ( ! empty( $signup_groups ) ) { 334 foreach ( $signup_groups as $signup_group ) { 335 if ( ! empty( $signup_group->fields ) ) { 336 $has_signup_fields = true; 337 338 foreach ( $signup_group->fields as $signup_field ) { 339 // Load the field. 340 $_signup_field = xprofile_get_field( $signup_field, null, false ); 341 342 /** 343 * This function handles the WYSIWYG profile field 344 * display for the xprofile admin setup screen. 345 */ 346 $signup_fields[ $_signup_field->id ] = bp_xprofile_admin_get_signup_field( $_signup_field, $signup_group, '' ); 352 347 } 353 348 } 354 355 // Output signup fields according to their signup position. 356 foreach ( $signup_fields_order as $ordered_signup_field_id ) { 357 if ( ! isset( $signup_fields[ $ordered_signup_field_id ] ) ) { 358 continue; 359 } 360 361 echo $signup_fields[ $ordered_signup_field_id ]; 349 } 350 351 // Output signup fields according to their signup position. 352 foreach ( $signup_fields_order as $ordered_signup_field_id ) { 353 if ( ! isset( $signup_fields[ $ordered_signup_field_id ] ) ) { 354 continue; 362 355 } 356 357 echo $signup_fields[ $ordered_signup_field_id ]; 363 358 } 364 365 if ( ! $has_signup_fields ) { 366 ?> 367 <p class="nodrag nofields"><?php esc_html_e( 'There are no registration fields set. The registration form uses the primary group by default.', 'buddypress' ); ?></p> 368 <?php 359 } 360 361 if ( ! $has_signup_fields ) { 362 ?> 363 <p class="nodrag nofields"><?php esc_html_e( 'There are no registration fields set. The registration form uses the primary group by default.', 'buddypress' ); ?></p> 364 <?php 365 } 366 ?> 367 </fieldset> 368 369 <?php if ( bp_get_signup_allowed() ) : ?> 370 <p><?php esc_html_e( '* Fields in this group appear on the registration page.', 'buddypress' ); ?></p> 371 <?php else : ?> 372 <p> 373 <?php 374 // Include a link to edit settings. 375 $settings_link = ''; 376 377 if ( is_multisite() && current_user_can( 'manage_network_users') ) { 378 $settings_link = sprintf( 379 ' <a href="%1$">%2$s</a>.', 380 esc_url( network_admin_url( 'settings.php' ) ), 381 esc_html__( 'Edit settings', 'buddypress' ) 382 ); 383 } elseif ( current_user_can( 'manage_options' ) ) { 384 $settings_link = sprintf( 385 ' <a href="%1$s">%2$s</a>.', 386 esc_url( bp_get_admin_url( 'options-general.php' ) ), 387 esc_html__( 'Edit settings', 'buddypress' ) 388 ); 369 389 } 390 391 printf( 392 /* translators: %s is the link to the registration settings. */ 393 esc_html__( '* Fields in this group will appear on the registration page as soon as users will be able to register to your site.%s', 'buddypress' ), 394 $settings_link 395 ); 370 396 ?> 371 </fieldset> 372 373 <p><?php esc_html_e( '* Fields in this group appear on the registration page.', 'buddypress' ); ?></p> 374 </div> 375 <?php 376 } 377 ?> 397 </p> 398 <?php endif; ?> 399 </div> 378 400 </div> 379 401 </form> … … 1030 1052 <?php if ( empty( $field->can_delete ) ) : ?><?php esc_html_e( '(Primary)', 'buddypress' ); endif; ?> 1031 1053 <?php bp_the_profile_field_required_label(); ?> 1032 <?php if ( bp_get_signup_allowed() &&$field->get_signup_position() ) : ?>1054 <?php if ( $field->get_signup_position() ) : ?> 1033 1055 <span class="bp-signup-field-label"><?php esc_html_e( '(Sign-up)', 'buddypress' );?></span> 1034 1056 <?php endif; ?> -
trunk/src/bp-xprofile/classes/class-bp-xprofile-data-template.php
r12885 r12955 167 167 $groups = bp_xprofile_get_groups( $r ); 168 168 169 if ( true === $r['signup_fields_only'] && bp_get_signup_allowed()) {169 if ( true === $r['signup_fields_only'] ) { 170 170 $signup_fields_order = bp_xprofile_get_signup_field_ids(); 171 171 $signup_group = new BP_XProfile_Group();
Note: See TracChangeset
for help on using the changeset viewer.