You are here

function search_autocomplete_treelist_form_submit in Search Autocomplete 7.2

Same name and namespace in other branches
  1. 6.4 search_autocomplete.form.treelist.inc \search_autocomplete_treelist_form_submit()
  2. 6.2 search_autocomplete.form.treelist.inc \search_autocomplete_treelist_form_submit()
  3. 7.4 search_autocomplete.form.treelist.inc \search_autocomplete_treelist_form_submit()
  4. 7.3 search_autocomplete.form.treelist.inc \search_autocomplete_treelist_form_submit()

Implementation of hook_submit(). Save the changes in the database

File

./search_autocomplete.form.treelist.inc, line 84
Search Autocomplete Display the list of form to autocomplete and themis 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();
  }
  drupal_set_message(t('Configuration success'));
}