? 813744-multisite-facets-12.patch
Index: apachesolr_multisitesearch.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr_multisitesearch/apachesolr_multisitesearch.admin.inc,v
retrieving revision 1.5
diff -u -p -r1.5 apachesolr_multisitesearch.admin.inc
--- apachesolr_multisitesearch.admin.inc	24 Jun 2010 21:27:46 -0000	1.5
+++ apachesolr_multisitesearch.admin.inc	3 Sep 2010 01:42:27 -0000
@@ -109,6 +109,20 @@ function apachesolr_multisitesearch_enab
 }
 
 /**
+ * Indicates what order the specified facets should be listed in.  This function is used in a usort
+ * invocation.
+ * @param $a
+ *   The first facet.
+ * @param $b
+ *   The second facet.
+ * @return
+ *   A signed integer that indicates which of the specified facets should come first.
+ */
+function _apachesolr_multisitesearch_sort_facets($a, $b) {
+  return strcasecmp($a['info'], $b['info']);
+}
+
+/**
  * Creates the form that allows the user to select which facets will be enabled.
  *
  * Only enabled facets are sent to solr.  Fewer enabled facets can reduce the
@@ -121,8 +135,11 @@ function apachesolr_multisitesearch_enab
   $module_facets = array();
   $module_list = array();
 
-  $module_facets['apachesolr_multisitesearch'] = apachesolr_multisitesearch_facets(TRUE);
-  $module_list['apachesolr_multisitesearch'] = 'apachesolr_multisitesearch';
+  foreach (module_implements('apachesolr_multisitesearch_facets') as $module) {
+    $module_facets[$module] = module_invoke($module, 'apachesolr_multisitesearch_facets', TRUE);
+    uasort($module_facets[$module], '_apachesolr_multisitesearch_sort_facets');
+    $module_list[$module] = $module;
+  }
 
   $enabled_facets = apachesolr_multisitesearch_enabled_facets();
   $form = array();
Index: apachesolr_multisitesearch.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/apachesolr_multisitesearch/apachesolr_multisitesearch.module,v
retrieving revision 1.11
diff -u -p -r1.11 apachesolr_multisitesearch.module
--- apachesolr_multisitesearch.module	24 Jun 2010 21:27:46 -0000	1.11
+++ apachesolr_multisitesearch.module	3 Sep 2010 01:42:27 -0000
@@ -296,7 +296,7 @@ function apachesolr_multisitesearch_bloc
   switch ($op) {
     case 'list':
       $enabled_facets = apachesolr_multisitesearch_enabled_facets('apachesolr_multisitesearch');
-      $facets = apachesolr_multisitesearch_facets();
+      $facets = apachesolr_multisitesearch_apachesolr_multisitesearch_facets();
       // Add the blocks
       $blocks = array();
       foreach ($enabled_facets as $delta => $facet_field) {
@@ -382,11 +382,11 @@ function apachesolr_multisitesearch_enab
 }
 
 /**
- * Implementation of hook_apachesolr_facets().
+ * Implementation of hook_apachesolr_multisitesearch_facets().
  *
  * Returns an array keyed by block delta.
  */
-function apachesolr_multisitesearch_facets($rebuild = FALSE) {
+function apachesolr_multisitesearch_apachesolr_multisitesearch_facets($rebuild = FALSE) {
   if (!$rebuild) {
     $cache = cache_get('apachesolr_multisitesearch:facets', 'cache_apachesolr');
     if (isset($cache->data)) {
