From 63136b81e2c73a8ea7011b7c1b9f9df3a9ba7ad6 Mon Sep 17 00:00:00 2001
From: Angie Byron <webchick@24967.no-reply.drupal.org>
Date: Mon, 30 Aug 2010 05:58:46 +0000
Subject: [PATCH] #878092 by joachim, Jacine, sun: Fixed Each module is
 outputting its own ul.links.inline in node links.

---
 modules/blog/blog.module               | 7 +------
 modules/book/book.module               | 6 +-----
 modules/comment/comment.module         | 6 +-----
 modules/node/node.module               | 2 +-
 modules/rdf/rdf.module                 | 4 ++--
 modules/statistics/statistics.module   | 9 +--------
 modules/translation/translation.module | 6 +-----
 7 files changed, 8 insertions(+), 32 deletions(-)

diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index cbde74c6da12..c9360db3e736 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -80,16 +80,11 @@ function blog_view($node, $view_mode) {
 function blog_node_view($node, $view_mode) {
   if ($view_mode != 'rss') {
     if ($node->type == 'blog' && (arg(0) != 'blog' || arg(1) != $node->uid)) {
-      $links['blog_usernames_blog'] = array(
+      $node->content['links']['#links']['blog_usernames_blog'] = array(
         'title' => t("!username's blog", array('!username' => format_username($node))),
         'href' => "blog/$node->uid",
         'attributes' => array('title' => t("Read !username's latest blog entries.", array('!username' => format_username($node)))),
       );
-      $node->content['links']['blog'] = array(
-        '#theme' => 'links__blog_node',
-        '#links' => $links,
-        '#attributes' => array('class' => array('links', 'inline')),
-      );
     }
   }
 }
diff --git a/modules/book/book.module b/modules/book/book.module
index 7ce80cd4cc91..b30acce9b888 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -112,11 +112,7 @@ function book_node_view_link($node, $view_mode) {
   }
 
   if (!empty($links)) {
-    $node->content['links']['book'] = array(
-      '#theme' => 'links__book_node',
-      '#links' => $links,
-      '#attributes' => array('class' => array('links', 'inline')),
-    );
+    $node->content['links']['#links'] = array_merge($node->content['links']['#links'], $links);
   }
 }
 
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 4a0893f5cb93..a8b8a662f839 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -688,11 +688,7 @@ function comment_node_view($node, $view_mode) {
       $links['comment_forbidden']['html'] = TRUE;
     }
 
-    $node->content['links']['comment'] = array(
-      '#theme' => 'links__comment_node',
-      '#links' => $links,
-      '#attributes' => array('class' => array('links', 'inline')),
-    );
+    $node->content['links']['#links'] = array_merge($node->content['links']['#links'], $links);
 
     // Only append comments when we are building a node on its own node detail
     // page. We compare $node and $page_node to ensure that comments are not
diff --git a/modules/node/node.module b/modules/node/node.module
index a66e55f68c44..fb8352de32d2 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1286,7 +1286,7 @@ function node_build_content($node, $view_mode = 'full') {
       'attributes' => array('rel' => 'tag', 'title' => strip_tags($node->title))
     );
   }
-  $node->content['links']['node'] = array(
+  $node->content['links'] = array(
     '#theme' => 'links__node',
     '#links' => $links,
     '#attributes' => array('class' => array('links', 'inline')),
diff --git a/modules/rdf/rdf.module b/modules/rdf/rdf.module
index e1b41c1ad8c7..27c2c8e9017e 100644
--- a/modules/rdf/rdf.module
+++ b/modules/rdf/rdf.module
@@ -503,7 +503,7 @@ function rdf_preprocess_node(&$variables) {
   // Adds RDFa markup annotating the number of comments a node has.
   if (isset($variables['node']->comment_count) && !empty($variables['node']->rdf_mapping['comment_count']['predicates'])) {
     // Annotates the 'x comments' link in teaser view.
-    if (isset($variables['content']['links']['comment']['#links']['comment-comments'])) {
+    if (isset($variables['content']['links']['#links']['comment-comments'])) {
       $comment_count_attributes['property'] = $variables['node']->rdf_mapping['comment_count']['predicates'];
       $comment_count_attributes['content'] = $variables['node']->comment_count;
       $comment_count_attributes['datatype'] = $variables['node']->rdf_mapping['comment_count']['datatype'];
@@ -513,7 +513,7 @@ function rdf_preprocess_node(&$variables) {
       // we set an empty rel attribute which triggers rule number 5. See
       // http://www.w3.org/TR/rdfa-syntax/#sec_5.5.
       $comment_count_attributes['rel'] = '';
-      $variables['content']['links']['comment']['#links']['comment-comments']['attributes'] += $comment_count_attributes;
+      $variables['content']['links']['#links']['comment-comments']['attributes'] += $comment_count_attributes;
     }
     // In full node view, the number of comments is not displayed by
     // node.tpl.php so it is expressed in RDFa in the <head> tag.
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index db54ab49c61e..e40e16fd9e5f 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -114,19 +114,12 @@ function statistics_permission() {
  */
 function statistics_node_view($node, $view_mode) {
   if ($view_mode != 'rss') {
-    $links = array();
     if (user_access('view post access counter')) {
       $statistics = statistics_get($node->nid);
       if ($statistics) {
-        $links['statistics_counter']['title'] = format_plural($statistics['totalcount'], '1 read', '@count reads');
+        $node->content['links']['#links']['statistics_counter']['title'] = format_plural($statistics['totalcount'], '1 read', '@count reads');
       }
     }
-
-    $node->content['links']['statistics'] = array(
-      '#theme' => 'links__statistics_node',
-      '#links' => $links,
-      '#attributes' => array('class' => array('links', 'inline')),
-    );
   }
 }
 
diff --git a/modules/translation/translation.module b/modules/translation/translation.module
index 0a90d115b7cd..5c9d1c440f7b 100644
--- a/modules/translation/translation.module
+++ b/modules/translation/translation.module
@@ -188,11 +188,7 @@ function translation_node_view($node, $view_mode) {
       $links = $links->links;
       // Do not show link to the same node.
       unset($links[$node->language]);
-      $node->content['links']['translation'] = array(
-        '#theme' => 'links__translation_node',
-        '#links' => $links,
-        '#attributes' => array('class' => array('links', 'inline')),
-      );
+      $node->content['links']['#links'] = array_merge($node->content['links']['#links'], $links);
     }
   }
 }
-- 
GitLab