Index: taxonomy_search.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_search/taxonomy_search.info,v
retrieving revision 1.1.4.1
diff -u -r1.1.4.1 taxonomy_search.info
--- taxonomy_search.info	11 May 2008 15:16:36 -0000	1.1.4.1
+++ taxonomy_search.info	12 Mar 2009 01:32:22 -0000
@@ -1,4 +1,6 @@
 ; $Id: taxonomy_search.info,v 1.1.4.1 2008/05/11 15:16:36 jrbeeman Exp $
 name = "Taxonomy Search"
 description = "Search taxonomy terms, descriptions and synonyms."
-dependencies = taxonomy search
\ No newline at end of file
+dependencies[] = taxonomy
+dependencies[] = search
+core = 6.x
\ No newline at end of file
Index: taxonomy_search.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_search/Attic/taxonomy_search.install,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 taxonomy_search.install
--- taxonomy_search.install	11 May 2008 15:16:36 -0000	1.1.2.1
+++ taxonomy_search.install	11 Mar 2009 21:05:11 -0000
@@ -1,41 +1,41 @@
 <?php
 // $Id: taxonomy_search.install,v 1.1.2.1 2008/05/11 15:16:36 jrbeeman Exp $
 
+function taxonomy_search_schema()
+{
+	$schema['taxonomy_search'] = array(
+		'fields' => array(
+			 'tid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '10'),
+			 'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11'),
+			 'changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'disp-width' => '11')),
+		'primary key' => array('tid'),
+		'indexes' => array(
+			 'term_changed' => array('changed'),
+			 'term_created' => array('created')),
+	);
+
+	return $schema;
+}
 
 /**
  * Implementation of hook_install()
  */
-function taxonomy_search_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysqli':
-    case 'mysql':
-      db_query("CREATE TABLE {taxonomy_search} (
-        tid int(10),
-        created int(11) NOT NULL default '0',
-        changed int(11) NOT NULL default '0',
-        PRIMARY KEY (tid),
-        KEY term_created (created),
-        KEY term_changed (changed)
-      )  /*!40100 DEFAULT CHARACTER SET utf8 */;");
-      db_query("INSERT INTO {taxonomy_search} (tid, created, changed) SELECT tid, %d, %d FROM {term_data}", time(), time());
-      drupal_set_message(t('Taxonomy search module successfully installed.  Cron will need to be run until in the term search index is fully populated.'));
-      break;
-  }
+function taxonomy_search_install()
+{
+	drupal_install_schema('taxonomy_search');
 }
 
 
 /**
  * Implementation of hook_uninstall()
  */
-function taxonomy_search_uninstall() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysqli':
-    case 'mysql':
-      variable_del('taxonomy_search_cron_last_id');
-      db_query("DROP TABLE {taxonomy_search}");
-      db_query("DELETE FROM {search_index} WHERE type = 'taxonomy'");
-      db_query("DELETE FROM {search_dataset} WHERE type = 'taxonomy'");
-      drupal_set_message(t('Taxonomy Search module has been uninstalled.  Indexed data for taxonomy searches has been cleared out, but it is recommended that you rebuild the search index to clear out any taxonomy-related search statistics.'));
-      break;
-  }
+function taxonomy_search_uninstall()
+{
+	variable_del('taxonomy_search_cron_last_id');
+	
+	drupal_uninstall_schema('taxonomy_search');
+
+	db_query("DELETE FROM {search_index} WHERE type = 'taxonomy'");
+	db_query("DELETE FROM {search_dataset} WHERE type = 'taxonomy'");
+	drupal_set_message(t('Taxonomy Search module has been uninstalled.  Indexed data for taxonomy searches has been cleared out, but it is recommended that you rebuild the search index to clear out any taxonomy-related search statistics.'));
 }
\ No newline at end of file
Index: taxonomy_search.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_search/taxonomy_search.module,v
retrieving revision 1.6.4.1
diff -u -r1.6.4.1 taxonomy_search.module
--- taxonomy_search.module	11 May 2008 15:16:36 -0000	1.6.4.1
+++ taxonomy_search.module	12 Mar 2009 01:34:10 -0000
@@ -5,7 +5,7 @@
 /**
  * Implementation of hook_form_alter().
  */
