summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index baf5b2e85..b9b7cd18c 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -170,7 +170,8 @@ function comment_menu() {
'weight' => -10,
);
$items['admin/content/comment/approval'] = array(
- 'title' => 'Approval queue',
+ 'title' => 'Unapproved comments',
+ 'title callback' => 'comment_count_unpublished',
'page arguments' => array('approval'),
'access arguments' => array('administer comments'),
'type' => MENU_LOCAL_TASK,
@@ -219,6 +220,16 @@ function comment_menu() {
}
/**
+ * Returns a menu title which includes the number of unapproved comments.
+ */
+function comment_count_unpublished() {
+ $count = db_query('SELECT COUNT(cid) FROM {comment} WHERE status = :status', array(
+ ':status' => COMMENT_NOT_PUBLISHED,
+ ))->fetchField();
+ return t('Unapproved comments (@count)', array('@count' => $count));
+}
+
+/**
* Implement hook_node_type_insert().
*/
function comment_node_type_insert($info) {