Index: drupalorg.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drupalorg/Attic/drupalorg.module,v
retrieving revision 1.66.2.34
diff -u -p -r1.66.2.34 drupalorg.module
--- drupalorg.module	29 Jul 2010 22:10:04 -0000	1.66.2.34
+++ drupalorg.module	21 Aug 2010 20:27:20 -0000
@@ -304,6 +301,58 @@ function drupalorg_form_alter(&$form, $f
   }
 }
 
+/**
+ * Implement hook_form_FORM_ID_alter() for 'project_solr_browse_projects_form'.
+ *
+ * This cleans up the UI for the navigation form when browsing projects.
+ * Handles the 'Advanced search' fieldset for themes (since we have a bunch of
+ * additional facets which make the default UI totally overwhelming).
+ */
+function drupalorg_form_project_solr_browse_projects_form_alter(&$form, $form_state) {
+  $form['api_version']['#title'] = t('Filter by Drupal core version');
+
+  $form['api_version']['#weight'] = -3;
+  $form['text']['#weight'] = -2;
+  $form['solrsort']['#weight'] = -1;
+
+  foreach (element_children($form) as $key) {
+    if (strpos($key, 'im_vid_') !== FALSE) {
+      $form[$key]['#prefix'] = '<div style="clear:both">';
+      $form[$key]['#suffix'] = '</div>';
+    }
+  }
+  $project_type_arg = arg(1);
+  if (strcasecmp($project_type_arg, 'themes') === 0) {
+    $form['advanced'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Advanced search'),
+      '#collapsible' => TRUE,
+      '#collapsed' => TRUE,
+      '#weight' => 5,
+      '#prefix' => '<div style="clear:both">',
+      '#suffix' => '</div>',
+    );
+    $ids = array(
+      'im_vid_59', // base theme
+      'im_vid_64', // recolorable
+      'im_vid_69', // doctype
+    );
+    foreach ($ids as $id) {	
+      $form['advanced'][$id] = $form[$id];
+      unset($form[$id]);
+    }
+
+    $form['im_vid_49']['#weight'] = 1;  // width
+    $form['im_vid_74']['#weight'] = 2;  // columns
+    $form['im_vid_54']['#weight'] = 3;  // orientation
+    $form['submit']['#weight'] = 10;
+  }
+  elseif (strcasecmp($project_type_arg, 'modules') === 0) {
+    $form['tid']['#prefix'] = '<div style="clear:both">';
+    $form['tid']['#suffix'] = '</div>';
+  }
+}
+
 // == Security release restrictions ============================================
 
 /**
