function search_autocomplete_treelist_form_submit in Search Autocomplete 7.4
Same name and namespace in other branches
- 6.4 search_autocomplete.form.treelist.inc \search_autocomplete_treelist_form_submit()
- 6.2 search_autocomplete.form.treelist.inc \search_autocomplete_treelist_form_submit()
- 7.2 search_autocomplete.form.treelist.inc \search_autocomplete_treelist_form_submit()
- 7.3 search_autocomplete.form.treelist.inc \search_autocomplete_treelist_form_submit()
Implements hook_submit().
Save the changes in the database.
File
- ./
search_autocomplete.form.treelist.inc, line 114 - Search Autocomplete Display the list of form to autocomplete and theme it as a draggable table.
Code
function search_autocomplete_treelist_form_submit($form, &$form_state) {
// Update the database with the new values.
foreach ($form_state['values']['my_items'] as $item) {
db_update('search_autocomplete_forms')
->fields(array(
'weight' => $item['weight'],
'parent_fid' => $item['parent_fid'],
'enabled' => $item['enabled'],
))
->condition('fid', $item['fid'])
->execute();
}
variable_set('sa_translite', $form_state['values']['translite']);
variable_set('sa_admin_helper', $form_state['values']['admin_helper']);
drupal_set_message(t('Configuration success'));
}