? .DS_Store
? files
? generate-content.php
? links.patch
? modules/.DS_Store
? modules/contrib
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.295
diff -u -F^f -r1.295 theme.inc
--- includes/theme.inc	7 May 2006 00:08:36 -0000	1.295
+++ includes/theme.inc	9 May 2006 23:18:39 -0000
@@ -486,19 +486,34 @@ function theme_status_messages() {
  * Return a themed set of links.
  *
  * @param $links
- *   An array of links to be themed.
+ *   A keyed array of links to be themed.
  * @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 '';
+  $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']);
+      }
+      else if ($link['#title']) {
+        //Some links are actually not links ...
+        $output[] = $link['#title'];
+      }
+    }
   }
-  return implode($delimiter, $links);
+  
+  return implode($delimiter, $output);
 }
 
+
+
+
+
 /**
  * Return a themed image.
  *
Index: modules/blog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/blog.module,v
retrieving revision 1.247
diff -u -F^f -r1.247 blog.module
--- modules/blog.module	7 May 2006 00:08:36 -0000	1.247
+++ modules/blog.module	9 May 2006 23:18:41 -0000
@@ -249,7 +249,11 @@ function blog_link($type, $node = 0, $ma
 
   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)))
+      );
     }
   }
 
Index: modules/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book.module,v
retrieving revision 1.363
diff -u -F^f -r1.363 book.module
--- modules/book.module	7 May 2006 00:08:36 -0000	1.363
+++ modules/book.module	9 May 2006 23:18:43 -0000
@@ -58,12 +58,17 @@ function book_link($type, $node = 0, $ma
   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.'))
+        );
       }
     }
   }
Index: modules/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment.module,v
retrieving revision 1.457
diff -u -F^f -r1.457 comment.module
--- modules/comment.module	7 May 2006 00:08:36 -0000	1.457
+++ modules/comment.module	9 May 2006 23:18:46 -0000
@@ -195,19 +195,34 @@ function comment_link($type, $node = 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, 
       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
 
   // 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 {
Index: modules/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum.module,v
retrieving revision 1.330
diff -u -F^f -r1.330 forum.module
--- modules/forum.module	8 May 2006 15:16:16 -0000	1.330
+++ modules/forum.module	9 May 2006 23:18:52 -0000
@@ -635,8 +635,13 @@ function _forum_parent_select($tid, $tit
   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']);
+    }
+  }
 }
 
 /**
Index: modules/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node.module,v
retrieving revision 1.647
diff -u -F^f -r1.647 node.module
--- modules/node.module	7 May 2006 01:00:15 -0000	1.647
+++ modules/node.module	9 May 2006 23:18:54 -0000
@@ -536,6 +536,11 @@ function node_view($node, $teaser = FALS
   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, $ma
     }
 
     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.'), 'class' => 'read-more')
+      );
     }
   }
 
Index: modules/statistics.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics.module,v
retrieving revision 1.227
diff -u -F^f -r1.227 statistics.module
--- modules/statistics.module	7 May 2006 00:08:36 -0000	1.227
+++ modules/statistics.module	9 May 2006 23:18:55 -0000
@@ -99,7 +99,7 @@ function statistics_link($type, $node = 
   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');
     }
   }
 
Index: modules/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy.module,v
retrieving revision 1.280
diff -u -F^f -r1.280 taxonomy.module
--- modules/taxonomy.module	9 May 2006 14:16:49 -0000	1.280
+++ modules/taxonomy.module	9 May 2006 23:18:56 -0000
@@ -29,19 +29,22 @@ function taxonomy_link($type, $node = NU
     $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;
 }
 
 /**
Index: modules/upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload.module,v
retrieving revision 1.102
diff -u -F^f -r1.102 upload.module
--- modules/upload.module	7 May 2006 00:08:36 -0000	1.102
+++ modules/upload.module	9 May 2006 23:18:57 -0000
@@ -53,7 +53,12 @@ function upload_link($type, $node = 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'
+      );
     }
   }
 

