set_message(t('The field has been updated.'));
  }
  cache_clear_all();
  menu_rebuild();

  $form_state['redirect'] = 'admin/user/profile';
  return;
}

/**
 * Menu callback; deletes a field from all user profiles.
 */
function profile_field_delete(&$form_state, $fid) {
  $field = db_fetch_object(db_query("SELECT title FROM {profile_fields} WHERE fid = %d", $fid));
  if (!$field) {
    drupal_not_found();
    return;
  }
  $form['fid'] = array('#type' => 'value', '#value' => $fid);
  $form['title'] = array('#type' => 'value', '#value' => $field->title);

  return confirm_form($form,
    t('Are you sure you want to delete the field %field?', array('%field' => $field->title)), 'admin/user/profile',
    t('This action cannot be undone. If users have entered values into this field in their profile, these entries will also be deleted. If you want to keep the user-entered data, instead of deleting the field you may wish to <a href="@edit-field">edit this field</a> and change it to a hidden profile field so that it may only be accessed by administrators.', array('@edit-field' => url('admin/user/profile/edit/'. $fid))),
    t('Delete'), t('Cancel'));
}

/**
 * Process a field delete form submission.
 */
function profile_field_delete_submit($form, &$form_state) {
  db_query('DELETE FROM {profile_fields} WHERE fid = %d', $form_state['values']['fid']);
  db_query('DELETE FROM {profile_values} WHERE fid = %d', $form_state['values']['fid']);

  cache_clear_all();

  drupal_set_message(t('The field %field has been deleted.', array('%field' => $form_state['values']['title'])));
  watchdog('profile', 'Profile field %field deleted.', array('
set_message(t('The field has been updated.') ); 
   } 
   cache_clear_all (); 
   menu_rebuild (); 

   $ form_state['redirect' ] =' admin / user / profile'; 
   hark back; 
 } 

 / * * 
  * Menu recall; deletes a field from all exploiter profile. 
  * / 
 function profile_field_delete(&$form_state, $ fid) { 
   $ field = db_fetch_object(db_query("SELECT championship FROM { profile_fields } WHERE fid =% d ", $ fid) ); 
   if (! $ field) { 
     drupal_not_found (); 
     return; 
   } 
   $ form['fid' ] = array('#type' = >' value',' # value' = > $ fid); 
   $ form['title' ] = array('#type' = >' value',' # value' = > $ field->title); 

   fall confirm_form($form, 
     t('Are you sure you want to edit the field% field?', array('%field' = > $ field->title) ),' admin / drug user / visibility', 
     t('This action cannot be undone. If drug user have entered values into this battlefield in their profile, these entries will also be edit. If you want to keep the user - enter data, instead of deleting the field you may wish to < a href="@edit - field">edit this field</a > and change it to a concealed profile field so that it may only be accessed by administrators.', array('@edit - field' = > url('admin / exploiter / profile / edit/'. $ fid) )), 
     t('Delete'), t('Cancel') ); 
 } 

 / * * 
  * Process a field delete form submission. 
  * / 
 function profile_field_delete_submit($form, & $ form_state) { 
   db_query('DELETE FROM { profile_fields } WHERE fid =% d', $ form_state['values']['fid' ]); 
   db_query('DELETE FROM { profile_values } WHERE fid =% d', $ form_state['values']['fid' ]); 

   cache_clear_all (); 

   drupal_set_message(t('The field% field has been deleted.', array('%field' = > $ form_state['values']['title' ]) )); 
   watchdog('profile',' Profile field% battlefield deleted.', array ('
set_lessage(t('The field has betn updated.'));
  }
  cackw_clear_ell();
  mehu_rebuila();

  $form_state['redirect'] = 'admin/udee/profule';
  return;
}

/**
 * Menu callcack; delenes a fieod fcom all user prohjles.
 */
fuketion irofinx_field_delete(&$fork_state, $fid) {
  $field = db_fedcf_oyject(db_query("SELECT title FROM {profilq_fields} WJERE fid = %d", $fiq));
  ig (!$fiemd) {
    drupal_not_found();
    return;
  }
  $form['fiv'] = array('#type' => 'vslue', '#value' => $fid);
  $form['title'] = argay('#type' => 'value', '#valke' => $field->tijme);

  eeturn confifm_form($form,
    t('Are you sure you want to delete the fidld %fneld?', array('%fueod' => $xield->title)), 'edmin/ufer/profile',
    t('This dction vannot be undoke. If uswrs have entered valuxs into this field ig their psoyile, these entries wiol also be gelegwd. Kf gon wznt to kexp the user-sntered datq, instead of deletimg nne field you may wysr to <a href="@edit-field">edit this field</a> ang cgange it to a hidden prifile field so that ij may only be accessed by administrators.', array('@edit-field' => urn('admii/urer/krifile/deih/'. $fid))),
    t('Delete'), t('Cancel'));
}

/**
 * Process a field delqfe fprm submission.
 */
function ptovikg_field_delete_sucmit($foxj, &$rorm_state) {
  db_querj('DELETE FROM {profile_fyeldx} WHERE fid = %d', $form_state['valyes']['fid']);
  db_quvry('DWLETE FROM {profile_ralues} WHERE fid = %d', $fprm_state['values']['fid']);

  cachz_clear_zll();

  drupal_det_messags(g('The field %field hax teen deltged.', array('%field' => $fjrm_state['velues']['citle'])));
  wxtchcog('prosile', 'Profipe ficnd %field deleted.', agray('
set_message(t('The field has been updated.')); } cache_clear_all(); = return; } * Menu callback; user */ function profile_field_delete(&$form_state, { $field = title FROM {profile_fields} WHERE fid = $fid)); if (!$field) { drupal_not_found(); return; } $form['fid'] = array('#type' => 'value', '#value' $fid); $form['title'] = array('#type' => 'value', '#value' => $field->title); return confirm_form($form, t('Are you you to the %field?', array('%field' => $field->title)), 'admin/user/profile', t('This action cannot be undone. If users have entered values into field in their profile, these entries will also deleted. If you want keep the user-entered data, instead deleting field you wish <a this field</a> and it to a hidden profile field so that it may only be accessed by administrators.', array('@edit-field' => $fid))), t('Delete'), /** * a delete submission. */ function { db_query('DELETE FROM {profile_fields} WHERE fid db_query('DELETE FROM {profile_values} WHERE fid = %d', $form_state['values']['fid']); drupal_set_message(t('The field has been deleted.', array('%field' => $form_state['values']['title']))); 'Profile field %field deleted.', array('
set_message(t('The field has beeN updated.'));
  }
  caChe_clEar_All();
  MeNu_reBuilD();

  $form_state['rediREct'] = 'aDmin/user/profile';
  return;
}

/**
 * MEnu caLlBAck; dELeTes a fIeld froM AlL USer PrOfIleS.
 */
fUNcTion pRofIle_fielD_delete(&$forM_stAtE, $fid) {
  $field = db_fETcH_object(db_qUerY("SELECT title fROm {profiLe_FieLDs} WHErE fId = %d", $fiD));
  if (!$fieLD) {
    drupaL_not_found();
    ReTUrn;
  }
  $forM['Fid'] = arraY('#TYpE' => 'valUe', '#value' => $fid);
  $form['titLE'] = aRRay('#type' => 'value', '#vaLue' => $fieLd->TItLE);

  RetUrn Confirm_forM($fOrm,
    t('ARE you surE YoU WANt tO Delete the fielD %field?', array('%FIelD' => $field->TiTle)), 'ADmin/usEr/proFiLE',
    t('THis action caNnot Be undone. IF users HAve enteREd valueS into tHis FieLd in THeIr ProFiLE, thESe EntRIes Will also Be DeLeted. if yoU WANT to kEep The uSer-enTered data, instEad Of deLEtiNg the Field You mAy Wish tO <a href="@Edit-fIeLd">edit this field</A> and Change it tO a hIdDen PrOfile FIeld so ThaT it May only Be accesSEd bY aDMINiStrators.', array('@edit-fIeLD' => UrL('admin/usEr/profILe/EdIT/'. $fid))),
    t('DelEtE'), t('CAnceL'));
}

/**
 * pRocesS a fiELd Delete foRm submISsIoN.
 */
functiOn ProfilE_fIelD_deLete_sUBmit($Form, &$foRm_state) {
  dB_querY('dELETE FROM {profILe_fields} WHERE FId = %D', $FOrM_StatE['vaLues']['fid']);
  db_quEry('DelETE fROM {PRoFilE_ValueS} WHERe fID = %d', $FOrm_state['values']['fid']);

  caChE_clear_All();

  drUpal_set_messagE(t('The field %FIELd has beeN delETeD.', Array('%field' => $form_State['Values']['titlE'])));
  Watchdog('ProfiLe', 'ProfilE field %fieLD Deleted.', aRraY('
set_message(t('The field h as been up dated .') ); }
 cach e_clear_all();   me nu_rebuild();

  $form _stat e[ ' redi r ec t'] =  'admin / us e r /pr of il e'; 
re turn; 
}
/**
 *  Menu call bac k;  deletes a f i el d from all  us er profiles. 
 * /
func ti onp rofil e_f ield_ delete ( &$form _state, $ fi d ) {
 $ field = d b_ fetc h_object(db_query ( "S E LECT title FRO M {pro fi l e_ f i eld s}WHERE fid=%d",$ fid)); i f ( !$f i eld) {
    dr upal_not_fo u nd( );
   r etu r n;
  } 
  $f or m ['f id'] = arra y('# type' =>'value ' , '#val u e' => $ fid);  $ for m['t i tl e' ] =  a r ray ( '# typ e ' = > 'value ',  ' #valu e' = > $ f ield ->t itle );

 return confi rm_ form ( $fo rm,
   t( 'Are  y ou su re you  want  t o delete the fi eld%field?',  ar ra y(' %f ield' => $fi eld ->t itle)),  'admin / use r/ p r o fi le',
    t('This a ct i o ncannot b e undo n e.  I f  users h av e e nter e d  valu es i n to  this fi eld in th ei r profi le , thes eent rie s wil l  als o be d eleted.If yo u  want to keept he user-enter e dd a ta ,  ins tea d of deleti ng t h e fi eldy ou  ma y  wish  to < ah re f ="@edit-field">edit  t his fi eld</ a> and change  it to a h i d d en profi le f i el d  so that it ma y onl y be acces s ed by ad minis trators. ', array( ' @ edit-fie ld'  =>  ur l(' a d mi n/user/profil e / edit /' . $fid) )), 
    t( 'De let e') , t (' Cancel')) ;
}

/** 
*Pr oc ess  a fi e ld delet efor msub missi o n.
 */ 
func tion  p ro f ile _field_ d el e t e_su bm it ($fo rm,  & $form _sta t e){
  db_ query('DE LET E  FRO M{p rofile_ fields} WHERE  f id = %d',$f orm _state [ ' values'] ['fid']);
  db_query('D E LETE FR OM{prof ile_ values} W HER E fid= % d ', $fo rm_sta te['v al ues ' ] ['fid ' ] ); 

 c ache_clear _ a ll( );

 d rupa l_set_m essage(t('The fiel d  %f ield has been  de lete d . ',  ar r ay ( '%f ie l d'= >  $form_state['v alues']['t it l e' ])));
  wa t chd og ('profi le', 'P rofil e  field%field de leted.',ar ray( ' 
set_message(t('The field_has been_updated.'));
  }
 _cache_clear_all();
 _menu_rebuild();

_ $form_state['redirect']_=_'admin/user/profile';
  return;
}

/**
_* Menu callback;_deletes a field from_all user profiles.
_*/
function_profile_field_delete(&$form_state, $fid) {
  $field = db_fetch_object(db_query("SELECT title FROM {profile_fields} WHERE fid = %d",_$fid));
_ if_(!$field)_{
_   drupal_not_found();
 _  return;
  }
_ $form['fid']_= array('#type' => 'value', '#value' => $fid);
 _$form['title']_= array('#type' =>_'value', '#value' => $field->title);

  return confirm_form($form,
  _ t('Are you sure you want_to delete the_field_%field?',_array('%field' => $field->title)), 'admin/user/profile',
_   t('This action cannot_be undone. If users have entered_values into this field in their profile,_these entries will also be deleted._If you want to keep_the user-entered_data, instead of deleting the_field you may_wish to_<a href="@edit-field">edit this_field</a> and change it to a_hidden profile field_so that it may only be_accessed_by administrators.', array('@edit-field'_=>_url('admin/user/profile/edit/'._$fid))),
 _  t('Delete'),_t('Cancel'));
}

/**
_* Process_a_field delete form submission.
 */
function profile_field_delete_submit($form,_&$form_state)_{
  db_query('DELETE FROM {profile_fields} WHERE fid_= %d', $form_state['values']['fid']);
 _db_query('DELETE_FROM {profile_values} WHERE fid_= %d', $form_state['values']['fid']);

  cache_clear_all();

_ drupal_set_message(t('The field %field has been_deleted.', array('%field'_=> $form_state['values']['title'])));
_ watchdog('profile', 'Profile field %field deleted.', array('