summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/comment.module5
-rw-r--r--modules/comment/comment.tpl.php5
2 files changed, 10 insertions, 0 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 9588633ea..ff88f6635 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -185,6 +185,7 @@ function comment_menu() {
'access callback' => 'comment_access',
'access arguments' => array('edit', 1),
'type' => MENU_LOCAL_TASK,
+ 'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
'weight' => 0,
);
$items['comment/%comment/approve'] = array(
@@ -193,6 +194,7 @@ function comment_menu() {
'page arguments' => array(1),
'access arguments' => array('administer comments'),
'type' => MENU_LOCAL_TASK,
+ 'context' => MENU_CONTEXT_INLINE,
'file' => 'comment.pages.inc',
'weight' => 1,
);
@@ -202,6 +204,7 @@ function comment_menu() {
'page arguments' => array('comment_confirm_delete', 1),
'access arguments' => array('administer comments'),
'type' => MENU_LOCAL_TASK,
+ 'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
'file' => 'comment.admin.inc',
'weight' => 2,
);
@@ -794,6 +797,8 @@ function comment_build($comment, $node, $build_mode = 'full') {
'#node' => $node,
'#build_mode' => $build_mode,
);
+ // Add contextual links for this comment.
+ $build['#contextual_links']['comment'] = menu_contextual_links('comment', array($comment->cid));
$prefix = '';
$is_threaded = isset($comment->divs) && variable_get('comment_default_mode_' . $node->type, COMMENT_MODE_THREADED) == COMMENT_MODE_THREADED;
diff --git a/modules/comment/comment.tpl.php b/modules/comment/comment.tpl.php
index 7b489aade..2777b3eda 100644
--- a/modules/comment/comment.tpl.php
+++ b/modules/comment/comment.tpl.php
@@ -19,6 +19,7 @@
* - $status: Comment status. Possible values are:
* comment-unpublished, comment-published or comment-preview.
* - $title: Linked title.
+ * - $contextual_links (array): An array of contextual links for the comment.
* - $classes: String of classes that can be used to style contextually through
* CSS. It can be manipulated through the variable $classes_array from
* preprocess functions. The default values can be one or more of the following:
@@ -46,6 +47,10 @@
*/
?>
<div class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
+ <?php if ($contextual_links): ?>
+ <?php print render($contextual_links); ?>
+ <?php endif; ?>
+
<?php print $picture ?>
<?php if ($new): ?>