=== modified file 'includes/theme.inc' --- includes/theme.inc +++ includes/theme.inc @@ -483,17 +483,26 @@ * Return a themed set of links. * * @param $links - * An array of links to be themed. + * A keyed array of link objects. * @param $delimiter * A string used to separate the links. * @return * A string containing the themed links. */ function theme_links($links, $delimiter = ' | ') { - if (!is_array($links)) { - return ''; - } - return implode($delimiter, $links); + $output = array(); + if (is_array($links)) { + foreach ($links as $link) { + if ($link->href) { + $output[] = l($link->title, $link->href, $link->attributes, $link->query, $link->fragment); + } + elseif ($link->title) { + //Some links are actually not links ... + $output[] = $link->title; + } + } + } + return implode($delimiter, $output); } /** === modified file 'modules/blog.module' --- modules/blog.module +++ modules/blog.module @@ -256,7 +256,9 @@ if ($type == 'node' && $node->type == 'blog') { if (arg(0) != 'blog' || arg(1) != $node->uid) { - $links[] = l(t("%username's blog", array('%username' => $node->name)), "blog/$node->uid", array('title' => t("Read %username's latest blog entries.", array('%username' => $node->name)))); + $links['blog_usernames_blog']->title = t("%username's blog", array('%username' => $node->name)); + $links['blog_usernames_blog']->href = "blog/$node->uid"; + $links['blog_usernames_blog']->attributes = array('title' => t("Read %username's latest blog entries.", array('%username' => $node->name))); } } === modified file 'modules/book.module' --- modules/book.module +++ modules/book.module @@ -58,12 +58,13 @@ if ($type == 'node' && isset($node->parent)) { if (!$main) { if (book_access('create', $node)) { - $links[] = l(t('add child page'), "node/add/book/parent/$node->nid"); + $links['book_add_child']->title = t('add child page'); + $links['book_add_child']->href = "node/add/book/parent/$node->nid"; } if (user_access('see printer-friendly version')) { - $links[] = l(t('printer-friendly version'), - 'book/export/html/'. $node->nid, - array('title' => t('Show a printer-friendly version of this book page and its sub-pages.'))); + $links['book_export_html']->title = t('printer-friendly version'); + $links['book_export_html']->href = "book/export/html/$node->nid"; + $links['book_export_html']->attributes = array('title' => t('Show a printer-friendly version of this book page and its sub-pages.')); } } } === modified file 'modules/comment.module' --- modules/comment.module +++ modules/comment.module @@ -194,19 +194,27 @@ $new = comment_num_new($node->nid); if ($all) { - $links[] = l(format_plural($all, '1 comment', '%count comments'), "node/$node->nid", array('title' => t('Jump to the first comment of this posting.')), NULL, 'comment'); + $links['comment_comments']->title = format_plural($all, '1 comment', '%count comments'); + $links['comment_comments']->href = "node/$node->nid"; + $links['comment_comments']->attributes = array('title' => t('Jump to the first comment of this posting.')); + $links['comment_comments']->fragment = 'comment'; if ($new) { - $links[] = l(format_plural($new, '1 new comment', '%count new comments'), "node/$node->nid", array('title' => t('Jump to the first new comment of this posting.')), NULL, 'new'); + $links['comment_comments_new']->title = format_plural($new, '1 new comment', '%count new comments'); + $links['comment_comments_new']->href = "node/$node->nid"; + $links['comment_comments_new']->attributes = array('title' => t('Jump to the first new comment of this posting.')); + $links['comment_comments_new']->fragment = 'new'; } } else { if ($node->comment == COMMENT_NODE_READ_WRITE) { if (user_access('post comments')) { - $links[] = l(t('add new comment'), "comment/reply/$node->nid", array('title' => t('Add a new comment to this page.'))); + $links['comment_add']->title = t('add new comment'); + $links['comment_add']->href = "comment/reply/$node->nid"; + $links['comment_add']->attributes = array('title' => t('Add a new comment to this page.')); } else { - $links[] = theme('comment_post_forbidden', $node->nid); + $links['comment_post_forbidden']->title = theme('comment_post_forbidden', $node->nid); } } } @@ -219,11 +227,14 @@ if ($node->comment == COMMENT_NODE_READ_WRITE) { if (user_access('post comments')) { if (variable_get('comment_form_location', COMMENT_FORM_SEPARATE_PAGE) == COMMENT_FORM_SEPARATE_PAGE) { - $links[] = l(t('add new comment'), "comment/reply/$node->nid", array('title' => t('Share your thoughts and opinions related to this posting.')), NULL, 'comment'); + $links['comment_add']->title = t('add new comment'); + $links['comment_add']->href = "comment/reply/$node->nid"; + $links['comment_add']->attributes = array('title' => t('Share your thoughts and opinions related to this posting.')); + $links['comment_add']->fragment = 'comment'; } } else { - $links[] = theme('comment_post_forbidden', $node->nid); + $links['comment_post_forbidden'] = theme('comment_post_forbidden', $node->nid); } } } @@ -654,23 +665,30 @@ // If we are viewing just this comment, we link back to the node. if ($return) { - $links[] = l(t('parent'), comment_node_url(), NULL, NULL, "comment-$comment->cid"); + $links['comment_parent']->title = t('parent'); + $links['comment_parent']->href = comment_node_url(); + $links['comment_parent']->fragment = "comment-$comment->cid"; } if (node_comment_mode($comment->nid) == COMMENT_NODE_READ_WRITE) { if (user_access('administer comments') && user_access('post comments')) { - $links[] = l(t('delete'), "comment/delete/$comment->cid"); - $links[] = l(t('edit'), "comment/edit/$comment->cid"); - $links[] = l(t('reply'), "comment/reply/$comment->nid/$comment->cid"); + $links['comment_delete']->title = t('delete'); + $links['comment_delete']->href = "comment/delete/$comment->cid"; + $links['comment_edit']->title = t('edit'); + $links['comment_edit']->href = "comment/edit/$comment->cid"; + $links['comment_reply']->title = t('reply'); + $links['comment_reply']->href = "comment/reply/$comment->nid/$comment->cid"; } else if (user_access('post comments')) { if (comment_access('edit', $comment)) { - $links[] = l(t('edit'), "comment/edit/$comment->cid"); - } - $links[] = l(t('reply'), "comment/reply/$comment->nid/$comment->cid"); + $links['comment_edit']->title = t('edit'); + $links['comment_edit']->href = "comment/edit/$comment->cid"; + } + $links['comment_reply']->title = t('reply'); + $links['comment_reply']->href = "comment/reply/$comment->cid"; } else { - $links[] = theme('comment_post_forbidden', $comment->nid); + $links['comment_post_forbidden'] = theme('comment_post_forbidden', $comment->nid); } } === modified file 'modules/node.module' --- modules/node.module +++ modules/node.module @@ -847,7 +847,9 @@ } if ($main == 1 && $node->teaser && $node->readmore) { - $links[] = l(t('read more'), "node/$node->nid", array('title' => t('Read the rest of this posting.'), 'class' => 'read-more')); + $links['node_read_more']->title = t('read more'); + $links['node_read_more']->href = "node/$node->nid"; + $links['node_read_more']->attributes = array('title' => t('Read the rest of this posting.'), 'class' => 'read-more'); } } === modified file 'modules/statistics.module' --- modules/statistics.module +++ modules/statistics.module @@ -99,7 +99,7 @@ if ($type != 'comment' && user_access('view post access counter')) { $statistics = statistics_get($node->nid); if ($statistics) { - $links[] = format_plural($statistics['totalcount'], '1 read', '%count reads'); + $links['statistics_counter']->title = format_plural($statistics['totalcount'], '1 read', '%count reads'); } } === modified file 'modules/taxonomy.module' --- modules/taxonomy.module +++ modules/taxonomy.module @@ -29,7 +29,8 @@ $links = array(); if (array_key_exists('taxonomy', $node)) { foreach ($node->taxonomy as $term) { - $links[] = l($term->name, taxonomy_term_path($term), array('rel' => 'tag', 'title' => $term->description)); + $links['taxonomy_term_'. $tid]->title = $term->name; + $links['taxonomy_term_'. $tid]->href = taxonomy_term_path($term); } } return $links; === modified file 'modules/upload.module' --- modules/upload.module +++ modules/upload.module @@ -52,7 +52,10 @@ } } if ($num_files) { - $links[] = l(format_plural($num_files, '1 attachment', '%count attachments'), "node/$node->nid", array('title' => t('Read full article to view attachments.')), NULL, 'attachments'); + $links['upload_attachments']->title = format_plural($num_files, '1 attachment', '%count attachments'); + $links['upload_attachments']->href = "node/$node->nid"; + $links['upload_attachments']->attributes = array('title' => t('Read full article to view attachments.')); + $links['upload_attachments']->fragment = 'attachments'; } }