Changeset 11808
- Timestamp:
- 01/10/2018 09:34:15 PM (7 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-admin.php
r11764 r11808 577 577 <ul> 578 578 <?php if ( bp_is_active( 'members' ) ) : ?> 579 <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add User Profile Fields', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-profile-setup' ),'users.php' ) ) ) ); ?></li>579 <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Add User Profile Fields', 'buddypress' ) . '</a>', esc_url( add_query_arg( array( 'page' => 'bp-profile-setup' ), bp_get_admin_url( 'users.php' ) ) ) ); ?></li> 580 580 <?php endif; ?> 581 <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Manage User Signups', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-signups' ),'users.php' ) ) ) ); ?></li>581 <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Manage User Signups', 'buddypress' ) . '</a>', esc_url( add_query_arg( array( 'page' => 'bp-signups' ), bp_get_admin_url( 'users.php' ) ) ) ); ?></li> 582 582 <?php if ( bp_is_active( 'activity' ) ) : ?> 583 <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Moderate Activity Streams', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-activity' ),'admin.php' ) ) ) ); ?></li>583 <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Moderate Activity Streams', 'buddypress' ) . '</a>', esc_url( add_query_arg( array( 'page' => 'bp-activity' ), bp_get_admin_url( 'admin.php' ) ) ) ); ?></li> 584 584 <?php endif; ?> 585 585 <?php if ( bp_is_active( 'groups' ) ) : ?> 586 <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Manage Groups', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-groups' ),'admin.php' ) ) ) ); ?></li>586 <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Manage Groups', 'buddypress' ) . '</a>', esc_url( add_query_arg( array( 'page' => 'bp-groups' ), bp_get_admin_url( 'admin.php' ) ) ) ); ?></li> 587 587 <?php endif; ?> 588 <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Repair Data', 'buddypress' ) . '</a>', esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-tools' ),'tools.php' ) ) ) ); ?>588 <li><?php printf( '<a href="%s" class="welcome-icon welcome-add-page">' . __( 'Repair Data', 'buddypress' ) . '</a>', esc_url( add_query_arg( array( 'page' => 'bp-tools' ), bp_get_admin_url( 'tools.php' ) ) ) ); ?> 589 589 </li> 590 590 </ul> -
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 -
trunk/src/bp-xprofile/classes/class-bp-xprofile-field.php
r11700 r11808 1164 1164 */ 1165 1165 public function render_admin_form( $message = '' ) { 1166 1167 // Users Admin URL 1168 $users_url = bp_get_admin_url( 'users.php' ); 1169 1170 // Add New 1166 1171 if ( empty( $this->id ) ) { 1167 1172 $title = __( 'Add New Field', 'buddypress' ); 1168 $action = "users.php?page=bp-profile-setup&group_id=" . $this->group_id . "&mode=add_field#tabs-" . $this->group_id; 1169 $button = __( 'Save', 'buddypress' ); 1173 $button = __( 'Save', 'buddypress' ); 1174 $action = add_query_arg( array( 1175 'page' => 'bp-profile-setup', 1176 'mode' => 'add_field', 1177 'group_id' => (int) $this->group_id 1178 ), $users_url . '#tabs-' . (int) $this->group_id ); 1170 1179 1171 1180 if ( !empty( $_POST['saveField'] ) ) { … … 1180 1189 } 1181 1190 } 1191 1192 // Edit 1182 1193 } else { 1183 1194 $title = __( 'Edit Field', 'buddypress' ); 1184 $action = "users.php?page=bp-profile-setup&mode=edit_field&group_id=" . $this->group_id . "&field_id=" . $this->id . "#tabs-" . $this->group_id; 1185 $button = __( 'Update', 'buddypress' ); 1195 $button = __( 'Update', 'buddypress' ); 1196 $action = add_query_arg( array( 1197 'page' => 'bp-profile-setup', 1198 'mode' => 'edit_field', 1199 'group_id' => (int) $this->group_id, 1200 'field_id' => (int) $this->id 1201 ), $users_url . '#tabs-' . (int) $this->group_id ); 1186 1202 } ?> 1187 1203 … … 1287 1303 private function submit_metabox( $button_text = '' ) { 1288 1304 1305 // Setup the URL for deleting 1306 $users_url = bp_get_admin_url( 'users.php' ); 1307 $cancel_url = add_query_arg( array( 1308 'page' => 'bp-profile-setup' 1309 ), $users_url ); 1310 1289 1311 /** 1290 1312 * Fires before XProfile Field submit metabox. … … 1324 1346 1325 1347 <div id="delete-action"> 1326 <a href=" users.php?page=bp-profile-setup" class="deletion"><?php esc_html_e( 'Cancel', 'buddypress' ); ?></a>1348 <a href="<?php echo esc_url( $cancel_url ); ?>" class="deletion"><?php esc_html_e( 'Cancel', 'buddypress' ); ?></a> 1327 1349 </div> 1328 1350 -
trunk/src/bp-xprofile/classes/class-bp-xprofile-group.php
r11468 r11808 717 717 global $message; 718 718 719 // Users Admin URL 720 $users_url = bp_get_admin_url( 'users.php' ); 721 722 // URL to cancel to 723 $cancel_url = add_query_arg( array( 724 'page' => 'bp-profile-setup' 725 ), $users_url ); 726 719 727 // New field group. 720 728 if ( empty( $this->id ) ) { 721 729 $title = __( 'Add New Field Group', 'buddypress' ); 722 $action = add_query_arg( array( 'page' => 'bp-profile-setup', 'mode' => 'add_group' ), 'users.php' ); 723 $button = __( 'Save', 'buddypress' ); 730 $button = __( 'Save', 'buddypress' ); 731 $action = add_query_arg( array( 732 'page' => 'bp-profile-setup', 733 'mode' => 'add_group' 734 ), $users_url ); 724 735 725 736 // Existing field group. 726 737 } else { 727 738 $title = __( 'Edit Field Group', 'buddypress' ); 728 $action = add_query_arg( array( 'page' => 'bp-profile-setup', 'mode' => 'edit_group', 'group_id' => $this->id ), 'users.php' ); 729 $button = __( 'Update', 'buddypress' ); 739 $button = __( 'Update', 'buddypress' ); 740 $action = add_query_arg( array( 741 'page' => 'bp-profile-setup', 742 'mode' => 'edit_group', 743 'group_id' => (int) $this->id 744 ), $users_url ); 730 745 } ?> 731 746 … … 814 829 </div> 815 830 <div id="delete-action"> 816 <a href=" users.php?page=bp-profile-setup" class="deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a>831 <a href="<?php echo esc_url( $cancel_url ); ?>" class="deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a> 817 832 </div> 818 833 <div class="clear"></div>
Note: See TracChangeset
for help on using the changeset viewer.