- Patch #646874 by sun, David_Rothstein: more improvements.

merge-requests/26/head
Dries Buytaert 2010-01-06 14:32:54 +00:00
parent 4be3e772fc
commit 049b9ce9fe
1 changed files with 5 additions and 3 deletions

View File

@ -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));
}