function flag_confirm in Flag 5
Same name and namespace in other branches
- 6.2 flag.module \flag_confirm()
- 6 flag.module \flag_confirm()
- 7.3 includes/flag.pages.inc \flag_confirm()
- 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 466 - The Flag module.
Code
function flag_confirm($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);
}