Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
cb8201c3
Commit
cb8201c3
authored
Sep 17, 2006
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#83007
by edkwh: fixed multi-comment delete.
parent
a28ee0cc
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/comment/comment.module
+13
-9
13 additions, 9 deletions
modules/comment/comment.module
with
13 additions
and
9 deletions
modules/comment/comment.module
+
13
−
9
View file @
cb8201c3
...
@@ -102,8 +102,7 @@ function comment_menu($may_cache) {
...
@@ -102,8 +102,7 @@ function comment_menu($may_cache) {
'path'
=>
'admin/content/comment'
,
'path'
=>
'admin/content/comment'
,
'title'
=>
t
(
'comments'
),
'title'
=>
t
(
'comments'
),
'description'
=>
t
(
'List and edit site comments and the comment moderation queue.'
),
'description'
=>
t
(
'List and edit site comments and the comment moderation queue.'
),
'callback'
=>
'drupal_get_form'
,
'callback'
=>
'comment_admin'
,
'callback arguments'
=>
array
(
'comment_admin_overview'
),
'access'
=>
$access
'access'
=>
$access
);
);
...
@@ -115,8 +114,8 @@ function comment_menu($may_cache) {
...
@@ -115,8 +114,8 @@ function comment_menu($may_cache) {
$items
[]
=
array
(
'path'
=>
'admin/content/comment/list/new'
,
'title'
=>
t
(
'published comments'
),
$items
[]
=
array
(
'path'
=>
'admin/content/comment/list/new'
,
'title'
=>
t
(
'published comments'
),
'type'
=>
MENU_DEFAULT_LOCAL_TASK
,
'weight'
=>
-
10
);
'type'
=>
MENU_DEFAULT_LOCAL_TASK
,
'weight'
=>
-
10
);
$items
[]
=
array
(
'path'
=>
'admin/content/comment/list/approval'
,
'title'
=>
t
(
'approval queue'
),
$items
[]
=
array
(
'path'
=>
'admin/content/comment/list/approval'
,
'title'
=>
t
(
'approval queue'
),
'callback'
=>
'
drupal_get_form
'
,
'callback'
=>
'
comment_admin
'
,
'callback arguments'
=>
array
(
'comment_admin_overview'
,
'approval'
),
'callback arguments'
=>
array
(
'approval'
),
'access'
=>
$access
,
'access'
=>
$access
,
'type'
=>
MENU_LOCAL_TASK
);
'type'
=>
MENU_LOCAL_TASK
);
...
@@ -1000,20 +999,25 @@ function comment_operations($action = NULL) {
...
@@ -1000,20 +999,25 @@ function comment_operations($action = NULL) {
/**
/**
* Menu callback; present an administrative comment listing.
* Menu callback; present an administrative comment listing.
*/
*/
function
comment_admin
_overview
(
$type
=
'new'
)
{
function
comment_admin
(
$type
=
'new'
)
{
$edit
=
$_POST
;
$edit
=
$_POST
;
if
(
$edit
[
'operation'
]
==
'delete'
)
{
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
// build an 'Update options' form
$form
[
'options'
]
=
array
(
$form
[
'options'
]
=
array
(
'#type'
=>
'fieldset'
,
'#title'
=>
t
(
'Update options'
),
'#type'
=>
'fieldset'
,
'#title'
=>
t
(
'Update options'
),
'#prefix'
=>
'<div class="container-inline">'
,
'#suffix'
=>
'</div>'
'#prefix'
=>
'<div class="container-inline">'
,
'#suffix'
=>
'</div>'
);
);
$options
=
array
();
$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
];
$options
[
$key
]
=
$value
[
0
];
}
}
$form
[
'options'
][
'operation'
]
=
array
(
'#type'
=>
'select'
,
'#options'
=>
$options
,
'#default_value'
=>
'publish'
);
$form
[
'options'
][
'operation'
]
=
array
(
'#type'
=>
'select'
,
'#options'
=>
$options
,
'#default_value'
=>
'publish'
);
...
@@ -1146,8 +1150,8 @@ function comment_multiple_delete_confirm() {
...
@@ -1146,8 +1150,8 @@ function comment_multiple_delete_confirm() {
* Perform the actual comment deletion.
* Perform the actual comment deletion.
*/
*/
function
comment_multiple_delete_confirm_submit
(
$form_id
,
$form_values
)
{
function
comment_multiple_delete_confirm_submit
(
$form_id
,
$form_values
)
{
if
(
$
edit
[
'confirm'
])
{
if
(
$
form_values
[
'confirm'
])
{
foreach
(
$
edit
[
'comments'
]
as
$cid
=>
$value
)
{
foreach
(
$
form_values
[
'comments'
]
as
$cid
=>
$value
)
{
$comment
=
_comment_load
(
$cid
);
$comment
=
_comment_load
(
$cid
);
_comment_delete_thread
(
$comment
);
_comment_delete_thread
(
$comment
);
_comment_update_node_statistics
(
$comment
->
nid
);
_comment_update_node_statistics
(
$comment
->
nid
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment