Skip to:
Content

BuddyPress.org

Changeset 6297


Ignore:
Timestamp:
09/03/2012 03:30:32 AM (13 years ago)
Author:
johnjamesjacoby
Message:

XProfile:

  • Hardcode BP_XProfile_Group::render_admin_form() to look like traditional post form.
  • @todo: use metabox API.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-classes.php

    r6295 r6297  
    225225                        // Assign correct data value to the field
    226226                        if ( $field->id == $data->field_id ) {
    227                                                         $fields[$field_key]->data = new stdClass;
    228                                                         $fields[$field_key]->data->value = $data->value;
    229                                                         $fields[$field_key]->data->id = $data->id;
     227                            $fields[$field_key]->data = new stdClass;
     228                            $fields[$field_key]->data->value = $data->value;
     229                            $fields[$field_key]->data->id = $data->id;
    230230                        }
    231231                    }
     
    295295     */
    296296    function fetch_visibility_level( $user_id, $fields ) {
    297         global $wpdb, $bp;
    298297
    299298        // Get the user's visibility level preferences
     
    347346    }
    348347
    349     /* ADMIN AREA HTML.
    350     * TODO: Get this out of here and replace with standard loops
    351     */
    352 
    353348    function render_admin_form() {
    354349        global $message;
     
    359354            $button = __( 'Create Field Group', 'buddypress' );
    360355        } else {
    361             $title = __( 'Edit Field Group', 'buddypress' );
     356            $title  = __( 'Edit Field Group', 'buddypress' );
    362357            $action = "admin.php?page=bp-profile-setup&mode=edit_group&group_id=" . $this->id;
    363358            $button = __( 'Save Changes', 'buddypress' );
     
    368363            <?php screen_icon( 'users' ); ?>
    369364
    370             <h2><?php echo $title; ?></h2>
    371             <p><?php _e( 'Fields marked * are required', 'buddypress' ) ?></p>
     365            <h2><?php echo esc_html( $title ); ?></h2>
    372366
    373367            <?php if ( !empty( $message ) ) :
    374368                    $type = ( 'error' == $type ) ? 'error' : 'updated'; ?>
    375369
    376                 <div id="message" class="<?php echo $type; ?> fade">
    377                     <p><?php echo $message; ?></p>
     370                <div id="message" class="<?php echo esc_attr( $type ); ?> fade">
     371                    <p><?php echo esc_html( $message ); ?></p>
    378372                </div>
    379373
    380374            <?php endif; ?>
    381375
    382             <div id="poststuff">
    383                 <form action="<?php echo esc_url( $action ); ?>" method="post">
    384                     <div id="titlediv">
    385                         <h3><label for="group_name"><?php _e( "Field Group Title", 'buddypress') ?> *</label></h3>
    386                         <div id="titlewrap">
    387                             <input type="text" name="group_name" id="title" value="<?php echo esc_attr( $this->name ); ?>" style="width:50%" />
     376            <form action="<?php echo esc_url( $action ); ?>" method="post">
     377                <div id="poststuff">
     378                    <div id="post-body" class="metabox-holder columns-2">
     379                        <div id="post-body-content">
     380                            <div id="titlediv">
     381                                <div id="titlewrap">
     382                                    <label class="screen-reader-text" id="title-prompt-text" for=​"title">​<?php _e( 'Field Group Title', 'buddypress') ?></label>
     383                                    <input type="text" name="group_name" id="title" value="<?php echo esc_attr( $this->name ); ?>" />
     384                                </div>
     385                            </div>
     386
     387                            <div id="postdiv" class="postarea">
     388                                <div class="postbox">
     389                                    <div id="titlediv"><h3 class="hndle"><?php _e( 'Group Description', 'buddypress' ); ?></h3></div>
     390                                    <div class="inside">
     391                                        <textarea name="group_description" id="group_description" rows="8" cols="60"><?php echo esc_textarea( $this->description ); ?></textarea>
     392                                    </div>
     393                                </div>
     394                            </div>
     395                        </div>
     396                        <div id="postbox-container-1" class="postbox-container">
     397                            <div id="side-sortables" class="meta-box-sortables ui-sortable">
     398                                <div id="submitdiv" class="postbox">
     399                                    <div id="handlediv"><h3 class="hndle"><?php _e( 'Save', 'buddypress' ); ?></h3></div>
     400                                    <div class="inside">
     401                                        <div id="submitcomment" class="submitbox">
     402                                            <div id="major-publishing-actions">
     403                                                <div id="delete-action">
     404                                                    <a href="admin.php?page=bp-profile-setup" class="submitdelete deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a>
     405                                                </div>
     406                                                <div id="publishing-action">
     407                                                    <input type="submit" name="save_group" value="<?php echo esc_attr( $button ); ?>" class="button-primary"/>
     408                                                </div>
     409                                                <input type="hidden" name="group_order" id="group_order" value="<?php echo esc_attr( $this->group_order ); ?>" />
     410                                                <div class="clear"></div>
     411                                            </div>
     412                                        </div>
     413                                    </div>
     414                                </div>
     415                            </div>
    388416                        </div>
    389417                    </div>
    390 
    391                     <?php if ( '0' != $this->can_delete ) : ?>
    392 
    393                         <div id="titlediv">
    394                             <h3><label for="description"><?php _e( "Group Description", 'buddypress' ); ?></label></h3>
    395                             <div id="titlewrap">
    396                                 <textarea name="group_description" id="group_description" rows="8" cols="60"><?php echo htmlspecialchars( $this->description ); ?></textarea>
    397                             </div>
    398                         </div>
    399 
    400                     <?php endif; ?>
    401 
    402                     <p class="submit">
    403                         <input type="hidden" name="group_order" id="group_order" value="<?php echo esc_attr( $this->group_order ); ?>" />
    404                         <input type="submit" name="save_group" value="<?php echo esc_attr( $button ); ?>" class="button-primary"/>
    405                         <?php _e( 'or', 'buddypress' ); ?> <a href="admin.php?page=bp-profile-setup" class="deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a>
    406                     </p>
    407                 </form>
    408             </div>
     418                </div>
     419            </form>
    409420        </div>
    410421
Note: See TracChangeset for help on using the changeset viewer.