summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-01-06 14:32:54 +0000
committerDries Buytaert <dries@buytaert.net>2010-01-06 14:32:54 +0000
commit049b9ce9fe405495052c3b40f8e5b135d29482e2 (patch)
treec36902e0429c8964aa796002f30eb7c8da9b55b6 /modules
parent4be3e772fcb03a2a75c171afb19dd55fdc170c5a (diff)
downloadbrdo-049b9ce9fe405495052c3b40f8e5b135d29482e2.tar.gz
brdo-049b9ce9fe405495052c3b40f8e5b135d29482e2.tar.bz2
- Patch #646874 by sun, David_Rothstein: more improvements.
Diffstat (limited to 'modules')
-rw-r--r--modules/node/node.module8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index b4e78e047..a5f72abcc 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1189,9 +1189,11 @@ function node_view($node, $view_mode = 'full') {
'#node' => $node,
'#view_mode' => $view_mode,
);
- // Add contextual links for this node except for 'full' view mode.
- // @todo Make this configurable per view mode.
- if ($view_mode != 'full') {
+ // Add contextual links for this node, except when the node is already being
+ // displayed on its own page. Modules may alter this behavior (for example,
+ // to restrict contextual links to certain view modes) by implementing
+ // hook_node_view_alter().
+ if (!node_is_page($node)) {
$build['#contextual_links']['node'] = array('node', array($node->nid));
}