function comment_operations
6.x comment.module | comment_operations($action = NULL) |
Comment operations. We offer different update operations depending on which comment administration page we're on.
Parameters
$action: The comment administration page.
Return value
An associative array containing the offered operations.
2 calls to comment_operations()
- comment_admin_overview in drupal-6.x/
modules/ comment/ comment.admin.inc - Form builder; Builds the comment overview form for the admin.
- comment_admin_overview_submit in drupal-6.x/
modules/ comment/ comment.admin.inc - Process comment_admin_overview form submissions.
File
- drupal-6.x/
modules/ comment/ comment.module, line 1070 - Enables users to comment on published content.
Code
function comment_operations($action = NULL) {
if ($action == 'publish') {
$operations = array(
'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = ' . COMMENT_PUBLISHED . ' WHERE cid = %d'),
'delete' => array(t('Delete the selected comments'), ''),
);
}
else if ($action == 'unpublish') {
$operations = array(
'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = ' . COMMENT_NOT_PUBLISHED . ' WHERE cid = %d'),
'delete' => array(t('Delete the selected comments'), ''),
);
}
else {
$operations = array(
'publish' => array(t('Publish the selected comments'), 'UPDATE {comments} SET status = ' . COMMENT_PUBLISHED . ' WHERE cid = %d'),
'unpublish' => array(t('Unpublish the selected comments'), 'UPDATE {comments} SET status = ' . COMMENT_NOT_PUBLISHED . ' WHERE cid = %d'),
'delete' => array(t('Delete the selected comments'), ''),
);
}
return $operations;
}