You are here

function flag_lists_template_submit in Flag Lists 6

Same name and namespace in other branches
  1. 7.3 flag_lists.module \flag_lists_template_submit()
  2. 7 flag_lists.module \flag_lists_template_submit()
1 string reference to 'flag_lists_template_submit'
flag_lists_form_alter in ./flag_lists.module
Implementation of hook_form_alter().

File

./flag_lists.module, line 302
The Flag Lists module.

Code

function flag_lists_template_submit($form, &$form_state) {
  $types = array_filter($form_state['values']['types']);

  // Clean out the old types, then add the new.
  db_query("DELETE FROM {flag_lists_types} WHERE name = '%s'", $form_state['values']['name']);
  foreach ($types as $type) {
    db_query("INSERT INTO {flag_lists_types} (name, type) VALUES ('%s', '%s')", $form_state['values']['name'], $type);
  }
}