function smiley_admin_form_submit in Smiley 6
Implementation of hook_submit().
File
- ./
smiley.admin.inc, line 274
Code
function smiley_admin_form_submit($form, &$form_state) {
$form_values = $form_state['values'];
$form_values['category'] = empty($form_values['category']) ? $form_values['category_other'] : $form_values['category'];
if (isset($form_values['id'])) {
db_query("UPDATE {smiley} SET acronyms='%s', image='%s', description='%s', standalone=%d, promote_to_box=%d, package='%s' WHERE id = %d", trim($form_values["acronyms"]), trim($form_values['image']), trim($form_values['description']), $form_values['standalone'], $form_values['promote_to_box'], $form_values['category'], $form_values['id']);
$message = t('Updated smiley: %smiley', array(
'%smiley' => $form_values['acronyms'],
));
}
else {
db_query("INSERT INTO {smiley} (acronyms, image, description, standalone, promote_to_box, package) VALUES ('%s', '%s', '%s', %d, %d, '%s')", trim($form_values["acronyms"]), trim($form_values["image"]), trim($form_values["description"]), $form_values["standalone"], $form_values['promote_to_box'], $form_values['category']);
$message = t('Added smiley: %smiley', array(
'%smiley' => $form_values['acronyms'],
));
}
drupal_set_message($message);
$form_state['redirect'] = 'admin/settings/smiley';
}