$cl_field_name = trim($request->getParameter('name'));
$cl_field_type = $request->getParameter('type');
$cl_required = $request->getParameter('required');
if (!$cl_required)
$cl_required = 0;
}
$cl_field_name = trim($request->getParameter('name'));
$cl_field_type = $request->getParameter('type');
$cl_required = $request->getParameter('required');
if (!$cl_required)
$cl_required = 0;
}
$form = new Form('fieldForm');
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','value'=>''));
$form->addInput(array('type'=>'combobox','name'=>'type',
'data'=>array(CustomFields::TYPE_TEXT=>$i18n->getKey('label.type_text'),
CustomFields::TYPE_DROPDOWN=>$i18n->getKey('label.type_dropdown'))
));
$form = new Form('fieldForm');
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','value'=>''));
$form->addInput(array('type'=>'combobox','name'=>'type',
'data'=>array(CustomFields::TYPE_TEXT=>$i18n->getKey('label.type_text'),
CustomFields::TYPE_DROPDOWN=>$i18n->getKey('label.type_dropdown'))
));
$res = CustomFields::insertField($cl_field_name, $cl_field_type, $cl_required);
if ($res) {
header('Location: cf_custom_fields.php');
exit();
} else
$res = CustomFields::insertField($cl_field_name, $cl_field_type, $cl_required);
if ($res) {
header('Location: cf_custom_fields.php');
exit();
} else
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.fieldForm.name.focus()"');
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('onload', 'onLoad="document.fieldForm.name.focus()"');