You are here

function flag_form_submit in Flag 5

Same name and namespace in other branches
  1. 8.4 flag.module \flag_form_submit()
  2. 6.2 includes/flag.admin.inc \flag_form_submit()
  3. 6 includes/flag.admin.inc \flag_form_submit()
  4. 7.3 includes/flag.admin.inc \flag_form_submit()
  5. 7.2 includes/flag.admin.inc \flag_form_submit()

Add/Edit flag form submit.

File

includes/flag.admin.inc, line 403
Contains administrative pages for creating, editing, and deleting flags.

Code

function flag_form_submit($form_id, $form_values) {
  $flag = $form_values['_flag'];
  unset($form_values['_flag']);
  $flag
    ->form_input($form_values);
  $flag
    ->save();
  $flag
    ->enable();
  drupal_set_message(t('Flag @name has been saved.', array(
    '@name' => $flag
      ->get_title(),
  )));
  _flag_clear_cache();
  return 'admin/build/flags';
}