function formdefaults_edit_field_submit in Form Defaults 5.3
Same name and namespace in other branches
- 6.2 formdefaults.admin.inc \formdefaults_edit_field_submit()
- 7 formdefaults.admin.inc \formdefaults_edit_field_submit()
File
- ./
formdefaults.admin.inc, line 452
Code
function formdefaults_edit_field_submit($formid, $form_values) {
$formid = $form_values['formid'];
$fieldname = $form_values['fieldname'];
$formarray = formdefaults_getform($formid);
$baseform = $formarray;
// set the form values
if ($_POST['op'] == 'Reset') {
unset($formarray[$fieldname]);
}
else {
if ($form_values['type'] == 'markup') {
$formarray[$fieldname]['value'] = $form_values['value'];
$formarray[$fieldname]['format'] = $form_values['format'];
}
else {
$formarray[$fieldname]['title'] = $form_values['title'];
$formarray[$fieldname]['description'] = $form_values['description'];
}
if ($form_values['collapsible'] === '') {
unset($formarray[$fieldname]['collapsible']);
}
else {
$formarray[$fieldname]['collapsible'] = $form_values['collapsible'];
}
if ($form_values['collapsed'] === '') {
unset($formarray[$fieldname]['collapsed']);
}
else {
$formarray[$fieldname]['collapsed'] = $form_values['collapsed'];
}
$formarray[$fieldname]['hide_it'] = $form_values['hide_it'];
$formarray[$fieldname]['weight'] = $form_values['weight'];
$formarray[$fieldname]['type'] = $form_values['type'];
}
_formdefaults_save_form($formid, $formarray);
return 'formdefaults/' . $formid;
}