function heartbeat_comments_delete_confirm_submit in Heartbeat 7
Same name and namespace in other branches
- 6.4 modules/heartbeat_comments/heartbeat_comments.module \heartbeat_comments_delete_confirm_submit()
Submit callback te delete a heartbeat comment.
_state
Parameters
$form:
File
- modules/
heartbeat_comments/ heartbeat_comments.module, line 1025 - Heartbeat comments for activity.
Code
function heartbeat_comments_delete_confirm_submit($form, &$form_state) {
// Make sure there is a redirect instead of delivering a page not found.
if (!isset($form_state['redirect'])) {
$form_state['redirect'] = '<front>';
}
// Set the flag so the form knows it's been executed.
$form_state['executed'] = TRUE;
//$form_state['complete'] = TRUE;
if (!empty($form_state['id'])) {
// Delete the comment.
if (!$form_state['is_node']) {
_heartbeat_comments_delete($form_state['id']);
}
else {
comment_delete($form_state['id']);
}
}
// @todo Make uaid somehow available here.
//if (variable_get('heartbeat_comments_cache', 1)) {
// cache_clear_all('heartbeat:comments:'. $uaid. ':0', 'cache');
//}
//drupal_set_message('Comment deleted.');
}