function pcp_admin_settings_form_submit in Profile Complete Percent 5
Same name and namespace in other branches
- 6.2 pcp.module \pcp_admin_settings_form_submit()
- 6 pcp.module \pcp_admin_settings_form_submit()
Admin settings form submit
File
- ./
pcp.module, line 145 - Allows users with valid permissions to tag profile fields created from the profile module as required fields for a users profile to be considered complete.
Code
function pcp_admin_settings_form_submit($form, &$form_state) {
if (is_array($form_state['values']['profile_fields']) && !empty($form_state['values']['profile_fields'])) {
db_query("DELETE FROM {profile_pcp}");
foreach ($form_state['values']['profile_fields'] as $fid) {
if ($fid) {
db_query("INSERT INTO {profile_pcp} VALUES (%d)", $fid);
}
}
drupal_set_message("Your settings have been saved.");
}
}