You are here

function flag_lists_template_submit in Flag Lists 7

Same name and namespace in other branches
  1. 6 flag_lists.module \flag_lists_template_submit()
  2. 7.3 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 618
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.
  $num_deleted = db_delete('flag_lists_types')
    ->condition('name', $form_state['values']['name'])
    ->execute();
  foreach ($types as $type) {
    db_insert('flag_lists_types')
      ->fields(array(
      'name' => $form_state['values']['name'],
      'type' => $type,
    ))
      ->execute();
  }
}