Changeset 11808 for trunk/src/bp-xprofile/bp-xprofile-admin.php
- Timestamp:
- 01/10/2018 09:34:15 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-xprofile/bp-xprofile-admin.php
r11741 r11808 125 125 function xprofile_admin_screen( $message = '', $type = 'error' ) { 126 126 127 // Users admin URL 128 $url = bp_get_admin_url( 'users.php' ); 129 130 // Add Group 131 $add_group_url = add_query_arg( array( 132 'page' => 'bp-profile-setup', 133 'mode' => 'add_group' 134 ), $url ); 135 127 136 // Validate type. 128 137 $type = preg_replace( '|[^a-z]|i', '', $type ); … … 138 147 <h1 class="wp-heading-inline"><?php _ex( 'Profile Fields', 'Settings page header', 'buddypress'); ?></h1> 139 148 140 <a id="add_group" class="page-title-action" href=" users.php?page=bp-profile-setup&mode=add_group"><?php _e( 'Add New Field Group', 'buddypress' ); ?></a>149 <a id="add_group" class="page-title-action" href="<?php echo esc_url( $add_group_url ); ?>"><?php _e( 'Add New Field Group', 'buddypress' ); ?></a> 141 150 142 151 <hr class="wp-header-end"> … … 146 155 <h1> 147 156 <?php _ex( 'Profile Fields', 'Settings page header', 'buddypress'); ?> 148 <a id="add_group" class="add-new-h2" href=" users.php?page=bp-profile-setup&mode=add_group"><?php _e( 'Add New Field Group', 'buddypress' ); ?></a>157 <a id="add_group" class="add-new-h2" href="<?php echo esc_url( $add_group_url ); ?>"><?php _e( 'Add New Field Group', 'buddypress' ); ?></a> 149 158 </h1> 150 159 … … 190 199 </ul> 191 200 192 <?php if ( !empty( $groups ) ) : foreach ( $groups as $group ) : ?> 201 <?php if ( !empty( $groups ) ) : foreach ( $groups as $group ) : 202 203 // Add Field to Group URL 204 $add_field_url = add_query_arg( array( 205 'page' => 'bp-profile-setup', 206 'mode' => 'add_field', 207 'group_id' => (int) $group->id 208 ), $url ); 209 210 // Edit Group URL 211 $edit_group_url = add_query_arg( array( 212 'page' => 'bp-profile-setup', 213 'mode' => 'edit_group', 214 'group_id' => (int) $group->id 215 ), $url ); 216 217 // Delete Group URL 218 $delete_group_url = wp_nonce_url( add_query_arg( array( 219 'page' => 'bp-profile-setup', 220 'mode' => 'delete_group', 221 'group_id' => (int) $group->id 222 ), $url ), 'bp_xprofile_delete_group' ); ?> 193 223 194 224 <noscript> … … 202 232 <div class="tab-toolbar"> 203 233 <div class="tab-toolbar-left"> 204 <a class="button-primary" href=" users.php?page=bp-profile-setup&group_id=<?php echo esc_attr( $group->id ); ?>&mode=add_field"><?php _e( 'Add New Field', 'buddypress' ); ?></a>205 <a class="button edit" href=" users.php?page=bp-profile-setup&mode=edit_group&group_id=<?php echo esc_attr( $group->id); ?>"><?php _ex( 'Edit Group', 'Edit Profile Fields Group', 'buddypress' ); ?></a>234 <a class="button-primary" href="<?php echo esc_url( $add_field_url ); ?>"><?php _e( 'Add New Field', 'buddypress' ); ?></a> 235 <a class="button edit" href="<?php echo esc_url( $edit_group_url ); ?>"><?php _ex( 'Edit Group', 'Edit Profile Fields Group', 'buddypress' ); ?></a> 206 236 207 237 <?php if ( $group->can_delete ) : ?> 208 238 209 239 <div class="delete-button"> 210 <a class="confirm submitdelete deletion ajax-option-delete" href="<?php echo esc_url( wp_nonce_url( 'users.php?page=bp-profile-setup&mode=delete_group&group_id=' . intval( $group->id ), 'bp_xprofile_delete_group' )); ?>"><?php _ex( 'Delete Group', 'Delete Profile Fields Group', 'buddypress' ); ?></a>240 <a class="confirm submitdelete deletion ajax-option-delete" href="<?php echo esc_url( $delete_group_url ); ?>"><?php _ex( 'Delete Group', 'Delete Profile Fields Group', 'buddypress' ); ?></a> 211 241 </div> 212 242 … … 284 314 285 315 <div id="message" class="error"><p><?php _ex( 'You have no groups.', 'You have no profile fields groups.', 'buddypress' ); ?></p></div> 286 <p><a href=" users.php?page=bp-profile-setup&mode=add_group"><?php _ex( 'Add New Group', 'Add New Profile Fields Group', 'buddypress' ); ?></a></p>316 <p><a href="<?php echo esc_url( $add_group_url ); ?>"><?php _ex( 'Add New Group', 'Add New Profile Fields Group', 'buddypress' ); ?></a></p> 287 317 288 318 <?php endif; ?> … … 620 650 $field = $admin_field; 621 651 622 $field_edit_url = add_query_arg( 623 array( 652 // Users admin URL 653 $url = bp_get_admin_url( 'users.php' ); 654 655 // Edit 656 $field_edit_url = add_query_arg( array( 657 'page' => 'bp-profile-setup', 658 'mode' => 'edit_field', 659 'group_id' => (int) $field->group_id, 660 'field_id' => (int) $field->id 661 ), $url ); 662 663 // Delete 664 if ( $field->can_delete ) { 665 $field_delete_url = add_query_arg( array( 624 666 'page' => 'bp-profile-setup', 625 'group_id' => (int) $field->group_id, 626 'field_id' => (int) $field->id, 627 'mode' => 'edit_field' 628 ), 629 bp_get_admin_url( 'users.php' ) 630 ); 631 632 if ( $field->can_delete ) { 633 $field_delete_url = add_query_arg( 634 array( 635 'page' => 'bp-profile-setup', 636 'field_id' => (int) $field->id, 637 'mode' => 'delete_field' 638 ), 639 bp_get_admin_url( 'users.php' ) . '#tabs-' . (int) $field->group_id 640 ); 641 } 642 ?> 667 'mode' => 'delete_field', 668 'field_id' => (int) $field->id 669 ), $url . '#tabs-' . (int) $field->group_id ); 670 } ?> 643 671 644 672 <fieldset id="draggable_field_<?php echo esc_attr( $field->id ); ?>" class="sortable<?php echo ' ' . $field->type; if ( !empty( $class ) ) echo ' ' . $class; ?>"> … … 647 675 <?php bp_the_profile_field_name(); ?> 648 676 649 <?php if ( empty( $field->can_delete ) ) : ?><?php esc_html_e( '(Primary)', 677 <?php if ( empty( $field->can_delete ) ) : ?><?php esc_html_e( '(Primary)', 'buddypress' ); endif; ?> 650 678 <?php bp_the_profile_field_required_label(); ?> 651 <?php if ( bp_xprofile_get_meta( $field->id, 'field', 'signup_position' ) ) : ?><?php esc_html_e( '(Sign-up)', 679 <?php if ( bp_xprofile_get_meta( $field->id, 'field', 'signup_position' ) ) : ?><?php esc_html_e( '(Sign-up)', 'buddypress' ); endif; ?> 652 680 <?php if ( bp_get_member_types() ) : echo $field->get_member_type_label(); endif; ?> 653 681
Note: See TracChangeset
for help on using the changeset viewer.