You are here

function _pcp_save_profile_fields in Profile Complete Percent 7

Utility function used to save fields.

1 call to _pcp_save_profile_fields()
pcp_admin_settings_submit in includes/pcp.admin.inc
Submit callback.

File

includes/pcp.admin.inc, line 212
Admin interface for the pcp module

Code

function _pcp_save_profile_fields($profile_fields) {
  foreach ($profile_fields as $field_identifier => $value) {
    list($entity_type, $bundle, $field_name) = explode(':', $field_identifier);
    if (empty($value)) {
      _pcp_disable_field($entity_type, $bundle, $field_name);
    }
    else {
      _pcp_enable_field($entity_type, $bundle, $field_name);
    }
  }
  drupal_set_message(t("Your settings have been saved."));
}