Commit 7cd9bebc authored by Dries's avatar Dries
Browse files

- Patch #775220 by aspilicious, droplet: no underscore in CSS class name.

parent 25da67d4
......@@ -606,7 +606,7 @@ function comment_node_view($node, $view_mode) {
// 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.')),
......@@ -615,8 +615,8 @@ function comment_node_view($node, $view_mode) {
);
$new = comment_num_new($node->nid);
if ($new) {
$links['comment_new_comments'] = array(
if (!$new) {
$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),
......@@ -629,7 +629,7 @@ function comment_node_view($node, $view_mode) {
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.')),
......@@ -651,17 +651,17 @@ function comment_node_view($node, $view_mode) {
// 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 {
......@@ -984,23 +984,23 @@ function comment_links($comment, $node) {
$links = array();
if ($node->comment == COMMENT_NODE_OPEN) {
if (user_access('administer comments') && user_access('post comments')) {
$links['comment_delete'] = array(
$links['comment-delete'] = array(
'title' => t('delete'),
'href' => "comment/$comment->cid/delete",
'html' => TRUE,
);
$links['comment_edit'] = array(
$links['comment-edit'] = array(
'title' => t('edit'),
'href' => "comment/$comment->cid/edit",
'html' => TRUE,
);
$links['comment_reply'] = array(
$links['comment-reply'] = array(
'title' => t('reply'),
'href' => "comment/reply/$comment->nid/$comment->cid",
'html' => TRUE,
);
if ($comment->status == COMMENT_NOT_PUBLISHED) {
$links['comment_approve'] = array(
$links['comment-approve'] = array(
'title' => t('approve'),
'href' => "comment/$comment->cid/approve",
'html' => TRUE,
......@@ -1010,13 +1010,13 @@ function comment_links($comment, $node) {
}
elseif (user_access('post comments')) {
if (comment_access('edit', $comment)) {
$links['comment_edit'] = array(
$links['comment-edit'] = array(
'title' => t('edit'),
'href' => "comment/$comment->cid/edit",
'html' => TRUE,
);
}
$links['comment_reply'] = array(
$links['comment-reply'] = array(
'title' => t('reply'),
'href' => "comment/reply/$comment->nid/$comment->cid",
'html' => TRUE,
......
......@@ -1146,7 +1146,7 @@ class CommentRdfaTestCase extends CommentHelperCase {
// 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.'));
// Tests number of comments in full node view.
......
......@@ -502,7 +502,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']['comment']['#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'];
......@@ -512,7 +512,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']['comment']['#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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment