You are here

function flag_confirm_submit in Flag 5

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

File

./flag.module, line 490
The Flag module.

Code

function flag_confirm_submit($form_id, $form_values) {
  $action = $form_values['action'];
  $flag_name = $form_values['flag_name'];
  $content_id = $form_values['content_id'];
  $result = flag($action, $flag_name, $content_id);
  if (!$result) {
    drupal_set_message(t('You are not allowed to flag, or unflag, this content.'));
  }
  else {
    $flag = flag_get_flag($flag_name);
    drupal_set_message($flag
      ->get_label($action . '_message', $content_id));
  }
}