summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-09-17 19:09:34 +0000
committerDries Buytaert <dries@buytaert.net>2006-09-17 19:09:34 +0000
commitcb8201c337c293cc7dd7f9a25579f18d4549324b (patch)
treef5c7f7a149f37f9d1935ad594f2c588e4ccca7d8 /modules/comment/comment.module
parenta28ee0cceb976992734eeed21e61692bf3718f38 (diff)
downloadbrdo-cb8201c337c293cc7dd7f9a25579f18d4549324b.tar.gz
brdo-cb8201c337c293cc7dd7f9a25579f18d4549324b.tar.bz2
- Patch #83007 by edkwh: fixed multi-comment delete.
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module22
1 files changed, 13 insertions, 9 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 1676d0e08..5da54b2f2 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -102,8 +102,7 @@ function comment_menu($may_cache) {
'path' => 'admin/content/comment',
'title' => t('comments'),
'description' => t('List and edit site comments and the comment moderation queue.'),
- 'callback' => 'drupal_get_form',
- 'callback arguments' => array('comment_admin_overview'),
+ 'callback' => 'comment_admin',
'access' => $access
);
@@ -115,8 +114,8 @@ function comment_menu($may_cache) {
$items[] = array('path' => 'admin/content/comment/list/new', 'title' => t('published comments'),
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/content/comment/list/approval', 'title' => t('approval queue'),
- 'callback' => 'drupal_get_form',
- 'callback arguments' => array('comment_admin_overview', 'approval'),
+ 'callback' => 'comment_admin',
+ 'callback arguments' => array('approval'),
'access' => $access,
'type' => MENU_LOCAL_TASK);
@@ -1000,20 +999,25 @@ function comment_operations($action = NULL) {
/**
* Menu callback; present an administrative comment listing.
*/
-function comment_admin_overview($type = 'new') {
+function comment_admin($type = 'new') {
$edit = $_POST;
if ($edit['operation'] == 'delete') {
- return comment_multiple_delete_confirm();
+ return drupal_get_form('comment_multiple_delete_confirm');
+ }
+ else {
+ return drupal_get_form('comment_admin_overview', $type, arg(4));
}
+}
+function comment_admin_overview($type = 'new', $arg) {
// build an 'Update options' form
$form['options'] = array(
'#type' => 'fieldset', '#title' => t('Update options'),
'#prefix' => '<div class="container-inline">', '#suffix' => '</div>'
);
$options = array();
- foreach (comment_operations(arg(4) == 'approval' ? 'publish' : 'unpublish') as $key => $value) {
+ foreach (comment_operations($arg == 'approval' ? 'publish' : 'unpublish') as $key => $value) {
$options[$key] = $value[0];
}
$form['options']['operation'] = array('#type' => 'select', '#options' => $options, '#default_value' => 'publish');
@@ -1146,8 +1150,8 @@ function comment_multiple_delete_confirm() {
* Perform the actual comment deletion.
*/
function comment_multiple_delete_confirm_submit($form_id, $form_values) {
- if ($edit['confirm']) {
- foreach ($edit['comments'] as $cid => $value) {
+ if ($form_values['confirm']) {
+ foreach ($form_values['comments'] as $cid => $value) {
$comment = _comment_load($cid);
_comment_delete_thread($comment);
_comment_update_node_statistics($comment->nid);