profile_admin_edit

Versions
4.6
profile_admin_edit($fid)

Menu callback; displays the profile field editing form.

Code

modules/profile.module, line 472

<?php
function profile_admin_edit($fid) {

  if ($_POST['op']) {
    $data = $_POST['edit'];

    // Validate form:
    profile_validate_form($data);

    if (!form_get_errors()) {
      db_query("UPDATE {profile_fields} SET title = '%s', name = '%s', explanation = '%s', category = '%s', weight = %d, required = %d, register = %d, visibility = %d, options = '%s', page = '%s' WHERE fid = %d", $data['title'], $data['name'], $data['explanation'], $data['category'], $data['weight'], $data['required'], $data['register'], $data['visibility'], $data['options'], $data['page'], $fid);

      cache_clear_all();

      drupal_set_message(t('The field has been updated.'));
      drupal_goto('admin/settings/profile');
    }
  }
  else {
    $data = db_fetch_array(db_query('SELECT * FROM {profile_fields} WHERE fid = %d', $fid));
  }

  drupal_set_title(t('Edit %type', array('%type' => check_plain($data['type']))));
  print theme('page', _profile_field_form($data['type'], $data));
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.