Index: project.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project/project.inc,v
retrieving revision 1.120
diff -u -F^f -u -F^f -r1.120 project.inc
--- project.inc	13 Nov 2007 01:27:54 -0000	1.120
+++ project.inc	8 Feb 2008 07:29:50 -0000
@@ -288,10 +288,13 @@ function project_project_view($node, $te
 
     foreach (array('homepage' => t('Home page'), 'documentation' => t('Read documentation'), 'license' => t('Read license'), 'changelog' => t('Read complete log of changes'), 'demo' => t('Try out a demonstration'), 'screenshots' => t('Look at screenshots')) as $uri => $name) {
       if (!empty($node->$uri)) {
-        $links[] = l($name, $node->$uri);
+        $links[$uri] = l($name, $node->$uri);
       }
     }
 
+    // Allow other modules to add links to the resources section.
+    project_page_link_alter($links, 'resources');
+
     if ($links) {
       $node->content['resources'] = array(
         '#value' => theme('item_list', $links, t('Resources')),
@@ -307,20 +310,23 @@ function project_project_view($node, $te
     // Support section.
     $links = array();
     if ($view_issues) {
-      $links[] = l(t('View all support requests'), 'project/issues/'. $node->uri, null, 'categories=support&states=all', null);
-      $links[] = l(t('View pending support requests'), 'project/issues/'. $node->uri, null, 'categories=support', null);
-      $links[] = l(t('View pending bug reports'), 'project/issues/'. $node->uri, null, 'categories=bug', null);
-      $links[] = l(t('View pending feature requests'), 'project/issues/'. $node->uri, null, 'categories=feature', null);
+      $links['all_support'] = l(t('View all support requests'), 'project/issues/'. $node->uri, null, 'categories=support&states=all', null);
+      $links['pending_support'] = l(t('View pending support requests'), 'project/issues/'. $node->uri, null, 'categories=support', null);
+      $links['pending_bugs'] = l(t('View pending bug reports'), 'project/issues/'. $node->uri, null, 'categories=bug', null);
+      $links['pending_features'] = l(t('View pending feature requests'), 'project/issues/'. $node->uri, null, 'categories=feature', null);
     }
     if ($make_issues) {
-      $links[] = l(t('Request support'), 'node/add/project_issue/'. $node->uri .'/support');
-      $links[] = l(t('Report new bug'), 'node/add/project_issue/'. $node->uri .'/bug');
-      $links[] = l(t('Request new feature'), 'node/add/project_issue/'. $node->uri .'/feature');
+      $links['request_support'] = l(t('Request support'), 'node/add/project_issue/'. $node->uri .'/support');
+      $links['report_bug'] = l(t('Report new bug'), 'node/add/project_issue/'. $node->uri .'/bug');
+      $links['request_feature'] = l(t('Request new feature'), 'node/add/project_issue/'. $node->uri .'/feature');
     }
     else {
-      $links[] = theme('project_issue_create_forbidden', $node->uri);
+      $links['create_forbidden'] = theme('project_issue_create_forbidden', $node->uri);
     }
 
+    // Allow other modules to add links to the support section.
+    project_page_link_alter($links, 'support');
+
     if ($links) {
       $node->content['support'] = array(
         '#value' => theme('item_list', $links, t('Support')),
@@ -331,20 +337,23 @@ function project_project_view($node, $te
     // Developer section
     $links = array();
     if ($view_issues) {
-      $links[] = l(t('View pending patches'), 'project/issues/'. $node->uri, null, 'states=8,13,14', null);
-      $links[] = l(t('View available tasks'), 'project/issues/'. $node->uri, null, 'categories=task', null);
-      $links[] = l(t('View all pending issues'), 'project/issues/'. $node->uri);
+      $links['pending_patches'] = l(t('View pending patches'), 'project/issues/'. $node->uri, null, 'states=8,13,14', null);
+      $links['available_tasks'] = l(t('View available tasks'), 'project/issues/'. $node->uri, null, 'categories=task', null);
+      $links['pending_issues'] = l(t('View all pending issues'), 'project/issues/'. $node->uri);
     }
 
     if ($node->cvs) {
-      $links[] = l(t('Browse the CVS repository'), $node->cvs);
+      $links['browse_repository'] = l(t('Browse the CVS repository'), $node->cvs);
     }
 
     if (project_use_cvs($node)) {
-      $links[] = l(t('View CVS messages'), 'project/cvs/'. $node->nid);
-      $links[] = l(t('Developers'), 'project/developers/'. $node->nid);
+      $links['view_cvs_messages'] = l(t('View CVS messages'), 'project/cvs/'. $node->nid);
+      $links['developers'] = l(t('Developers'), 'project/developers/'. $node->nid);
     }
 
+    // Allow other modules to add links to the developer section.
+    project_page_link_alter($links, 'development');
+
     if ($links) {
       $node->content['development'] = array(
         '#value' => theme('item_list', $links, t('Development')),
@@ -522,3 +531,18 @@ function _project_save_taxonomy(&$node) 
 function _project_db_save_taxonomy($nid, $tid) {
   db_query('INSERT INTO {term_node} (nid, tid) VALUES (%d, %d)', $nid, $tid);
 }
+
+/**
+ * Allow modules to alter the project page links.
+ *
+ * @param $links
+ *   An array of links.
+ * @param $section
+ *   The link section of the project page.
+ */
+function project_page_link_alter(&$links, $section) {
+  foreach (module_implements('project_page_link_alter') as $module) {
+  	$function = $module .'_project_page_link_alter';
+  	$function($links, $section);
+  }
+}
