Index: modules/book/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.module,v retrieving revision 1.550 diff -u -p -r1.550 book.module --- modules/book/book.module 30 Aug 2010 05:58:46 -0000 1.550 +++ modules/book/book.module 30 Aug 2010 13:51:43 -0000 @@ -85,38 +85,6 @@ function book_permission() { } /** - * Inject links into $node as needed. - */ -function book_node_view_link($node, $view_mode) { - $links = array(); - - if (isset($node->book['depth'])) { - if ($view_mode == 'full' && node_is_page($node)) { - $child_type = variable_get('book_child_type', 'book'); - if ((user_access('add content to books') || user_access('administer book outlines')) && node_access('create', $child_type) && $node->status == 1 && $node->book['depth'] < MENU_MAX_DEPTH) { - $links['book_add_child'] = array( - 'title' => t('Add child page'), - 'href' => 'node/add/' . str_replace('_', '-', $child_type), - 'query' => array('parent' => $node->book['mlid']), - ); - } - - if (user_access('access printer-friendly version')) { - $links['book_printer'] = array( - 'title' => t('Printer-friendly version'), - 'href' => 'book/export/html/' . $node->nid, - 'attributes' => array('title' => t('Show a printer-friendly version of this book page and its sub-pages.')) - ); - } - } - } - - if (!empty($links)) { - $node->content['links']['#links'] = array_merge($node->content['links']['#links'], $links); - } -} - -/** * Implements hook_menu(). */ function book_menu() { @@ -806,10 +774,27 @@ function book_node_view($node, $view_mod '#weight' => 100, ); } - } - - if ($view_mode != 'rss') { - book_node_view_link($node, $view_mode); + if (node_is_page($node) && isset($node->book['depth'])) { + $child_type = variable_get('book_child_type', 'book'); + if ((user_access('add content to books') || user_access('administer book outlines')) && node_access('create', $child_type) && $node->status == 1 && $node->book['depth'] < MENU_MAX_DEPTH) { + $node->content['links']['#links']['book_add_child'] = array( + 'title' => t('Add child page'), + 'href' => 'node/add/' . strtr($child_type, '_', '-'), + 'query' => array( + 'parent' => $node->book['mlid'], + ), + ); + } + if (user_access('access printer-friendly version')) { + $node->content['links']['#links']['book_print'] = array( + 'title' => t('Printer-friendly version'), + 'href' => 'book/export/html/' . $node->nid, + 'attributes' => array( + 'title' => t('Show a printer-friendly version of this book page and its sub-pages.'), + ), + ); + } + } } } Index: modules/comment/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v retrieving revision 1.893 diff -u -p -r1.893 comment.module --- modules/comment/comment.module 30 Aug 2010 05:58:46 -0000 1.893 +++ modules/comment/comment.module 30 Aug 2010 13:54:46 -0000 @@ -620,7 +620,7 @@ function comment_node_view($node, $view_ // is open to new comments, and there currently are none. if (user_access('access comments')) { if (!empty($node->comment_count)) { - $links['comment-comments'] = array( + $links['comment_comments'] = array( 'title' => format_plural($node->comment_count, '1 comment', '@count comments'), 'href' => "node/$node->nid", 'attributes' => array('title' => t('Jump to the first comment of this posting.')), @@ -630,7 +630,7 @@ function comment_node_view($node, $view_ $new = comment_num_new($node->nid); if (!$new) { - $links['comment-new-comments'] = array( + $links['comment_new_comments'] = array( 'title' => format_plural($new, '1 new comment', '@count new comments'), 'href' => "node/$node->nid", 'query' => comment_new_page_count($node->comment_count, $new, $node), @@ -643,7 +643,7 @@ function comment_node_view($node, $view_ else { if ($node->comment == COMMENT_NODE_OPEN) { if (user_access('post comments')) { - $links['comment-add'] = array( + $links['comment_add'] = array( 'title' => t('Add new comment'), 'href' => "comment/reply/$node->nid", 'attributes' => array('title' => t('Add a new comment to this page.')), @@ -665,17 +665,17 @@ function comment_node_view($node, $view_ // indexing. if ($node->comment == COMMENT_NODE_OPEN) { if (user_access('post comments')) { - $links['comment-add'] = array( + $links['comment_add'] = array( 'title' => t('Add new comment'), 'attributes' => array('title' => t('Share your thoughts and opinions related to this posting.')), 'fragment' => 'comment-form', 'html' => TRUE, ); if (variable_get('comment_form_location_' . $node->type, COMMENT_FORM_BELOW) == COMMENT_FORM_SEPARATE_PAGE) { - $links['comment-add']['href'] = "comment/reply/$node->nid"; + $links['comment_add']['href'] = "comment/reply/$node->nid"; } else { - $links['comment-add']['href'] = "node/$node->nid"; + $links['comment_add']['href'] = "node/$node->nid"; } } else { @@ -688,7 +688,7 @@ function comment_node_view($node, $view_ $links['comment_forbidden']['html'] = TRUE; } - $node->content['links']['#links'] = array_merge($node->content['links']['#links'], $links); + $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 Index: modules/rdf/rdf.module =================================================================== RCS file: /cvs/drupal/drupal/modules/rdf/rdf.module,v retrieving revision 1.44 diff -u -p -r1.44 rdf.module --- modules/rdf/rdf.module 30 Aug 2010 05:58:46 -0000 1.44 +++ modules/rdf/rdf.module 30 Aug 2010 13:53:29 -0000 @@ -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']['#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']['#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 tag. Index: modules/rdf/rdf.test =================================================================== RCS file: /cvs/drupal/drupal/modules/rdf/rdf.test,v retrieving revision 1.26 diff -u -p -r1.26 rdf.test --- modules/rdf/rdf.test 5 Aug 2010 23:53:38 -0000 1.26 +++ modules/rdf/rdf.test 30 Aug 2010 13:53:53 -0000 @@ -438,7 +438,7 @@ class RdfCommentAttributesTestCase exten // Tests number of comments in teaser view. $this->drupalGet('node'); - $comment_count_teaser = $this->xpath('//div[contains(@typeof, "sioc:Item")]//li[contains(@class, "comment-comments")]/a[contains(@property, "sioc:num_replies") and contains(@content, "2") and @datatype="xsd:integer"]'); + $comment_count_teaser = $this->xpath('//div[contains(@typeof, "sioc:Item")]//li[contains(@class, "comment_comments")]/a[contains(@property, "sioc:num_replies") and contains(@content, "2") and @datatype="xsd:integer"]'); $this->assertTrue(!empty($comment_count_teaser), t('RDFa markup for the number of comments found on teaser view.')); $comment_count_link = $this->xpath('//div[@about=:url]//a[contains(@property, "sioc:num_replies") and @rel=""]', array(':url' => url("node/{$this->node1->nid}"))); $this->assertTrue(!empty($comment_count_link), t('Empty rel attribute found in comment count link.')); Index: themes/bartik/templates/node.tpl.php =================================================================== RCS file: /cvs/drupal/drupal/themes/bartik/templates/node.tpl.php,v retrieving revision 1.1 diff -u -p -r1.1 node.tpl.php --- themes/bartik/templates/node.tpl.php 6 Jul 2010 05:25:51 -0000 1.1 +++ themes/bartik/templates/node.tpl.php 30 Aug 2010 13:54:51 -0000 @@ -110,7 +110,7 @@ // Remove the "Add new comment" link on the teaser page or if the comment // form is being displayed on the same page. if ($teaser || !empty($content['comments']['comment_form'])) { - unset($content['links']['comment']['#links']['comment-add']); + unset($content['links']['comment']['#links']['comment_add']); } // Only display the wrapper div if there are links. $links = render($content['links']);