function pcp_profile_field_form_submit in Profile Complete Percent 5
Same name and namespace in other branches
- 6.2 pcp.module \pcp_profile_field_form_submit()
- 6 pcp.module \pcp_profile_field_form_submit()
Called when a user submits a profile field form from the profile module (when adding or editing a profile field).
1 string reference to 'pcp_profile_field_form_submit'
- pcp_form_alter in ./
pcp.module - Implementation of hook_form_alter()
File
- ./
pcp.module, line 103 - 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_profile_field_form_submit($form, &$form_state) {
$fid = $form_state['values']['fid'] ? $form_state['values']['fid'] : db_result(db_query("SELECT MAX(fid) FROM {profile_fields}"));
db_query("DELETE FROM {profile_pcp} WHERE fid = %d", $form_state['values']['fid']);
if ($form_state['values']['tag']) {
db_query("INSERT INTO {profile_pcp} (`fid`) VALUES (%d)", $fid);
}
}