You are here

function flag_confirm in Flag 6

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

Form for confirming the (un)flagging of a piece of content.

1 string reference to 'flag_confirm'
flag_menu in ./flag.module
Implementation of hook_menu().

File

./flag.module, line 503

Code

function flag_confirm(&$form_state, $action = 'flag', $flag_name, $content_id = '') {
  $form = array();
  $form['action'] = array(
    '#type' => 'value',
    '#value' => $action,
  );
  $form['flag_name'] = array(
    '#type' => 'value',
    '#value' => $flag_name,
  );
  $form['content_id'] = array(
    '#type' => 'value',
    '#value' => $content_id,
  );
  $flag = flag_get_flag($flag_name);
  $question = $flag
    ->get_label($action . '_confirmation', $content_id);
  $path = isset($_GET['destination']) ? $_GET['destination'] : '<front>';
  $yes = $flag
    ->get_label($action . '_short', $content_id);
  return confirm_form($form, $question, $path, '', $yes);
}