-function taxonomy_search_form_alter($form_id, &$form) {
+function taxonomy_search_form_alter(&$form, &$form_state, $form_id) {
   switch ($form_id) {
     case 'search_form':
       taxonomy_search_search_form_alter($form);
@@ -22,24 +22,24 @@
     foreach (taxonomy_get_vocabularies() as $vocab) {
       $options[$vocab->vid] = $vocab->name;
     }
-    
+
     $form['basic']['inline']['vocabulary'] = array(
       '#type' => 'select',
       '#options' => $options,
       '#default_value' => $default ? $default : 0,
     );
     $form['basic']['inline']['submit']['#weight'] = 1;
-    $form['#validate']['taxonomy_search_search_form_validate'] = array();
+    $form['#validate'][] = 'taxonomy_search_search_form_validate';
   }
 }
 
 
-function taxonomy_search_search_form_validate($form_id, $form_values, $form) {
-  $keys = $form_values['processed_keys'];
-  $vid = $form_values['vocabulary'] ? $form_values['vocabulary'] : '';
+function taxonomy_search_search_form_validate($form, &$form_state) {
+  $keys = $form_state['values']['processed_keys'];
+  $vid = $form_state['values']['vocabulary'] ? $form_state['values']['vocabulary'] : '';
   $keys = search_query_insert($keys, 'vocabulary', $vid);
   if (!empty($keys)) {
-    form_set_value($form['basic']['inline']['processed_keys'], trim($keys));
+    form_set_value($form['basic']['inline']['processed_keys'], trim($keys), $form_state);
   }
 }
 
@@ -51,18 +51,18 @@
   if ($type != 'term') {
     return;
   }
-  
+
   $tid = $form_values['tid'];
-  
+
   switch ($op) {
     case 'insert':
       db_query("INSERT INTO {taxonomy_search} (tid, created, changed) VALUES (%d, %d, %d)", $tid, time(), time());
       break;
-    
+
     case 'update':
       db_query("UPDATE {taxonomy_search} SET changed = %d WHERE tid = %d", time(), $tid);
       break;
-    
+
     case 'delete':
       // TODO - delete the indexed search item
       db_query("DELETE FROM {search_index} WHERE sid = %d AND type = 'taxonomy'");
@@ -82,18 +82,18 @@
   $_taxonomy_search_last_change = variable_get('taxonomy_search_cron_last_change', 0);
   $_taxonomy_search_last_id = variable_get('taxonomy_search_cron_last_id', 0);
   $limit = (int)variable_get('search_cron_limit', 100);
-  
+
   $result = db_query_range("SELECT td.tid, th.changed, v.name AS vocabulary_name
                       FROM {term_data} td
                         LEFT JOIN {vocabulary} v ON td.vid = v.vid 
                         LEFT JOIN {taxonomy_search} th ON td.tid = th.tid
-                      WHERE (th.changed = %d AND td.tid > %d) OR (th.changed > %d)
+                      WHERE (th.changed = %d AND td.tid > %d) OR (th.changed > %d) OR (th.changed IS NULL)
                       ORDER BY th.changed ASC, td.tid ASC", 
                       $_taxonomy_search_last_change, $_taxonomy_search_last_id, $_taxonomy_search_last_change, 0, $limit);
 
   while ($item = db_fetch_object($result)) {
     $term = taxonomy_get_term($item->tid);
-    $vocabulary = taxonomy_get_vocabulary($item->vid);
+    $vocabulary = taxonomy_vocabulary_load($item->vid);
     $_taxonomy_search_last_id = $term->tid;
     $_taxonomy_search_last_change = $item->changed;
     $parents = array();
@@ -101,18 +101,18 @@
     $tree = taxonomy_get_parents_all($term->tid);
     $tree = array_reverse($tree);
     $synonyms = taxonomy_get_synonyms($term->tid);
-    
+
     foreach ($tree as $branch) {
       $parents[] = l($branch->name, taxonomy_term_path($branch));
     }
-    
+
     $text = '<h1>'. check_plain($term->name) .'</h1>';
     $text .= '<h2>'. implode(', ', $synonyms) .'</h2>';
-    $text .= implode(' » ', $parents);
+    $text .= implode(' &#187; ', $parents);
     $text .= $term->description;
     search_index($term->tid, 'taxonomy', $text);
   }
-  
+
   variable_set('taxonomy_search_cron_last_change', $_taxonomy_search_last_change);
   variable_set('taxonomy_search_cron_last_id', $_taxonomy_search_last_id);
 }
@@ -134,12 +134,12 @@
   switch ($op) {
     case 'name':
       return t('Taxonomy');
-    
+
     case 'reset':
       variable_del('taxonomy_search_cron_last_id');
       variable_del('taxonomy_search_cron_last_change');
       return;
-      
+
     case 'search':
       // Build any conditionals
       list($join1, $where1) = _db_rewrite_sql('', 'td', 'tid');
@@ -156,12 +156,12 @@
         $join1 .= 'INNER JOIN {term_data} td ON td.tid = i.sid';
         $keys = search_query_insert($keys, 'vocabulary');
       }
-      
+
       $conditions1 = empty($where1) ? $conditions1 : $conditions1 .' AND '. $where1;
-      
+
       $hits = do_search($keys, 'taxonomy', $join1, $conditions1, $arguments1);
       $results = array();
-      
+
       if (count($hits)) {
         foreach ($hits as $item) {
           $term = taxonomy_get_term($item->sid);
@@ -169,9 +169,9 @@
           $results[] = $term;
         }
       }
-      
+
       return $results;
-    
+
     case 'status':
       $last_changed = variable_get('taxonomy_search_cron_last_change', 0);
       $last_tid = variable_get('taxonomy_search_cron_last_id', 0);
@@ -193,7 +193,7 @@
   $output = '';
 
   if (count($results)) {
-    $output = '<dl class="search-results">';
+    $output = '<dl id="taxonomy-search-results" class="search-results">';
     foreach ($results as $item) {
       $output .= theme('taxonomy_search_item', $item);
     }
@@ -205,8 +205,23 @@
 }
 
 
+/**
+ * Implementation of hook_theme()
+	*/
+function taxonomy_search_theme() {
+  return array(
+    'taxonomy_search_item' => array(
+      'file' => 'taxonomy_search.module',
+      'arguments' => array(
+        'term' => NULL,
+      ),
+    ),
+  );
+}
+
+
 function theme_taxonomy_search_item($term) {
-  $vocabulary = taxonomy_get_vocabulary($term->vid);
+  $vocabulary = taxonomy_vocabulary_load($term->vid);
   $keys = $term->keys;
   $parents = array();
   $parents[] = check_plain($vocabulary->name);
@@ -217,7 +232,7 @@
   foreach ($tree as $branch) {
     $parents[] = l($branch->name, taxonomy_term_path($branch));
   }
-  $title = implode(' » ', $parents);
+  $title = implode('<span class="seperator"> &#187; </span>', $parents);
   
   $description = '';
   if ($term->description) {
@@ -225,12 +240,12 @@
   }
   
   if (count($synonyms)) {
-    $description .= '<br />'. t('Synonyms') .': <em>'. search_excerpt($keys, implode(', ', $synonyms)) .'</em>';
+    $description .= '<br />'. t('Synonyms') .': <em class="synonyms">'. search_excerpt($keys, implode(', ', $synonyms)) .'</em>';
   }
   
   $extra = '';
   if (user_access('administer taxonomy')) {
-    $extra .= l(t('Edit this term'), 'admin/content/taxonomy/edit/term/'. $term->tid);
+    $extra .= l(t('Edit term'), 'admin/content/taxonomy/edit/term/'. $term->tid);
   }
   
   $output = ' <dt class="title">'. $title .'</dt>';
@@ -238,7 +253,7 @@
   if ($description || $synonyms || $extra) {
     $output .= '<dd>';
     if ($description) {
-      $output .= '<p>'. $description .'</p>';
+      $output .= '<p class="description">'. $description .'</p>';
     }
     if ($extra) {
       $output .= '<p class="search-info">'. $extra .'</p>';

