Skip to:
Content

BuddyPress.org

Changeset 85


Ignore:
Timestamp:
05/09/2008 12:05:12 AM (18 years ago)
Author:
jbasdf
Message:

Added ui code for drag and drop ordering of fields on profile page. Values are not yet stored to the database.

Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile.php

    r57 r85  
    8989                }
    9090       
     91                wp_enqueue_script( 'jquery.tablednd', '/wp-content/mu-plugins/bp-core/js/jquery/jquery.tablednd.js', array( 'jquery' ), '0.4' );
     92               
    9193                /* Add the administration tab under the "Site Admin" tab for site administrators */
    9294                add_submenu_page( 'wpmu-admin.php', __("Profiles"), __("Profiles"), 1, "xprofile_settings", "xprofile_admin" );
  • trunk/bp-xprofile/bp-xprofile-admin.php

    r33 r85  
    2626                xprofile_admin_manage_group($_GET['group_id']); die;
    2727        }
     28       
    2829?>     
    2930        <div class="wrap">
     
    4950                        for ( $i = 0; $i < count($groups); $i++ ) {
    5051                        ?>
    51                                 <p>
    52                                 <table class="widefat">
     52                                <script type="text/javascript" charset="utf-8">
     53                                        jQuery(document).ready(function(){
     54                                                jQuery('#<?php echo $groups[$i]->name;?>').tableDnD({
     55                                                        onDrop: function(table, row) {
     56                                        var order = jQuery.tableDnD.serialize();
     57                                            }
     58                                    });
     59                                        });                                     
     60                                </script>
     61                                <p>
     62                                <table id="<?php echo $groups[$i]->name; ?>" class="widefat">
    5363                                        <thead>
    54                                             <tr>
     64                                            <tr class="nodrag">
    5565                                                <th scope="col" colspan="<?php if ( $groups[$i]->can_delete ) { ?>3<?php } else { ?>5<?php } ?>"><?php echo $groups[$i]->name; ?></th>
    5666                                                        <?php if ( $groups[$i]->can_delete ) { ?>       
     
    6171                                        </thead>
    6272                                        <tbody id="the-list">
    63                                            <tr class="header">
     73                                           <tr class="header nodrag">
    6474                                                <td>Field Name</td>
    6575                                                <td width="10%">Field Type</td>
     
    6878                                            </tr>
    6979
    70                                                 <?php if ( $groups[$i]->fields ) { ?>
     80                                                  <?php if ( $groups[$i]->fields ) { ?>
    7181                                                <?php for ( $j = 0; $j < count($groups[$i]->fields); $j++ ) { ?>
    72                                                                 <?php if ( $j % 2 == 0 ) { $class = ""; } else { $class = "alternate"; } ?>
    73                                
     82                                                                        <?php if ( $j % 2 == 0 ) { $class = ""; } else { $class = "alternate"; } ?>
    7483                                                            <?php $field = new BP_XProfile_Field($groups[$i]->fields[$j]->id); ?>
    7584                                                            <?php if ( !$field->can_delete ) { $class .= ' core'; } ?>
    7685                                                       
    77                                                                 <tr<?php echo ' class="' . $class . '"'; ?>>
     86                                                                        <tr<?php echo ' class="' . $class . '"'; ?>>
    7887                                                                <td><span title="<?php echo $field->desc; ?>"><?php echo $field->name; ?> <?php if(!$field->can_delete) { ?>(Core)<?php } ?></span></td>
    7988                                                                <td><?php echo $field->type; ?></td>
     
    8291                                                                <td style="text-align:center;"><?php if ( !$field->can_delete ) { ?><strike>Delete</strike><?php } else { ?><a class="delete" href="admin.php?page=xprofile_settings&amp;field_id=<?php echo $field->id; ?>&amp;mode=delete_field">Delete</a><?php } ?></td>
    8392                                                            </tr>
    84 
     93                                                       
    8594                                                        <?php } ?>
    8695                                                <?php } else { ?>
  • trunk/bp-xprofile/bp-xprofile-signup.php

    r65 r85  
    124124                                                $counter++;
    125125                                        }
    126                                        
    127                                        
    128126                                }
    129127                                                               
    130128                                $result = wpmu_validate_user_signup( $_POST['user_name'], $_POST['user_email'] );
    131129                                extract($result);
     130       
    132131                               
    133132                                if ( $errors->get_error_code() || $hasErrors ) {
Note: See TracChangeset for help on using the changeset viewer.