You are here

function search_autocomplete_treelist_form_submit in Search Autocomplete 6.4

Same name and namespace in other branches
  1. 6.2 search_autocomplete.form.treelist.inc \search_autocomplete_treelist_form_submit()
  2. 7.4 search_autocomplete.form.treelist.inc \search_autocomplete_treelist_form_submit()
  3. 7.2 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 85
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_query('UPDATE {search_autocomplete_forms} SET weight = %d, parent_fid = %d, enabled = %d WHERE fid = %d', array(
      $item['weight'],
      $item['parent_fid'],
      $item['enabled'],
      $item['fid'],
    ));
  }
}