2012-07-11 16:28:51 +00:00
< ? php
// Exit if accessed directly
if ( ! defined ( 'ABSPATH' ) ) exit ;
/**
* Creates the administration interface menus and checks to see if the DB
* tables are set up .
*
* @ package BuddyPress XProfile
2012-08-08 16:49:22 +00:00
* @ global object $bp Global BuddyPress settings object
* @ global $wpdb WordPress DB access object .
* @ uses is_super_admin () returns true if the current user is a site admin , false if not
* @ uses bp_xprofile_install () runs the installation of DB tables for the xprofile component
* @ uses wp_enqueue_script () Adds a JS file to the JS queue ready for output
* @ uses add_submenu_page () Adds a submenu tab to a top level tab in the admin area
* @ uses xprofile_install () Runs the DB table installation function
2012-07-11 16:28:51 +00:00
* @ return
*/
function xprofile_add_admin_menu () {
2012-08-08 16:49:22 +00:00
global $wpdb , $bp ;
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
if ( ! is_super_admin () )
2012-07-11 16:28:51 +00:00
return false ;
2012-08-08 16:49:22 +00:00
$hook = add_submenu_page ( 'bp-general-settings' , __ ( 'Profile Fields' , 'buddypress' ), __ ( 'Profile Fields' , 'buddypress' ), 'manage_options' , 'bp-profile-setup' , 'xprofile_admin' );
add_action ( " admin_print_styles- $hook " , 'bp_core_add_admin_menu_styles' );
2012-07-11 16:28:51 +00:00
}
add_action ( bp_core_admin_hook (), 'xprofile_add_admin_menu' );
/**
* Handles all actions for the admin area for creating , editing and deleting
* profile groups and fields .
*/
function xprofile_admin ( $message = '' , $type = 'error' ) {
2012-08-08 16:49:22 +00:00
global $bp ;
2012-07-11 16:28:51 +00:00
$type = preg_replace ( '|[^a-z]|i' , '' , $type );
$groups = BP_XProfile_Group :: get ( array (
'fetch_fields' => true
2012-08-08 16:49:22 +00:00
));
2012-07-11 16:28:51 +00:00
if ( isset ( $_GET [ 'mode' ] ) && isset ( $_GET [ 'group_id' ] ) && 'add_field' == $_GET [ 'mode' ] )
xprofile_admin_manage_field ( $_GET [ 'group_id' ] );
else if ( isset ( $_GET [ 'mode' ] ) && isset ( $_GET [ 'group_id' ] ) && isset ( $_GET [ 'field_id' ] ) && 'edit_field' == $_GET [ 'mode' ] )
xprofile_admin_manage_field ( $_GET [ 'group_id' ], $_GET [ 'field_id' ] );
else if ( isset ( $_GET [ 'mode' ] ) && isset ( $_GET [ 'field_id' ] ) && 'delete_field' == $_GET [ 'mode' ] )
xprofile_admin_delete_field ( $_GET [ 'field_id' ], 'field' );
else if ( isset ( $_GET [ 'mode' ] ) && isset ( $_GET [ 'option_id' ] ) && 'delete_option' == $_GET [ 'mode' ] )
xprofile_admin_delete_field ( $_GET [ 'option_id' ], 'option' );
else if ( isset ( $_GET [ 'mode' ] ) && 'add_group' == $_GET [ 'mode' ] )
xprofile_admin_manage_group ();
else if ( isset ( $_GET [ 'mode' ] ) && isset ( $_GET [ 'group_id' ] ) && 'delete_group' == $_GET [ 'mode' ] )
xprofile_admin_delete_group ( $_GET [ 'group_id' ] );
else if ( isset ( $_GET [ 'mode' ] ) && isset ( $_GET [ 'group_id' ] ) && 'edit_group' == $_GET [ 'mode' ] )
xprofile_admin_manage_group ( $_GET [ 'group_id' ] );
2012-08-08 16:49:22 +00:00
else {
?>
2012-07-11 16:28:51 +00:00
< div class = " wrap " >
2012-08-08 16:49:22 +00:00
< ? php screen_icon ( 'buddypress' ); ?>
2012-07-11 16:28:51 +00:00
< h2 >
2012-08-08 16:49:22 +00:00
< ? php _e ( 'Extended Profile Fields' , 'buddypress' ); ?>
< a id = " add_group " class = " button add-new-h2 " href = " admin.php?page=bp-profile-setup&mode=add_group " >< ? php _e ( 'Add New Group' , 'buddypress' ); ?> </a>
2012-07-11 16:28:51 +00:00
</ h2 >
2012-08-08 16:49:22 +00:00
< p >< ? php _e ( 'Your users will distinguish themselves through their profile page. You must give them profile fields that allow them to describe themselves in a way that is relevant to the theme of your social network.' , 'buddypress' ); ?> </p>
< p >< ? php echo sprintf ( __ ( 'NOTE: Any fields in the "%s" group will appear on the signup page.' , 'buddypress' ), esc_html ( stripslashes ( bp_get_option ( 'bp-xprofile-base-group-name' ) ) ) ) ?> </p>
2012-07-11 16:28:51 +00:00
< form action = " " id = " profile-field-form " method = " post " >
2012-08-08 16:49:22 +00:00
< ? php wp_nonce_field ( 'bp_reorder_fields' , '_wpnonce_reorder_fields' ); ?>
< ? php wp_nonce_field ( 'bp_reorder_groups' , '_wpnonce_reorder_groups' , false );
2012-07-11 16:28:51 +00:00
if ( ! empty ( $message ) ) :
$type = ( $type == 'error' ) ? 'error' : 'updated' ; ?>
< div id = " message " class = " <?php echo $type ; ?> fade " >
< p >< ? php echo esc_html ( esc_attr ( $message ) ); ?> </p>
</ div >
2012-08-08 16:49:22 +00:00
< ? php endif ; ?>
2012-07-11 16:28:51 +00:00
< div id = " tabs " >
< ul id = " field-group-tabs " >
2012-08-08 16:49:22 +00:00
< ? php
if ( ! empty ( $groups ) ) :
foreach ( $groups as $group ) { ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< li id = " group_<?php echo $group->id ; ?> " >< a href = " #tabs-<?php echo $group->id ; ?> " class = " ui-tab " >< ? php echo esc_attr ( $group -> name ); ?> <?php if ( !$group->can_delete ) : ?> <?php _e( '(Primary)', 'buddypress'); endif; ?></a></li>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< ? php }
endif ; ?>
2012-07-11 16:28:51 +00:00
</ ul >
2012-08-08 16:49:22 +00:00
< ? php if ( ! empty ( $groups ) ) :
foreach ( $groups as $group ) { ?>
2012-07-11 16:28:51 +00:00
< noscript >
< h3 >< ? php echo esc_attr ( $group -> name ); ?> </h3>
</ noscript >
< div id = " tabs-<?php echo $group->id ; ?> " class = " tab-wrapper " >
< div class = " tab-toolbar " >
< div class = " tab-toolbar-left " >
2012-08-08 16:49:22 +00:00
< a class = " button " 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>
2012-07-11 16:28:51 +00:00
< 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>
2012-08-08 16:49:22 +00:00
< ? php if ( $group -> can_delete ) : ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< a class = " submitdelete deletion " href = " admin.php?page=bp-profile-setup&mode=delete_group&group_id=<?php echo esc_attr( $group->id ); ?> " >< ? php _e ( 'Delete Group' , 'buddypress' ); ?> </a>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< ? php endif ; ?>
2012-07-11 16:28:51 +00:00
</ div >
</ div >
< fieldset id = " <?php echo $group->id ; ?> " class = " connectedSortable field-group " >
2012-08-08 16:49:22 +00:00
< ? php if ( $group -> description ) : ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< legend >< ? php echo esc_attr ( $group -> description ) ?> </legend>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< ? php endif ;
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
if ( ! empty ( $group -> fields ) ) :
foreach ( $group -> fields as $field ) {
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
// Load the field
$field = new BP_XProfile_Field ( $field -> id );
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
$class = '' ;
if ( ! $field -> can_delete )
$class = ' core nodrag' ;
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
/* This function handles the WYSIWYG profile field
* display for the xprofile admin setup screen
*/
xprofile_admin_field ( $field , $group , $class );
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
} // end for
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
else : // !$group->fields
?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< p class = " nodrag nofields " >< ? php _e ( 'There are no fields in this group.' , 'buddypress' ); ?> </p>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< ? php
endif ; // end $group->fields
?>
2012-07-11 16:28:51 +00:00
</ fieldset >
</ div >
2012-08-08 16:49:22 +00:00
< ? php
} // End For ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
</ div >
< ? php
else :
?>
2012-08-08 12:00:19 +00:00
2012-08-08 16:49:22 +00:00
< div id = " message " class = " error " >< p >< ? php _e ( 'You have no groups.' , 'buddypress' ); ?> </p></div>
< p >< a href = " admin.php?page=bp-profile-setup&mode=add_group " >< ? php _e ( 'Add New Group' , 'buddypress' ); ?> </a></p>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< ? php
endif ;
?>
< div id = " tabs-bottom " >
& nbsp ;
</ div >
</ form >
</ div >
2012-07-11 16:28:51 +00:00
< ? php
}
}
2012-08-08 16:49:22 +00:00
/**************************************************************************
xprofile_admin_manage_group ()
Handles the adding or editing of groups .
**************************************************************************/
2012-07-11 16:28:51 +00:00
function xprofile_admin_manage_group ( $group_id = null ) {
global $message , $type ;
$group = new BP_XProfile_Group ( $group_id );
if ( isset ( $_POST [ 'save_group' ] ) ) {
if ( BP_XProfile_Group :: admin_validate ( $_POST ) ) {
$group -> name = wp_filter_kses ( $_POST [ 'group_name' ] );
$group -> description = ! empty ( $_POST [ 'group_description' ] ) ? wp_filter_kses ( $_POST [ 'group_description' ] ) : '' ;
if ( ! $group -> save () ) {
$message = __ ( 'There was an error saving the group. Please try again' , 'buddypress' );
$type = 'error' ;
} else {
$message = __ ( 'The group was saved successfully.' , 'buddypress' );
$type = 'success' ;
if ( 1 == $group_id )
bp_update_option ( 'bp-xprofile-base-group-name' , $group -> name );
do_action ( 'xprofile_groups_saved_group' , $group );
}
unset ( $_GET [ 'mode' ] );
xprofile_admin ( $message , $type );
} else {
$group -> render_admin_form ( $message );
}
} else {
$group -> render_admin_form ();
}
}
2012-08-08 16:49:22 +00:00
/**************************************************************************
xprofile_admin_delete_group ()
Handles the deletion of profile data groups .
**************************************************************************/
2012-07-11 16:28:51 +00:00
function xprofile_admin_delete_group ( $group_id ) {
global $message , $type ;
$group = new BP_XProfile_Group ( $group_id );
if ( ! $group -> delete () ) {
$message = __ ( 'There was an error deleting the group. Please try again' , 'buddypress' );
$type = 'error' ;
} else {
$message = __ ( 'The group was deleted successfully.' , 'buddypress' );
$type = 'success' ;
do_action ( 'xprofile_groups_deleted_group' , $group );
}
unset ( $_GET [ 'mode' ] );
xprofile_admin ( $message , $type );
}
2012-08-08 16:49:22 +00:00
/**************************************************************************
xprofile_admin_manage_field ()
Handles the adding or editing of profile field data for a user .
**************************************************************************/
2012-07-11 16:28:51 +00:00
function xprofile_admin_manage_field ( $group_id , $field_id = null ) {
global $bp , $wpdb , $message , $groups ;
2012-08-08 16:49:22 +00:00
$field = new BP_XProfile_Field ( $field_id );
2012-07-11 16:28:51 +00:00
$field -> group_id = $group_id ;
if ( isset ( $_POST [ 'saveField' ] ) ) {
if ( BP_XProfile_Field :: admin_validate () ) {
$field -> name = wp_filter_kses ( $_POST [ 'title' ] );
$field -> description = ! empty ( $_POST [ 'description' ] ) ? wp_filter_kses ( $_POST [ 'description' ] ) : '' ;
$field -> is_required = wp_filter_kses ( $_POST [ 'required' ] );
$field -> type = wp_filter_kses ( $_POST [ 'fieldtype' ] );
if ( ! empty ( $_POST [ " sort_order_ { $field -> type } " ] ) )
$field -> order_by = wp_filter_kses ( $_POST [ " sort_order_ { $field -> type } " ] );
$field -> field_order = $wpdb -> get_var ( $wpdb -> prepare ( " SELECT field_order FROM { $bp -> profile -> table_name_fields } WHERE id = %d " , $field_id ) );
if ( ! $field -> field_order ) {
$field -> field_order = ( int ) $wpdb -> get_var ( $wpdb -> prepare ( " SELECT max(field_order) FROM { $bp -> profile -> table_name_fields } WHERE group_id = %d " , $group_id ) );
$field -> field_order ++ ;
}
2012-08-08 16:49:22 +00:00
if ( ! $field -> save () ) {
2012-07-11 16:28:51 +00:00
$message = __ ( 'There was an error saving the field. Please try again' , 'buddypress' );
$type = 'error' ;
unset ( $_GET [ 'mode' ] );
xprofile_admin ( $message , $type );
} else {
$message = __ ( 'The field was saved successfully.' , 'buddypress' );
$type = 'success' ;
if ( 1 == $field_id )
bp_update_option ( 'bp-xprofile-fullname-field-name' , $field -> name );
unset ( $_GET [ 'mode' ] );
do_action ( 'xprofile_fields_saved_field' , $field );
$groups = BP_XProfile_Group :: get ();
xprofile_admin ( $message , $type );
}
} else {
$field -> render_admin_form ( $message );
}
} else {
$field -> render_admin_form ();
}
}
2012-08-08 16:49:22 +00:00
/**************************************************************************
xprofile_admin_delete_field ()
Handles the deletion of a profile field [ or option ] .
**************************************************************************/
function xprofile_admin_delete_field ( $field_id , $type = 'field' ) {
2012-07-11 16:28:51 +00:00
global $message , $type ;
2012-08-08 16:49:22 +00:00
if ( 'field' == $type )
$type = __ ( 'field' , 'buddypress' );
else
$type = __ ( 'option' , 'buddypress' );
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
$field = new BP_XProfile_Field ( $field_id );
if ( ! $field -> delete () ) {
$message = sprintf ( __ ( 'There was an error deleting the %s. Please try again' , 'buddypress' ), $type );
$type = 'error' ;
2012-07-11 16:28:51 +00:00
} else {
2012-08-08 16:49:22 +00:00
$message = sprintf ( __ ( 'The %s was deleted successfully!' , 'buddypress' ), $type );
$type = 'success' ;
2012-07-11 16:28:51 +00:00
do_action ( 'xprofile_fields_deleted_field' , $field );
}
unset ( $_GET [ 'mode' ] );
xprofile_admin ( $message , $type );
}
2012-08-08 16:49:22 +00:00
/**************************************************************************
xprofile_ajax_reorder_fields ()
Handles the ajax reordering of fields within a group
**************************************************************************/
2012-07-11 16:28:51 +00:00
function xprofile_ajax_reorder_fields () {
2012-08-08 16:49:22 +00:00
global $bp ;
2012-07-11 16:28:51 +00:00
// Check the nonce
check_admin_referer ( 'bp_reorder_fields' , '_wpnonce_reorder_fields' );
if ( empty ( $_POST [ 'field_order' ] ) )
return false ;
parse_str ( $_POST [ 'field_order' ], $order );
$field_group_id = $_POST [ 'field_group_id' ];
2012-08-08 16:49:22 +00:00
foreach ( ( array ) $order [ 'field' ] as $position => $field_id )
2012-07-11 16:28:51 +00:00
xprofile_update_field_position ( ( int ) $field_id , ( int ) $position , ( int ) $field_group_id );
2012-08-08 16:49:22 +00:00
2012-07-11 16:28:51 +00:00
}
add_action ( 'wp_ajax_xprofile_reorder_fields' , 'xprofile_ajax_reorder_fields' );
2012-08-08 16:49:22 +00:00
/**************************************************************************
xprofile_ajax_reorder_field_groups ()
Handles the reordering of field groups
**************************************************************************/
2012-07-11 16:28:51 +00:00
function xprofile_ajax_reorder_field_groups () {
2012-08-08 16:49:22 +00:00
global $bp ;
2012-07-11 16:28:51 +00:00
// Check the nonce
check_admin_referer ( 'bp_reorder_groups' , '_wpnonce_reorder_groups' );
if ( empty ( $_POST [ 'group_order' ] ) )
return false ;
parse_str ( $_POST [ 'group_order' ], $order );
2012-08-08 16:49:22 +00:00
foreach ( ( array ) $order [ 'group' ] as $position => $field_group_id )
2012-07-11 16:28:51 +00:00
xprofile_update_field_group_position ( ( int ) $field_group_id , ( int ) $position );
2012-08-08 16:49:22 +00:00
2012-07-11 16:28:51 +00:00
}
add_action ( 'wp_ajax_xprofile_reorder_groups' , 'xprofile_ajax_reorder_field_groups' );
2012-08-08 16:49:22 +00:00
/**************************************************************************
xprofile_admin_field ()
Handles the WYSIWYG display of each profile field on the edit screen
**************************************************************************/
function xprofile_admin_field ( $admin_field , $admin_group , $class = '' ) {
2012-07-11 16:28:51 +00:00
global $field ;
$field = $admin_field ; ?>
2012-08-08 16:49:22 +00:00
< fieldset id = " field_<?php echo esc_attr( $field->id ); ?> " class = " sortable<?php echo ' ' . $field->type ; if ( $class ) echo ' ' . $class ; ?> " >
< legend >< span >< ? php bp_the_profile_field_name (); ?> <?php if( !$field->can_delete ) : ?> <?php _e( '(Primary)', 'buddypress' ); endif; ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(Required)', 'buddypress' ) ?><?php endif; ?></span></legend>
< div class = " field-wrapper " >
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< ? php
switch ( $field -> type ) {
case 'textbox' : ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< input type = " text " name = " <?php bp_the_profile_field_input_name() ?> " id = " <?php bp_the_profile_field_input_name() ?> " value = " " />
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< ? php break ; case 'textarea' : ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< textarea rows = " 5 " cols = " 40 " name = " <?php bp_the_profile_field_input_name() ?> " id = " <?php bp_the_profile_field_input_name() ?> " ></ textarea >
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< ? php break ; case 'selectbox' : ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< select name = " <?php bp_the_profile_field_input_name() ?> " id = " <?php bp_the_profile_field_input_name() ?> " >
< ? php bp_the_profile_field_options () ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
</ select >
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< ? php break ; case 'multiselectbox' : ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< select name = " <?php bp_the_profile_field_input_name() ?> " id = " <?php bp_the_profile_field_input_name() ?> " multiple = " multiple " >
< ? php bp_the_profile_field_options () ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
</ select >
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< ? php break ; case 'radio' : ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< ? php bp_the_profile_field_options () ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< ? php if ( ! bp_get_the_profile_field_is_required () ) : ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< a class = " clear-value " href = " javascript:clear( '<?php bp_the_profile_field_input_name() ?>' ); " >< ? php _e ( 'Clear' , 'buddypress' ) ?> </a>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< ? php endif ; ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< ? php break ; case 'checkbox' : ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< ? php bp_the_profile_field_options (); ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< ? php break ; case 'datebox' : ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< select name = " <?php bp_the_profile_field_input_name(); ?>_day " id = " <?php bp_the_profile_field_input_name(); ?>_day " >
< ? php bp_the_profile_field_options ( 'type=day' ); ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
</ select >
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< select name = " <?php bp_the_profile_field_input_name(); ?>_month " id = " <?php bp_the_profile_field_input_name(); ?>_month " >
< ? php bp_the_profile_field_options ( 'type=month' ); ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
</ select >
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
< select name = " <?php bp_the_profile_field_input_name(); ?>_year " id = " <?php bp_the_profile_field_input_name(); ?>_year " >
< ? php bp_the_profile_field_options ( 'type=year' ); ?>
2012-08-08 12:00:19 +00:00
2012-08-08 16:49:22 +00:00
</ select >
2012-08-08 12:00:19 +00:00
2012-08-08 16:49:22 +00:00
< ? php break ; default : ?>
2012-08-08 12:00:19 +00:00
2012-08-08 16:49:22 +00:00
< ? php do_action ( 'xprofile_admin_field' , $field , 1 ); ?>
2012-08-08 12:00:19 +00:00
2012-08-08 16:49:22 +00:00
< ? php } ?>
< div class = " actions " >
< 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>
< ? php if ( ! $field -> can_delete ) : ?> <?php else : ?><a class="button delete" href="admin.php?page=bp-profile-setup&field_id=<?php echo esc_attr( $field->id ); ?>&mode=delete_field"><?php _e( 'Delete', 'buddypress' ); ?></a><?php endif; ?>
2012-08-08 12:00:19 +00:00
2012-08-08 16:49:22 +00:00
</ div >
2012-08-08 12:00:19 +00:00
2012-08-08 16:49:22 +00:00
< ? php if ( $field -> description ) : ?>
2012-08-08 12:00:19 +00:00
2012-08-08 16:49:22 +00:00
< p class = " description " >< ? php echo esc_attr ( $field -> description ); ?> </p>
2012-08-08 12:00:19 +00:00
2012-08-08 16:49:22 +00:00
< ? php endif ; ?>
2012-07-11 16:28:51 +00:00
2012-08-08 16:49:22 +00:00
</ div >
</ fieldset >
2012-07-11 16:28:51 +00:00
< ? php
2012-08-08 16:49:22 +00:00
}