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/node/node.module | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'modules/node/node.module') diff --git a/modules/node/node.module b/modules/node/node.module index 4c85affad..de59e22f7 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1112,6 +1112,9 @@ function node_build($node, $build_mode = 'full') { '#node' => $node, '#build_mode' => $build_mode, ); + // Add contextual links for this node. + $build['#contextual_links']['node'] = menu_contextual_links('node', array($node->nid)); + return $build; } @@ -1806,11 +1809,13 @@ function node_menu() { 'page arguments' => array(1), 'access callback' => 'node_access', 'access arguments' => array('view', 1), - 'type' => MENU_CALLBACK); + 'type' => MENU_CALLBACK, + ); $items['node/%node/view'] = array( 'title' => 'View', 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => -10); + 'weight' => -10, + ); $items['node/%node/edit'] = array( 'title' => 'Edit', 'page callback' => 'node_page_edit', @@ -1818,8 +1823,9 @@ function node_menu() { 'access callback' => 'node_access', 'access arguments' => array('update', 1), 'theme callback' => '_node_custom_theme', - 'weight' => 1, + 'weight' => 0, 'type' => MENU_LOCAL_TASK, + 'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE, 'file' => 'node.pages.inc', ); $items['node/%node/delete'] = array( @@ -1829,7 +1835,8 @@ function node_menu() { 'access callback' => 'node_access', 'access arguments' => array('delete', 1), 'weight' => 1, - 'type' => MENU_CALLBACK, + 'type' => MENU_LOCAL_TASK, + 'context' => MENU_CONTEXT_INLINE, 'file' => 'node.pages.inc', ); $items['node/%node/revisions'] = array( -- cgit v1.2.3