Commit 26d71a67 authored by webchick's avatar webchick

#592704 by BarisW and Mike Wacker: Display number of unapproved comments in...

#592704 by BarisW and Mike Wacker: Display number of unapproved comments in the approval queue menu item.
parent 2a7c4031
......@@ -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,
......@@ -218,6 +219,16 @@ function comment_menu() {
return $items;
}
/**
* 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().
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment