comment_operations
- Versions
- 4.7 – 7
comment_operations($action = NULL)
Comment operations. Offer different update operations depending on which comment administration page is being viewed.
Parameters
$action The comment administration page.
Return value
An associative array containing the offered operations.
Code
modules/comment/comment.module, line 1447
<?php
function comment_operations($action = NULL) {
if ($action == 'publish') {
$operations = array(
'publish' => array(t('Publish the selected comments'), db_update('comment')->fields(array( 'status' => COMMENT_PUBLISHED)) ),
'delete' => array(t('Delete the selected comments'), '')
);
}
elseif ($action == 'unpublish') {
$operations = array(
'unpublish' => array(t('Unpublish the selected comments'), db_update('comment')->fields(array( 'status' => COMMENT_NOT_PUBLISHED)) ),
'delete' => array(t('Delete the selected comments'), '')
);
}
else {
$operations = array(
'publish' => array(t('Publish the selected comments'), db_update('comment')->fields(array( 'status' => COMMENT_PUBLISHED)) ),
'unpublish' => array(t('Unpublish the selected comments'), db_update('comment')->fields(array( 'status' => COMMENT_NOT_PUBLISHED)) ),
'delete' => array(t('Delete the selected comments'), '')
);
}
return $operations;
}
?>Login or register to post comments 