Extend / Modify Advanced Search Form in Drupal 6

Recently a customer of me asked me to modify his advanced search form. Normally the advanced search form looks like this:

You realize quickly, that the user can't cope with this selection form. The goal was to split the taxonomy selection form into multiple forms, each for every vocabulary.

Code

This requirement can be implemented in Drupal 6 by using the hook_form_alter.

/**
 * Implementation of hook_form alter
 */
function taxonomysplit_form_alter(&$form, $form_state, $form_id) {

  if ($form_id == 'search_form' && $form['module']['#value'] == 'node' && user_access('use advanced search'))  {
    
    ...rest of code goes here ...

}

The modified search form will look lile this:

Download

Attached you will find a module called taxonomy_split that achieves this purpose:

taxonomysplit.zip