function uc_attribute_form_submit in Ubercart 5
Same name and namespace in other branches
- 6.2 uc_attribute/uc_attribute.admin.inc \uc_attribute_form_submit()
- 7.3 uc_attribute/uc_attribute.admin.inc \uc_attribute_form_submit()
Submit function for uc_attribute_add_form().
File
- uc_attribute/
uc_attribute.module, line 504
Code
function uc_attribute_form_submit($form_id, $form_values) {
if (!empty($form_values['aid'])) {
db_query("UPDATE {uc_attributes} SET name = '%s', ordering = %d, required = %d, display = %d, description = '%s' WHERE aid = %d", $form_values['name'], $form_values['ordering'], $form_values['required'], $form_values['display'], $form_values['description'], $form_values['aid']);
}
else {
db_query("INSERT INTO {uc_attributes} (name, ordering, required, display, description) VALUES ('%s', %d, %d, %d, '%s')", $form_values['name'], $form_values['ordering'], $form_values['required'], $form_values['display'], $form_values['description']);
}
return 'admin/store/products/attributes';
}