Index: project.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/project/project.module,v
retrieving revision 1.306
diff -u -r1.306 project.module
--- project.module	6 Jan 2008 21:05:26 -0000	1.306
+++ project.module	17 Jan 2008 13:23:37 -0000
@@ -211,7 +211,7 @@
  * Callback for the main settings page.
  */
 function project_settings_form() {
-  $sort_methods = drupal_map_assoc(array_keys(module_invoke_all('project_sort_methods', 'methods')));
+  $sort_methods = module_invoke_all('project_sort_methods', 'methods');
 
   if (project_use_taxonomy()) {
 
@@ -349,7 +349,7 @@
         // Only use the first-level terms.
         if ($term->depth == 0) {
           $items[] = array('path' => 'project/'. $term->name,
-                           'title' => $term->name,
+                           'title' => t('@term', array('@term' => $term->name)),
                            'access' => $access,
                            'type' => MENU_NORMAL_ITEM,
                            'weight' => $term->weight,
@@ -358,7 +358,7 @@
           $term_methods = array_keys(array_filter(variable_get('project_sort_method_used_'. $term->tid, $sort_methods)));
           foreach ($term_methods as $sort_method) {
             $items[] = array('path' => 'project/' . $term->name . '/'. $sort_method,
-                 'title' => t('Browse by !sort_method', array('!sort_method' => $sort_method)),
+                 'title' => t('by @sort_method', array('@sort_method' => $sort_methods[$sort_method])),
                  'access' => $access,
                  // It's a default task if a) sort method matches default, or b) default sort isn't
                  // in the list of sort methods, and it's the first tab.
@@ -548,7 +548,13 @@
         $output .= '<p>' . filter_xss($type->description) . '</p>';
       }
 
-      $module = $sort_methods[$sort_method];
+      // Set the $module variable to the module that implements this method.
+      foreach (module_implements('project_sort_methods') as $module) {
+        if (in_array(module_invoke($module, 'project_sort_methods', 'methods'), $sort_methods)) {
+          break;
+        }
+      }
+
       // Bad sort method passed, return page not found.
       if (!isset($module)) {
         return drupal_not_found();
@@ -907,10 +913,9 @@
     // The array values are the name of the module (in this case, 'project').
     case 'methods':
       $methods = array();
-      $methods['name'] = 'project';
-      $methods['date'] = 'project';
+      $methods = array('name' => t('name'), 'date' => t('date'));
       if (project_use_taxonomy()) {
-        $methods['category'] = 'project';
+        $methods['category'] = t('category');
       }
       return $methods;
     case 'sql_settings' :

