Changeset 2801
- Timestamp:
- 03/03/2010 10:18:25 AM (17 years ago)
- Location:
- trunk/bp-xprofile
- Files:
-
- 3 edited
-
admin/js/admin.js (modified) (2 diffs)
-
bp-xprofile-admin.php (modified) (2 diffs)
-
bp-xprofile-classes.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/admin/js/admin.js
r2800 r2801 132 132 items: 'tr', 133 133 cancel: 'tr.nodrag', 134 connectWith: 'table.field-group tbody', 134 135 tolerance: 'pointer', 135 136 update: function() { … … 138 139 'cookie': encodeURIComponent(document.cookie), 139 140 '_wpnonce_reorder_fields': jQuery("input#_wpnonce_reorder_fields").val(), 140 'field_order': jQuery(this).sortable('serialize') 141 'field_order': jQuery(this).sortable('serialize'), 142 'field_group_id': jQuery(this).parents('table[id]').attr('id') 141 143 }, 142 144 function(response){}); -
trunk/bp-xprofile/bp-xprofile-admin.php
r2799 r2801 64 64 foreach ( $groups as $group ) { ?> 65 65 66 <table id=" group_<?php echo $group->id;?>" class="widefat field-group sortable">66 <table id="<?php echo $group->id;?>" class="widefat field-group sortable"> 67 67 <thead> 68 68 <tr class="grabber"> … … 309 309 310 310 parse_str( $_POST['field_order'], $order ); 311 $field_group_id = $_POST['field_group_id']; 311 312 312 313 foreach ( (array) $order['field'] as $position => $field_id ) 313 xprofile_update_field_position( (int) $field_id, (int) $position );314 xprofile_update_field_position( (int) $field_id, (int) $position, (int) $field_group_id ); 314 315 315 316 } -
trunk/bp-xprofile/bp-xprofile-classes.php
r2798 r2801 472 472 } 473 473 474 function update_position( $field_id, $position ) {475 global $wpdb, $bp; 476 477 if ( !is_numeric( $position ) )478 return false; 479 480 return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_fields} SET field_order = %d WHERE id = %d", $position, $field_id ) );474 function update_position( $field_id, $position, $field_group_id ) { 475 global $wpdb, $bp; 476 477 if ( !is_numeric( $position ) || !is_numeric( $field_group_id ) ) 478 return false; 479 480 return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_fields} SET field_order = %d, group_id = %d WHERE id = %d", $position, $field_group_id, $field_id ) ); 481 481 } 482 482
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)