Ticket #5094: 5094.patch
File 5094.patch, 25.3 KB (added by , 11 years ago) |
---|
-
admin/css/admin.css
241 241 top: -2px; 242 242 } 243 243 244 textarea#description { 244 textarea#description, 245 textarea#group_description { 245 246 border: 1px solid #ddd; 246 width: 85%;247 width: 100%; 247 248 } 248 249 -
admin/js/admin.js
3 3 var theId = document.getElementById(forWhat + '_option_number').value; 4 4 var newDiv = document.createElement('p'); 5 5 var newOption = document.createElement('input'); 6 var span = document.createElement( 'span' );6 var span = document.createElement( 'span' ); 7 7 var txt = document.createTextNode( "\u00A0\u039E\u00A0" ); 8 8 var isDefault = document.createElement( 'input' ); 9 var span1 = document.createElement( 'span' );9 var span1 = document.createElement( 'span' ); 10 10 var txt1 = document.createTextNode( " Default Value " ); 11 11 12 12 newDiv.setAttribute('id', forWhat + '_div' + theId); … … 91 91 92 92 function enableSortableFieldOptions( forWhat ) { 93 93 if ( jQuery( '#' + forWhat + ' p.sortable' ).length > 1 ) { 94 jQuery( '. options-box' ).sortable( {94 jQuery( '.bp-options-box' ).sortable( { 95 95 items: 'p.sortable', 96 96 tolerance: 'pointer', 97 97 axis: 'y', … … 103 103 } 104 104 105 105 function destroySortableFieldOptions() { 106 jQuery( '. options-box' ).sortable( 'destroy' );106 jQuery( '.bp-options-box' ).sortable( 'destroy' ); 107 107 jQuery( '.sortable span' ).css( 'cursor', 'default' ); 108 108 } 109 109 -
bp-xprofile-admin.php
69 69 70 70 <h2> 71 71 <?php _e( 'Profile Fields', 'buddypress'); ?> 72 <a id="add_group" class="add-new-h2" href=" admin.php?page=bp-profile-setup&mode=add_group"><?php _e( 'Add New Field Group', 'buddypress' ); ?></a>72 <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> 73 73 </h2> 74 74 75 75 <p><?php echo sprintf( __( 'Fields in the "%s" group will appear on the signup page.', 'buddypress' ), esc_html( stripslashes( bp_get_option( 'bp-xprofile-base-group-name' ) ) ) ) ?></p> … … 110 110 <div id="tabs-<?php echo $group->id; ?>" class="tab-wrapper"> 111 111 <div class="tab-toolbar"> 112 112 <div class="tab-toolbar-left"> 113 <a class="button-primary" href=" admin.php?page=bp-profile-setup&group_id=<?php echo esc_attr( $group->id ); ?>&mode=add_field"><?php _e( 'Add New Field', 'buddypress' ); ?></a>114 <a class="button edit" href=" admin.php?page=bp-profile-setup&mode=edit_group&group_id=<?php echo esc_attr( $group->id ); ?>"><?php _e( 'Edit Group', 'buddypress' ); ?></a>113 <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> 114 <a class="button edit" href="users.php?page=bp-profile-setup&mode=edit_group&group_id=<?php echo esc_attr( $group->id ); ?>"><?php _e( 'Edit Group', 'buddypress' ); ?></a> 115 115 116 116 <?php if ( $group->can_delete ) : ?> 117 117 118 <a class="confirm submitdelete deletion ajax-option-delete" href=" admin.php?page=bp-profile-setup&mode=delete_group&group_id=<?php echo esc_attr( $group->id ); ?>"><?php _e( 'Delete Group', 'buddypress' ); ?></a>118 <a class="confirm submitdelete deletion ajax-option-delete" href="users.php?page=bp-profile-setup&mode=delete_group&group_id=<?php echo esc_attr( $group->id ); ?>"><?php _e( 'Delete Group', 'buddypress' ); ?></a> 119 119 120 120 <?php endif; ?> 121 121 … … 159 159 <?php endforeach; else : ?> 160 160 161 161 <div id="message" class="error"><p><?php _e( 'You have no groups.', 'buddypress' ); ?></p></div> 162 <p><a href=" admin.php?page=bp-profile-setup&mode=add_group"><?php _e( 'Add New Group', 'buddypress' ); ?></a></p>162 <p><a href="users.php?page=bp-profile-setup&mode=add_group"><?php _e( 'Add New Group', 'buddypress' ); ?></a></p> 163 163 164 164 <?php endif; ?> 165 165 … … 453 453 <?php endif; ?> 454 454 455 455 <div class="actions"> 456 <a class="button edit" href=" admin.php?page=bp-profile-setup&group_id=<?php echo esc_attr( $admin_group->id ); ?>&field_id=<?php echo esc_attr( $field->id ); ?>&mode=edit_field"><?php _e( 'Edit', 'buddypress' ); ?></a>456 <a class="button edit" href="users.php?page=bp-profile-setup&group_id=<?php echo esc_attr( $admin_group->id ); ?>&field_id=<?php echo esc_attr( $field->id ); ?>&mode=edit_field"><?php _e( 'Edit', 'buddypress' ); ?></a> 457 457 458 458 <?php if ( $field->can_delete ) : ?> 459 459 460 <a class="confirm submit-delete deletion" href=" admin.php?page=bp-profile-setup&field_id=<?php echo esc_attr( $field->id ); ?>&mode=delete_field"><?php _e( 'Delete', 'buddypress' ); ?></a>460 <a class="confirm submit-delete deletion" href="users.php?page=bp-profile-setup&field_id=<?php echo esc_attr( $field->id ); ?>&mode=delete_field"><?php _e( 'Delete', 'buddypress' ); ?></a> 461 461 462 462 <?php endif; ?> 463 463 </div> -
bp-xprofile-classes.php
352 352 353 353 if ( empty( $this->id ) ) { 354 354 $title = __( 'Add New Field Group', 'buddypress' ); 355 $action = " admin.php?page=bp-profile-setup&mode=add_group";355 $action = "users.php?page=bp-profile-setup&mode=add_group"; 356 356 $button = __( 'Create Field Group', 'buddypress' ); 357 357 } else { 358 358 $title = __( 'Edit Field Group', 'buddypress' ); 359 $action = " admin.php?page=bp-profile-setup&mode=edit_group&group_id=" . $this->id;359 $action = "users.php?page=bp-profile-setup&mode=edit_group&group_id=" . $this->id; 360 360 $button = __( 'Save Changes', 'buddypress' ); 361 361 } ?> 362 362 … … 403 403 <div id="submitcomment" class="submitbox"> 404 404 <div id="major-publishing-actions"> 405 405 <div id="delete-action"> 406 <a href=" admin.php?page=bp-profile-setup" class="submitdelete deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a>406 <a href="users.php?page=bp-profile-setup" class="submitdelete deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a> 407 407 </div> 408 408 <div id="publishing-action"> 409 409 <input type="submit" name="save_group" value="<?php echo esc_attr( $button ); ?>" class="button-primary"/> … … 748 748 749 749 ?> 750 750 751 <div id="<?php echo esc_attr( $type ); ?>" class="options-box" style="<?php echo esc_attr( $class ); ?> margin-left: 15px;"> 752 <h4><?php _e( 'Please enter options for this Field:', 'buddypress' ); ?></h4> 753 <p> 754 <label for="sort_order_<?php echo esc_attr( $type ); ?>"><?php _e( 'Sort Order:', 'buddypress' ); ?></label> 755 <select name="sort_order_<?php echo esc_attr( $type ); ?>" id="sort_order_<?php echo esc_attr( $type ); ?>" > 756 <option value="custom" <?php selected( 'custom', $this->order_by ); ?>><?php _e( 'Custom', 'buddypress' ); ?></option> 757 <option value="asc" <?php selected( 'asc', $this->order_by ); ?>><?php _e( 'Ascending', 'buddypress' ); ?></option> 758 <option value="desc" <?php selected( 'desc', $this->order_by ); ?>><?php _e( 'Descending', 'buddypress' ); ?></option> 759 </select> 751 <div id="<?php echo esc_attr( $type ); ?>" class="postbox bp-options-box" style="<?php echo esc_attr( $class ); ?> margin-top: 15px;"> 752 <h3><?php _e( 'Please enter options for this Field:', 'buddypress' ); ?></h3> 753 <div class="inside"> 754 <p> 755 <label for="sort_order_<?php echo esc_attr( $type ); ?>"><?php _e( 'Sort Order:', 'buddypress' ); ?></label> 756 <select name="sort_order_<?php echo esc_attr( $type ); ?>" id="sort_order_<?php echo esc_attr( $type ); ?>" > 757 <option value="custom" <?php selected( 'custom', $this->order_by ); ?>><?php _e( 'Custom', 'buddypress' ); ?></option> 758 <option value="asc" <?php selected( 'asc', $this->order_by ); ?>><?php _e( 'Ascending', 'buddypress' ); ?></option> 759 <option value="desc" <?php selected( 'desc', $this->order_by ); ?>><?php _e( 'Descending', 'buddypress' ); ?></option> 760 </select> 761 </p> 760 762 761 <?php if ( !$options = $this->get_children( true ) ) {763 <?php if ( !$options = $this->get_children( true ) ) { 762 764 763 $i = 1;764 while ( isset( $_POST[$type . '_option'][$i] ) ) {765 (array) $options[] = (object) array(766 'id' => -1,767 'name' => $_POST[$type . '_option'][$i],768 'is_default_option' => ( ( 'multiselectbox' != $type ) && ( 'checkbox' != $type ) && ( $_POST["isDefault_{$type}_option"] == $i ) ) ? 1 : $_POST["isDefault_{$type}_option"][$i]769 );765 $i = 1; 766 while ( isset( $_POST[$type . '_option'][$i] ) ) { 767 (array) $options[] = (object) array( 768 'id' => -1, 769 'name' => $_POST[$type . '_option'][$i], 770 'is_default_option' => ( ( 'multiselectbox' != $type ) && ( 'checkbox' != $type ) && ( $_POST["isDefault_{$type}_option"] == $i ) ) ? 1 : $_POST["isDefault_{$type}_option"][$i] 771 ); 770 772 771 ++$i; 773 ++$i; 774 } 772 775 } 773 }774 776 775 if ( !empty( $options ) ) {776 for ( $i = 0, $count = count( $options ); $i < $count; ++$i ) {777 $j = $i + 1;777 if ( !empty( $options ) ) { 778 for ( $i = 0, $count = count( $options ); $i < $count; ++$i ) { 779 $j = $i + 1; 778 780 781 if ( 'multiselectbox' == $type || 'checkbox' == $type ) 782 $default_name = '[' . $j . ']'; ?> 783 784 <p class="sortable"> 785 <span> Ξ </span> 786 <input type="text" name="<?php echo esc_attr( $type ); ?>_option[<?php echo esc_attr( $j ); ?>]" id="<?php echo esc_attr( $type ); ?>_option<?php echo esc_attr( $j ); ?>" value="<?php echo stripslashes( esc_attr( $options[$i]->name ) ); ?>" /> 787 <input type="<?php echo $default_input; ?>" name="isDefault_<?php echo esc_attr( $type ); ?>_option<?php echo esc_attr( $default_name ); ?>" <?php checked( (int) $options[$i]->is_default_option, true ); ?> value="<?php echo esc_attr( $j ); ?>" /> 788 <span><?php _e( 'Default Value', 'buddypress' ); ?></span> 789 <a href="<?php echo esc_url( 'users.php?page=bp-profile-setup&mode=delete_option&option_id=' . $options[$i]->id ); ?>" class="ajax-option-delete" id="delete-<?php echo esc_attr( $options[$i]->id ); ?>">[x]</a> 790 </p> 791 792 <?php } /* end for */ ?> 793 794 <input type="hidden" name="<?php echo esc_attr( $type ); ?>_option_number" id="<?php echo esc_attr( $type ); ?>_option_number" value="<?php echo esc_attr( (int) $j + 1 ); ?>" /> 795 796 <?php } else { 797 779 798 if ( 'multiselectbox' == $type || 'checkbox' == $type ) 780 $default_name = '[ ' . $j . ']'; ?>799 $default_name = '[1]'; ?> 781 800 782 801 <p class="sortable"> 783 802 <span> Ξ </span> 784 <input type="text" name="<?php echo esc_attr( $type ); ?>_option[ <?php echo esc_attr( $j ); ?>]" id="<?php echo esc_attr( $type ); ?>_option<?php echo esc_attr( $j ); ?>" value="<?php echo stripslashes( esc_attr( $options[$i]->name ) ); ?>" />785 <input type="<?php echo $default_input; ?>" name="isDefault_<?php echo esc_attr( $type ); ?>_option<?php echo esc_attr( $default_name ); ?>" <?php checked( (int) $options[$i]->is_default_option, true ); ?> value="<?php echo esc_attr( $j ); ?>" />803 <input type="text" name="<?php echo esc_attr( $type ); ?>_option[1]" id="<?php echo esc_attr( $type ); ?>_option1" /> 804 <input type="<?php echo esc_attr( $default_input ); ?>" name="isDefault_<?php echo esc_attr( $type ); ?>_option<?php echo esc_attr( $default_name ); ?>" id="isDefault_<?php echo esc_attr( $type ); ?>_option" value="1" /> 786 805 <span><?php _e( 'Default Value', 'buddypress' ); ?></span> 787 < a href="<?php echo esc_url( 'admin.php?page=bp-profile-setup&mode=delete_option&option_id=' . $options[$i]->id ); ?>" class="ajax-option-delete" id="delete-<?php echo esc_attr( $options[$i]->id ); ?>">[x]</a>806 <input type="hidden" name="<?php echo esc_attr( $type ); ?>_option_number" id="<?php echo esc_attr( $type ); ?>_option_number" value="2" /> 788 807 </p> 789 808 790 <?php } /* end for*/ ?>809 <?php } /* end if */ ?> 791 810 792 <input type="hidden" name="<?php echo esc_attr( $type ); ?>_option_number" id="<?php echo esc_attr( $type ); ?>_option_number" value="<?php echo esc_attr( (int) $j + 1 ); ?>" /> 793 794 <?php } else { 795 796 if ( 'multiselectbox' == $type || 'checkbox' == $type ) 797 $default_name = '[1]'; ?> 798 799 <p class="sortable"> 800 <span> Ξ </span> 801 <input type="text" name="<?php echo esc_attr( $type ); ?>_option[1]" id="<?php echo esc_attr( $type ); ?>_option1" /> 802 <input type="<?php echo esc_attr( $default_input ); ?>" name="isDefault_<?php echo esc_attr( $type ); ?>_option<?php echo esc_attr( $default_name ); ?>" id="isDefault_<?php echo esc_attr( $type ); ?>_option" value="1" /> 803 <span><?php _e( 'Default Value', 'buddypress' ); ?></span> 804 <input type="hidden" name="<?php echo esc_attr( $type ); ?>_option_number" id="<?php echo esc_attr( $type ); ?>_option_number" value="2" /> 805 </p> 806 807 <?php } /* end if */ ?> 808 809 <div id="<?php echo esc_attr( $type ); ?>_more"></div> 810 <p><a href="javascript:add_option('<?php echo esc_attr( $type ); ?>')"><?php _e( 'Add Another Option', 'buddypress' ); ?></a></p> 811 <div id="<?php echo esc_attr( $type ); ?>_more"></div> 812 <p><a href="javascript:add_option('<?php echo esc_attr( $type ); ?>')"><?php _e( 'Add Another Option', 'buddypress' ); ?></a></p> 813 </div> 811 814 </div> 812 815 813 816 <?php } … … 816 819 function render_admin_form( $message = '' ) { 817 820 if ( empty( $this->id ) ) { 818 821 $title = __( 'Add Field', 'buddypress' ); 819 $action = " admin.php?page=bp-profile-setup&group_id=" . $this->group_id . "&mode=add_field#tabs-" . $this->group_id;822 $action = "users.php?page=bp-profile-setup&group_id=" . $this->group_id . "&mode=add_field#tabs-" . $this->group_id; 820 823 821 824 if ( !empty( $_POST['saveField'] ) ) { 822 825 $this->name = $_POST['title']; … … 828 831 } 829 832 } else { 830 833 $title = __( 'Edit Field', 'buddypress' ); 831 $action = " admin.php?page=bp-profile-setup&mode=edit_field&group_id=" . $this->group_id . "&field_id=" . $this->id . "#tabs-" . $this->group_id;834 $action = "users.php?page=bp-profile-setup&mode=edit_field&group_id=" . $this->group_id . "&field_id=" . $this->id . "#tabs-" . $this->group_id; 832 835 } ?> 833 836 834 837 <div class="wrap"> 835 838 <div id="icon-users" class="icon32"><br /></div> 836 839 <h2><?php echo esc_html( $title ); ?></h2> 837 <p><?php _e( 'Fields marked * are required', 'buddypress' ) ?></p>838 840 839 841 <?php if ( !empty( $message ) ) : ?> 840 842 … … 846 848 847 849 <form id="bp-xprofile-add-field" action="<?php echo esc_url( $action ); ?>" method="post"> 848 850 <div id="poststuff"> 849 <div id="titlediv"> 850 <h3><label for="title"><?php _e( 'Field Title', 'buddypress' ); ?> *</label></h3> 851 <div id="titlewrap"> 852 <input type="text" name="title" id="title" value="<?php echo esc_attr( $this->name ); ?>" style="width:50%" /> 853 </div> 854 </div> 851 <div id="post-body" class="metabox-holder columns-<?php echo ( 1 == get_current_screen()->get_columns() ) ? '1' : '2'; ?>"> 852 <div id="post-body-content"> 853 <div id="titlediv"> 854 <input type="text" name="title" id="title" value="<?php echo esc_attr( $this->name ); ?>" /> 855 </div> 856 <div class="postbox"> 857 <h3><?php _e( 'Field Description', 'buddypress' ); ?></h3> 858 <div class="inside"> 859 <textarea name="description" id="description" rows="8" cols="60"><?php echo esc_attr( $this->description ); ?></textarea> 860 </div> 861 </div> 862 </div><!-- #post-body-content --> 855 863 856 <div id="titlediv"> 857 <h3><label for="description"><?php _e("Field Description", 'buddypress'); ?></label></h3> 858 <div id="titlewrap"> 859 <textarea name="description" id="description" rows="8" cols="60"><?php echo esc_textarea( $this->description ); ?></textarea> 860 </div> 861 </div> 864 <div id="postbox-container-1" class="postbox-container"> 865 <div id="submitdiv" class="postbox"> 866 <h3><?php _e( 'Submit', 'buddypress' ); ?></h3> 867 <div class="inside"> 868 <div id="submitcomment" class="submitbox"> 869 <div id="major-publishing-actions"> 870 <input type="hidden" name="field_order" id="field_order" value="<?php echo esc_attr( $this->field_order ); ?>" /> 871 <div id="publishing-action"> 872 <input type="submit" value="<?php _e( 'Save', 'buddypress' ); ?>" name="saveField" id="saveField" style="font-weight: bold" class="button-primary" /> 873 </div> 874 <div id="delete-action"> 875 <a href="users.php?page=bp-profile-setup" class="deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a> 876 </div> 877 <?php wp_nonce_field( 'xprofile_delete_option' ); ?> 878 <div class="clear"></div> 879 </div> 880 </div> 881 </div> 882 </div> 862 883 863 <?php if ( '0' != $this->can_delete) : ?>884 <?php if ( 1 != $this->id ) : ?> 864 885 865 <div id="titlediv"> 866 <h3><label for="required"><?php _e( "Is This Field Required?", 'buddypress' ); ?> *</label></h3> 867 <select name="required" id="required" style="width: 30%"> 868 <option value="0"<?php selected( $this->is_required, '0' ); ?>><?php _e( 'Not Required', 'buddypress' ); ?></option> 869 <option value="1"<?php selected( $this->is_required, '1' ); ?>><?php _e( 'Required', 'buddypress' ); ?></option> 870 </select> 871 </div> 886 <div class="postbox"> 887 <h3><label for="default-visibility"><?php _e( 'Default Visibility', 'buddypress' ); ?></label></h3> 888 <div class="inside"> 889 <ul> 872 890 873 <div id="titlediv"> 874 <h3><label for="fieldtype"><?php _e( 'Field Type', 'buddypress'); ?> *</label></h3> 875 <select name="fieldtype" id="fieldtype" onchange="show_options(this.value)" style="width: 30%"> 876 <option value="textbox" <?php selected( $this->type, 'textbox' ); ?>><?php _e( 'Text Box', 'buddypress' ); ?></option> 877 <option value="textarea" <?php selected( $this->type, 'textarea' ); ?>><?php _e( 'Multi-line Text Box', 'buddypress' ); ?></option> 878 <option value="datebox" <?php selected( $this->type, 'datebox' ); ?>><?php _e( 'Date Selector', 'buddypress' ); ?></option> 879 <option value="radio" <?php selected( $this->type, 'radio' ); ?>><?php _e( 'Radio Buttons', 'buddypress' ); ?></option> 880 <option value="selectbox" <?php selected( $this->type, 'selectbox' ); ?>><?php _e( 'Drop Down Select Box', 'buddypress' ); ?></option> 881 <option value="multiselectbox" <?php selected( $this->type, 'multiselectbox' ); ?>><?php _e( 'Multi Select Box', 'buddypress' ); ?></option> 882 <option value="checkbox" <?php selected( $this->type, 'checkbox' ); ?>><?php _e( 'Checkboxes', 'buddypress' ); ?></option> 883 </select> 884 </div> 891 <?php foreach( bp_xprofile_get_visibility_levels() as $level ) : ?> 885 892 886 <?php do_action_ref_array( 'xprofile_field_additional_options', array( $this ) ); ?> 893 <li> 894 <input type="radio" id="default-visibility[<?php echo esc_attr( $level['id'] ) ?>]" name="default-visibility" value="<?php echo esc_attr( $level['id'] ) ?>" <?php checked( $this->default_visibility, $level['id'] ); ?> /> 895 <label for="default-visibility[<?php echo esc_attr( $level['id'] ) ?>]"><?php echo esc_html( $level['label'] ) ?></label> 896 </li> 887 897 888 <?php $this->render_admin_form_children();?>898 <?php endforeach ?> 889 899 890 <?php else : ?> 900 </ul> 901 </div> 902 </div> 891 903 892 <input type="hidden" name="required" id="required" value="1" /> 893 <input type="hidden" name="fieldtype" id="fieldtype" value="textbox" /> 904 <div class="postbox"> 905 <h3><label for="allow-custom-visibility"><?php _e( 'Per-Member Visibility', 'buddypress' ); ?></label></h3> 906 <div class="inside"> 907 <ul> 908 <li> 909 <input type="radio" id="allow-custom-visibility-allowed" name="allow-custom-visibility" value="allowed" <?php checked( $this->allow_custom_visibility, 'allowed' ); ?> /> 910 <label for="allow-custom-visibility-allowed"><?php _e( "Let members change this field's visibility", 'buddypress' ); ?></label> 911 </li> 912 <li> 913 <input type="radio" id="allow-custom-visibility-disabled" name="allow-custom-visibility" value="disabled" <?php checked( $this->allow_custom_visibility, 'disabled' ); ?> /> 914 <label for="allow-custom-visibility-disabled"><?php _e( 'Enforce the default visibility for all members', 'buddypress' ); ?></label> 915 </li> 916 </ul> 917 </div> 918 </div> 894 919 895 <?php endif; 920 <?php endif ?> 921 </div> 896 922 897 /* The fullname field cannot be hidden */ 898 if ( 1 != $this->id ) : ?> 923 <div id="postbox-container-2" class="postbox-container"> 899 924 900 <div id="titlediv"> 901 <div id="titlewrap"> 902 <h3><label for="default-visibility"><?php _e( 'Default Visibility', 'buddypress' ); ?></label></h3> 903 <ul> 925 <?php if ( '0' != $this->can_delete ) : ?> 904 926 905 <?php foreach( bp_xprofile_get_visibility_levels() as $level ) : ?> 927 <div class="postbox"> 928 <h3><label for="required"><?php _e( "Field Requirement", 'buddypress' ); ?></label></h3> 929 <div class="inside"> 930 <select name="required" id="required" style="width: 30%"> 931 <option value="0"<?php selected( $this->is_required, '0' ); ?>><?php _e( 'Not Required', 'buddypress' ); ?></option> 932 <option value="1"<?php selected( $this->is_required, '1' ); ?>><?php _e( 'Required', 'buddypress' ); ?></option> 933 </select> 934 </div> 935 </div> 906 936 907 <li><label><input type="radio" name="default-visibility" value="<?php echo esc_attr( $level['id'] ) ?>" <?php checked( $this->default_visibility, $level['id'] ); ?>> <?php echo esc_html( $level['label'] ) ?></label></li> 937 <div class="postbox"> 938 <h3><label for="fieldtype"><?php _e( 'Field Type', 'buddypress'); ?></label></h3> 939 <div class="inside"> 940 <select name="fieldtype" id="fieldtype" onchange="show_options(this.value)" style="width: 30%"> 941 <optgroup label="<?php _e( 'Single Fields', 'buddypress' ); ?>"> 942 <option value="textbox" <?php selected( $this->type, 'textbox' ); ?>><?php _e( 'Text Box', 'buddypress' ); ?></option> 943 <option value="textarea" <?php selected( $this->type, 'textarea' ); ?>><?php _e( 'Multi-line Text Area', 'buddypress' ); ?></option> 944 <option value="datebox" <?php selected( $this->type, 'datebox' ); ?>><?php _e( 'Date Selector', 'buddypress' ); ?></option> 945 </optgroup> 946 <optgroup label="<?php _e( 'Multi Fields', 'buddypress' ); ?>"> 947 <option value="radio" <?php selected( $this->type, 'radio' ); ?>><?php _e( 'Radio Buttons', 'buddypress' ); ?></option> 948 <option value="selectbox" <?php selected( $this->type, 'selectbox' ); ?>><?php _e( 'Drop Down Select Box', 'buddypress' ); ?></option> 949 <option value="multiselectbox" <?php selected( $this->type, 'multiselectbox' ); ?>><?php _e( 'Multi Select Box', 'buddypress' ); ?></option> 950 <option value="checkbox" <?php selected( $this->type, 'checkbox' ); ?>><?php _e( 'Checkboxes', 'buddypress' ); ?></option> 951 </optgroup> 952 </select> 908 953 909 <?php endforeach?>954 <?php do_action_ref_array( 'xprofile_field_additional_options', array( $this ) ); ?> 910 955 911 </ul> 912 </div> 956 <?php $this->render_admin_form_children(); ?> 913 957 914 <div id="titlewrap"> 915 <h3><label for="allow-custom-visibility"><?php _e( 'Per-Member Visibility', 'buddypress' ); ?></label></h3> 916 <ul> 917 <li><label><input type="radio" name="allow-custom-visibility" value="allowed" <?php checked( $this->allow_custom_visibility, 'allowed' ); ?>> <?php _e( "Let members change this field's visibility", 'buddypress' ); ?></label></li> 918 <li><label><input type="radio" name="allow-custom-visibility" value="disabled" <?php checked( $this->allow_custom_visibility, 'disabled' ); ?>> <?php _e( 'Enforce the default visibility for all members', 'buddypress' ); ?></label></li> 919 </ul> 920 </div> 921 </div> 958 </div> 959 </div> 922 960 923 <?php endif?>961 <?php else : ?> 924 962 925 <p class="submit"> 926 <input type="hidden" name="field_order" id="field_order" value="<?php echo esc_attr( $this->field_order ); ?>" /> 927 <input type="submit" value="<?php _e( 'Save', 'buddypress' ); ?>" name="saveField" id="saveField" style="font-weight: bold" class="button-primary" /> 928 <?php _e( 'or', 'buddypress' ); ?> <a href="admin.php?page=bp-profile-setup" class="deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a> 929 </p> 963 <input type="hidden" name="required" id="required" value="1" /> 964 <input type="hidden" name="fieldtype" id="fieldtype" value="textbox" /> 930 965 931 </div>966 <?php endif; ?> 932 967 933 <?php wp_nonce_field( 'xprofile_delete_option' ); ?> 968 </div> 969 </div><!-- #post-body --> 934 970 971 </div><!-- #poststuff --> 972 935 973 </form> 936 974 </div> 937 975