diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/aggregator.module | 17 | ||||
-rw-r--r-- | modules/aggregator/aggregator.module | 17 | ||||
-rw-r--r-- | modules/blog.module | 6 | ||||
-rw-r--r-- | modules/blog/blog.module | 6 | ||||
-rw-r--r-- | modules/book.module | 13 | ||||
-rw-r--r-- | modules/book/book.module | 13 | ||||
-rw-r--r-- | modules/comment.module | 74 | ||||
-rw-r--r-- | modules/comment/comment.module | 74 | ||||
-rw-r--r-- | modules/forum.module | 9 | ||||
-rw-r--r-- | modules/forum/forum.module | 9 | ||||
-rw-r--r-- | modules/node.module | 11 | ||||
-rw-r--r-- | modules/node/node.module | 11 | ||||
-rw-r--r-- | modules/statistics.module | 2 | ||||
-rw-r--r-- | modules/statistics/statistics.module | 2 | ||||
-rw-r--r-- | modules/taxonomy.module | 21 | ||||
-rw-r--r-- | modules/taxonomy/taxonomy.module | 21 | ||||
-rw-r--r-- | modules/upload.module | 7 | ||||
-rw-r--r-- | modules/upload/upload.module | 7 |
18 files changed, 250 insertions, 70 deletions
diff --git a/modules/aggregator.module b/modules/aggregator.module index 21ea91e06..da6b17fe7 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -1145,7 +1145,13 @@ function aggregator_page_sources() { } } $output .= theme('item_list', $list); - $output .= '<div class="links">'. theme('links', array(l(t('more'), 'aggregator/sources/'. $feed->fid))) ."</div>\n"; + + $link['sources'] = array( + '#title' => t('more'), + '#href' => 'aggregator/sources/'. $feed->fid + ); + + $output .= '<div class="links">'. theme('links', $link) ."</div>\n"; } $output .= theme('xml_icon', url('aggregator/opml')); $output .= '</div>'; @@ -1245,8 +1251,15 @@ function aggregator_page_categories() { } $output .= theme('item_list', $list); } - $output .= '<div class="links">'. theme('links', array(l(t('more'), 'aggregator/categories/'. $category->cid))) ."</div>\n"; + + $link['categories'] = array( + '#title' => t('more'), + '#href' => 'aggregator/categories/'. $category->cid + ); + + $output .= '<div class="links">'. theme('links', $link) ."</div>\n"; } + $output .= '</div>'; return $output; diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 21ea91e06..da6b17fe7 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -1145,7 +1145,13 @@ function aggregator_page_sources() { } } $output .= theme('item_list', $list); - $output .= '<div class="links">'. theme('links', array(l(t('more'), 'aggregator/sources/'. $feed->fid))) ."</div>\n"; + + $link['sources'] = array( + '#title' => t('more'), + '#href' => 'aggregator/sources/'. $feed->fid + ); + + $output .= '<div class="links">'. theme('links', $link) ."</div>\n"; } $output .= theme('xml_icon', url('aggregator/opml')); $output .= '</div>'; @@ -1245,8 +1251,15 @@ function aggregator_page_categories() { } $output .= theme('item_list', $list); } - $output .= '<div class="links">'. theme('links', array(l(t('more'), 'aggregator/categories/'. $category->cid))) ."</div>\n"; + + $link['categories'] = array( + '#title' => t('more'), + '#href' => 'aggregator/categories/'. $category->cid + ); + + $output .= '<div class="links">'. theme('links', $link) ."</div>\n"; } + $output .= '</div>'; return $output; diff --git a/modules/blog.module b/modules/blog.module index d1246f31c..01c5fa557 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -249,7 +249,11 @@ function blog_link($type, $node = 0, $main = 0) { 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'] = array( + '#title' => t("%username's blog", array('%username' => $node->name)), + '#href' => "blog/$node->uid", + '#attributes' => array('title' => t("Read %username's latest blog entries.", array('%username' => $node->name))) + ); } } diff --git a/modules/blog/blog.module b/modules/blog/blog.module index d1246f31c..01c5fa557 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -249,7 +249,11 @@ function blog_link($type, $node = 0, $main = 0) { 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'] = array( + '#title' => t("%username's blog", array('%username' => $node->name)), + '#href' => "blog/$node->uid", + '#attributes' => array('title' => t("Read %username's latest blog entries.", array('%username' => $node->name))) + ); } } diff --git a/modules/book.module b/modules/book.module index 8af126911..fb61ac070 100644 --- a/modules/book.module +++ b/modules/book.module @@ -58,12 +58,17 @@ function book_link($type, $node = 0, $main = 0) { 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'] = array( + '#title' => t('add child page'), + '#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_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.')) + ); } } } diff --git a/modules/book/book.module b/modules/book/book.module index 8af126911..fb61ac070 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -58,12 +58,17 @@ function book_link($type, $node = 0, $main = 0) { 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'] = array( + '#title' => t('add child page'), + '#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_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.')) + ); } } } diff --git a/modules/comment.module b/modules/comment.module index bcea6844e..5d8eeaee1 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -195,19 +195,34 @@ function comment_link($type, $node = 0, $main = 0) { $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'] = array( + '#title' => format_plural($all, '1 comment', '%count comments'), + '#href' => "node/$node->nid", + '#attributes' => array('title' => t('Jump to the first comment of this posting.')), + '#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_new_comments'] = array( + '#title' => format_plural($new, '1 new comment', '%count new comments'), + '#href' => "node/$node->nid", + '#attributes' => array('title' => t('Jump to the first new comment of this posting.')), + '#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.')), NULL, 'comment_form'); + $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.')), + '#fragment' => 'comment_form' + ); } else { - $links[] = theme('comment_post_forbidden', $node->nid); + $links['comment_forbidden']['#title'] = theme('comment_post_forbidden', $node->nid); } } } @@ -220,11 +235,16 @@ function comment_link($type, $node = 0, $main = 0) { 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_form'); + $links['comment_add'] = array( + '#title' => t('add new comment'), + '#href' => "comment/reply/$node->nid", + '#attributes' => array('title' => t('Share your thoughts and opinions related to this posting.')), + '#fragment' => 'comment_form' + ); } } else { - $links[] = theme('comment_post_forbidden', $node->nid); + $links['comment_forbidden']['#title'] = theme('comment_post_forbidden', $node->nid); } } } @@ -670,23 +690,42 @@ function comment_links($comment, $return = 1) { // 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'] = array( + '#title' => t('parent'), + '#href' => comment_node_url(), + '#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'] = array( + '#title' => t('delete'), + '#href' => "comment/delete/$comment->cid" + ); + $links['comment_edit'] = array( + '#title' => t('edit'), + '#href' => "comment/edit/$comment->cid" + ); + $links['comment_reply'] = array( + '#title' => t('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['comment_edit'] = array( + '#title' => t('edit'), + '#href' => "comment/edit/$comment->cid" + ); } - $links[] = l(t('reply'), "comment/reply/$comment->nid/$comment->cid"); + $links['comment_reply'] = array( + '#title' => t('reply'), + '#href' => "comment/reply/$comment->nid/$comment->cid" + ); } else { - $links[] = theme('comment_post_forbidden', $comment->nid); + $links['comment_forbidden']['#title'] = theme('comment_post_forbidden', $comment->nid); } } @@ -724,7 +763,14 @@ function comment_render($node, $cid = 0) { if ($comment = db_fetch_object($result)) { $comment->name = $comment->uid ? $comment->registered_name : $comment->name; - $output .= theme('comment_view', $comment, module_invoke_all('link', 'comment', $comment, 1)); + $links = module_invoke_all('link', 'comment', $comment, 1); + + foreach (module_implements('link_alter') as $module) { + $function = $module .'_link_alter'; + $function($node, $links); + } + + $output .= theme('comment_view', $comment, $links); } } else { diff --git a/modules/comment/comment.module b/modules/comment/comment.module index bcea6844e..5d8eeaee1 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -195,19 +195,34 @@ function comment_link($type, $node = 0, $main = 0) { $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'] = array( + '#title' => format_plural($all, '1 comment', '%count comments'), + '#href' => "node/$node->nid", + '#attributes' => array('title' => t('Jump to the first comment of this posting.')), + '#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_new_comments'] = array( + '#title' => format_plural($new, '1 new comment', '%count new comments'), + '#href' => "node/$node->nid", + '#attributes' => array('title' => t('Jump to the first new comment of this posting.')), + '#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.')), NULL, 'comment_form'); + $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.')), + '#fragment' => 'comment_form' + ); } else { - $links[] = theme('comment_post_forbidden', $node->nid); + $links['comment_forbidden']['#title'] = theme('comment_post_forbidden', $node->nid); } } } @@ -220,11 +235,16 @@ function comment_link($type, $node = 0, $main = 0) { 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_form'); + $links['comment_add'] = array( + '#title' => t('add new comment'), + '#href' => "comment/reply/$node->nid", + '#attributes' => array('title' => t('Share your thoughts and opinions related to this posting.')), + '#fragment' => 'comment_form' + ); } } else { - $links[] = theme('comment_post_forbidden', $node->nid); + $links['comment_forbidden']['#title'] = theme('comment_post_forbidden', $node->nid); } } } @@ -670,23 +690,42 @@ function comment_links($comment, $return = 1) { // 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'] = array( + '#title' => t('parent'), + '#href' => comment_node_url(), + '#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'] = array( + '#title' => t('delete'), + '#href' => "comment/delete/$comment->cid" + ); + $links['comment_edit'] = array( + '#title' => t('edit'), + '#href' => "comment/edit/$comment->cid" + ); + $links['comment_reply'] = array( + '#title' => t('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['comment_edit'] = array( + '#title' => t('edit'), + '#href' => "comment/edit/$comment->cid" + ); } - $links[] = l(t('reply'), "comment/reply/$comment->nid/$comment->cid"); + $links['comment_reply'] = array( + '#title' => t('reply'), + '#href' => "comment/reply/$comment->nid/$comment->cid" + ); } else { - $links[] = theme('comment_post_forbidden', $comment->nid); + $links['comment_forbidden']['#title'] = theme('comment_post_forbidden', $comment->nid); } } @@ -724,7 +763,14 @@ function comment_render($node, $cid = 0) { if ($comment = db_fetch_object($result)) { $comment->name = $comment->uid ? $comment->registered_name : $comment->name; - $output .= theme('comment_view', $comment, module_invoke_all('link', 'comment', $comment, 1)); + $links = module_invoke_all('link', 'comment', $comment, 1); + + foreach (module_implements('link_alter') as $module) { + $function = $module .'_link_alter'; + $function($node, $links); + } + + $output .= theme('comment_view', $comment, $links); } } else { diff --git a/modules/forum.module b/modules/forum.module index 6a27f6855..922df1eb0 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -635,8 +635,13 @@ function _forum_parent_select($tid, $title, $child_type) { return array('#type' => 'select', '#title' => $title, '#default_value' => $parent, '#options' => $options, '#description' => $description, '#required' => TRUE); } -function forum_term_path($term) { - return 'forum/'. $term->tid; +function forum_link_alter(&$node, &$links) { + foreach ($links AS $module => $link) { + if (strstr($module, 'taxonomy_term')) { + // Link back to the forum and not the taxonomy term page + $links[$module]['#href'] = str_replace('taxonomy/term', 'forum', $link['#href']); + } + } } /** diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 6a27f6855..922df1eb0 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -635,8 +635,13 @@ function _forum_parent_select($tid, $title, $child_type) { return array('#type' => 'select', '#title' => $title, '#default_value' => $parent, '#options' => $options, '#description' => $description, '#required' => TRUE); } -function forum_term_path($term) { - return 'forum/'. $term->tid; +function forum_link_alter(&$node, &$links) { + foreach ($links AS $module => $link) { + if (strstr($module, 'taxonomy_term')) { + // Link back to the forum and not the taxonomy term page + $links[$module]['#href'] = str_replace('taxonomy/term', 'forum', $link['#href']); + } + } } /** diff --git a/modules/node.module b/modules/node.module index fb8bd7035..3eb21d638 100644 --- a/modules/node.module +++ b/modules/node.module @@ -536,6 +536,11 @@ function node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE) { node_invoke_nodeapi($node, 'view', $teaser, $page); if ($links) { $node->links = module_invoke_all('link', 'node', $node, !$page); + + foreach (module_implements('link_alter') AS $module) { + $function = $module .'_link_alter'; + $function($node, $node->links); + } } // unset unused $node part so that a bad theme can not open a security hole if ($teaser) { @@ -810,7 +815,11 @@ function node_link($type, $node = 0, $main = 0) { } 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'] = array( + '#title' => t('read more'), + '#href' => "node/$node->nid", + '#attributes' => array('title' => t('Read the rest of this posting.')) + ); } } diff --git a/modules/node/node.module b/modules/node/node.module index fb8bd7035..3eb21d638 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -536,6 +536,11 @@ function node_view($node, $teaser = FALSE, $page = FALSE, $links = TRUE) { node_invoke_nodeapi($node, 'view', $teaser, $page); if ($links) { $node->links = module_invoke_all('link', 'node', $node, !$page); + + foreach (module_implements('link_alter') AS $module) { + $function = $module .'_link_alter'; + $function($node, $node->links); + } } // unset unused $node part so that a bad theme can not open a security hole if ($teaser) { @@ -810,7 +815,11 @@ function node_link($type, $node = 0, $main = 0) { } 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'] = array( + '#title' => t('read more'), + '#href' => "node/$node->nid", + '#attributes' => array('title' => t('Read the rest of this posting.')) + ); } } diff --git a/modules/statistics.module b/modules/statistics.module index f6510221e..67dfa7645 100644 --- a/modules/statistics.module +++ b/modules/statistics.module @@ -99,7 +99,7 @@ function statistics_link($type, $node = 0, $main = 0) { 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'); } } diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index f6510221e..67dfa7645 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -99,7 +99,7 @@ function statistics_link($type, $node = 0, $main = 0) { 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'); } } diff --git a/modules/taxonomy.module b/modules/taxonomy.module index 29ccd3ae0..d917c7511 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -29,19 +29,22 @@ function taxonomy_link($type, $node = NULL) { $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' => strip_tags($term->description))); + $links['taxonomy_term_'. $term->tid] = array( + '#title' => $term->name, + '#href' => 'taxonomy/term/'. $term->tid, + '#attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)) + ); } } - return $links; - } -} -function taxonomy_term_path($term) { - $vocabulary = taxonomy_get_vocabulary($term->vid); - if ($vocabulary->module != 'taxonomy' && $path = module_invoke($vocabulary->module, 'term_path', $term)) { - return $path; + // We call this hook again because some modules and themes call taxonomy_link('taxonomy terms') directly + foreach (module_implements('link_alter') AS $module) { + $function = $module .'_link_alter'; + $function($node, $links); + } + + return $links; } - return 'taxonomy/term/'. $term->tid; } /** diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 29ccd3ae0..d917c7511 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -29,19 +29,22 @@ function taxonomy_link($type, $node = NULL) { $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' => strip_tags($term->description))); + $links['taxonomy_term_'. $term->tid] = array( + '#title' => $term->name, + '#href' => 'taxonomy/term/'. $term->tid, + '#attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description)) + ); } } - return $links; - } -} -function taxonomy_term_path($term) { - $vocabulary = taxonomy_get_vocabulary($term->vid); - if ($vocabulary->module != 'taxonomy' && $path = module_invoke($vocabulary->module, 'term_path', $term)) { - return $path; + // We call this hook again because some modules and themes call taxonomy_link('taxonomy terms') directly + foreach (module_implements('link_alter') AS $module) { + $function = $module .'_link_alter'; + $function($node, $links); + } + + return $links; } - return 'taxonomy/term/'. $term->tid; } /** diff --git a/modules/upload.module b/modules/upload.module index c575d1d79..ca01ac700 100644 --- a/modules/upload.module +++ b/modules/upload.module @@ -53,7 +53,12 @@ function upload_link($type, $node = 0, $main = 0) { } } 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'] = array( + '#title' => format_plural($num_files, '1 attachment', '%count attachments'), + '#href' => "node/$node->nid", + '#attributes' => array('title' => t('Read full article to view attachments.')), + '#fragment' => 'attachments' + ); } } diff --git a/modules/upload/upload.module b/modules/upload/upload.module index c575d1d79..ca01ac700 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -53,7 +53,12 @@ function upload_link($type, $node = 0, $main = 0) { } } 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'] = array( + '#title' => format_plural($num_files, '1 attachment', '%count attachments'), + '#href' => "node/$node->nid", + '#attributes' => array('title' => t('Read full article to view attachments.')), + '#fragment' => 'attachments' + ); } } |