Index: drupalorg_search/drupalorg_search.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drupalorg/drupalorg_search/drupalorg_search.module,v
retrieving revision 1.25
diff -u -p -r1.25 drupalorg_search.module
--- drupalorg_search/drupalorg_search.module	16 Aug 2010 21:30:41 -0000	1.25
+++ drupalorg_search/drupalorg_search.module	18 Aug 2010 23:53:55 -0000
@@ -433,7 +433,7 @@ function drupalorg_search_preprocess_dru
     $variables[$delta] = drupalorg_block_render($module, $delta);
   }
 
-  $variables['version_form'] = drupal_get_form('drupalorg_search_version_form', 'download');
+  $variables['version_form'] = drupal_get_form('project_solr_version_form', 'download', t('Show only modules for Drupal version'));
 }
 
 /**
@@ -480,54 +480,3 @@ function drupalorg_search_get_project_ty
     }
   }
 }
-
-/**
- * This generates a form containing version selection and a submit button.
- * 
- * Generate a form with a version selection to allow filtering page content
- * based on the drupal version. Also includes path to allow the form to 
- * potentially submit to other urls if desired.
- * 
- * @param string $path
- *   The base path to which the version form will redirect.
- */
-function drupalorg_search_version_form(&$form_state, $path) {
-  $query = apachesolr_current_query();
-
-  $form = array(
-    '#attributes' => array('class' => 'clear-block'),
-  );
-
-  // Add version select field to our form.
-  $form['drupal_core'] = project_solr_get_api_version_field($query, t('Show only modules for Drupal version'));
-
-  $form['path'] = array(
-    '#type' => 'value',
-    '#value' => $path,
-  );
-  $form['submit'] = array(
-    '#type' => 'submit',
-    '#value' => t('Search'),
-  );
-  return $form;
-}
-
-/**
- * Create a query with the right version filter and redirect to the right page.
- * 
- * Create a new query, add any version filtering if it was selected in the
- * form, and redirect back to the relevant page with the appropriate filter
- * string.
- */
-function drupalorg_search_version_form_submit($form, &$form_state) {
-  // We create a new query with our base path so that we don't need to remove
-  // any existing drupal_core selection, and so that the implict type and 
-  // module tid filters don't end up in the url string.
-  $query = apachesolr_drupal_query('', '', '', $form_state['values']['path']);
-
-  if (!empty($form_state['values']['drupal_core'])) {
-    $query->add_filter(variable_get('project_solr_project_release_api_tids_alias', 'api_version'), $form_state['values']['drupal_core']);
-  }
-
-  $form_state['redirect'] = array($query->get_path(), $query->get_url_queryvalues());
-}
