From 4278afa16bb46819975f95fe91021edcb852ca47 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 17 Oct 2009 05:50:29 +0000 Subject: =?UTF-8?q?#473268=20by=20David=5FRothstein,=20sun,=20yoroy,=20G?= =?UTF-8?q?=C3=A1bor=20Hojtsy,=20cwgordon7,=20et=20al.:=20Allow=20contextu?= =?UTF-8?q?al=20editing=20of=20dang=20near=20everything=20on=20the=20page.?= =?UTF-8?q?=20Also=20adds=20a=20context=20system=20to=20menu=20local=20tas?= =?UTF-8?q?ks.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/comment/comment.module | 5 +++++ modules/comment/comment.tpl.php | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'modules/comment') 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 @@ */ ?>
> + + + + -- cgit v1.2.3