$required = $_POST[$field . '_required']; } else { $required = false; } $res[$current_cat][] = array('field_id' => $field, 'label' => $_POST[$field . '_label'], 'category' => $_POST[$field . '_category'], 'visible' => $_POST[$field . '_visible'], 'required' => $required); $pos++; } //okay, we've got the new array, we send it to the //Object that will store it in the database $success = $fc->setFields($res); FieldsCategories::setCategories($_POST['categories']); if ($success === true) { $success_detected[] = _T("Fields configuration has been successfully stored"); } else { $error_detected[] = _T("An error occured while storing fields configuration :("); } } $tpl->assign('page_title', _T("Fields configuration")); $tpl->assign('time', time()); $tpl->assign('categories', FieldsCategories::getList()); $tpl->assign('categorized_fields', $fc->getCategorizedFields()); $tpl->assign('non_required', $fc->getNonRequired()); $tpl->assign('current', $current); $tpl->assign('require_dialog', true); $tpl->assign('require_sorter', true); $tpl->assign('success_detected', $success_detected); $tpl->assign('error_detected', $error_detected); //$tpl->assign('require_sorter', true); $content = $tpl->fetch('config_fields.tpl'); $tpl->assign('content', $content); $tpl->display('page.tpl');