Index: taxonomy_image.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_image/taxonomy_image.install,v
retrieving revision 1.1
diff -u -p -r1.1 taxonomy_image.install
--- taxonomy_image.install	27 Jun 2006 12:02:21 -0000	1.1
+++ taxonomy_image.install	17 Jan 2007 19:28:35 -0000
@@ -22,3 +22,10 @@ function taxonomy_image_install() {
       )");
   }
 }
+
+/**
+ * Implementation of hook_uninstall().
+ */
+function taxonomy_image_uninstall() {
+  db_query('DROP TABLE {term_image}'); 
+}
Index: taxonomy_image.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_image/taxonomy_image.module,v
retrieving revision 1.12
diff -u -p -r1.12 taxonomy_image.module
--- taxonomy_image.module	27 Apr 2006 02:00:24 -0000	1.12
+++ taxonomy_image.module	17 Jan 2007 19:28:35 -0000
@@ -109,8 +109,6 @@ function taxonomy_image_perm() {
 
 function taxonomy_image_help($section = '') {
   switch ($section) {
-    case 'admin/modules#description':
-      return t('Upload and associate images with taxonomy terms.');
     case 'admin/taxonomy/image':
       return t('The taxonomy_image module allows site administrators to associate images with taxonomy terms.  Once defined, this association allows Drupal themes to display images with site content.  For example, this module might be used to display a penguin with content about Linux, and a cheeseburger with content about junk food.  To upload a new image for a specific term, click "upload image" next to the term.  To modify or delete and existing image, click "edit image".  To learn more about how to create vocabularies and terms, review the <a href="%taxonomy-help">taxonomy help page</a>.', array('%taxonomy-help' => url('admin/help/taxonomy')));
     case 'admin/help#taxonomy_image':
@@ -144,10 +142,20 @@ function taxonomy_image_menu($may_cache)
   $items = array();
 
   if ($may_cache) {
-    $items[] = array('path' => 'admin/taxonomy/image', 'title' => t('images'),
+    $items[] = array('path' => 'admin/taxonomy/image', 'title' => t('Taxonomy Images'),
       'callback' => 'taxonomy_image_admin',
       'access' => user_access('administer taxonomy images'),
       'type' => MENU_LOCAL_TASK);
+    // Admin Settings
+    $items[]= array (
+      'path' => 'admin/settings/taxonomy_image',
+      'title' => t('Taxonomy Image'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('taxonomy_image_admin_settings'),
+      'access' => user_access('administer site configuration'),
+      'description' => t('Global configuration of taxonomy image functionality.'),
+      'type' => MENU_NORMAL_ITEM,
+    );
   }
 
   return $items;
@@ -178,9 +186,9 @@ function taxonomy_image_user($type, $edi
 }
 
 /**
- * Implementation of hook_settings().
+ * Administration Page
  */
-function taxonomy_image_settings() {
+function taxonomy_image_admin_settings() {
   if (!file_check_directory(file_create_path(variable_get('taxonomy_image_path', 'category_pictures')), FILE_CREATE_DIRECTORY)) {
     $error = theme('error', t('The picture directory does not exist, or is not writable.'));
   }
@@ -233,7 +241,7 @@ function taxonomy_image_settings() {
     '#description' => t('When enabled, taxonomy_image_display() will recursively search for an image to display, starting with the passed in term, then trying the term\'s parents.  This functionality is only useful if you have defined hierarchical taxonomies, and multiple terms within a tree will share the same image.  If this doesn\'t mean anything to you, leave this option disabled.'),
   );
 
-  return $form;
+  return system_settings_form($form);
 }
 
 function taxonomy_image_file_download($file) {
@@ -271,8 +279,9 @@ function taxonomy_image_file_download($f
 
 // taxonomy_image specific functions
 function taxonomy_image_admin() {
+  global $form_values;
   $op = $_POST['op'];
-  $edit = $_POST['edit'];
+  $tid = $_POST['tid'];
 
   if (empty($op)) {
     $op = arg(2);
@@ -281,17 +290,17 @@ function taxonomy_image_admin() {
   switch ($op) {
     case 'image':
       if (arg(3) == 'add' || arg(3) == 'edit') { 
-        $output = taxonomy_image_form((array)(taxonomy_image_get_term(arg(4))));
+        $output = drupal_get_form('taxonomy_image_form', (array)(taxonomy_image_get_term(arg(4))));
         break;
       }
       $output = taxonomy_image_overview();
       break;
     case t('Save'):
-      $output = taxonomy_image_save($edit);
+      $output = taxonomy_image_save($tid);
       $output = taxonomy_image_overview();
       break;
     case t('Delete'):
-      $output = taxonomy_image_delete($edit);
+      $output = taxonomy_image_delete($tid);
       $output = taxonomy_image_overview();
       break;
     default:
@@ -322,14 +331,15 @@ function taxonomy_image_overview() {
     $tree = taxonomy_get_tree($vocabulary->vid);
     if ($tree) {
       foreach ($tree as $term) {
-        $data =  _taxonomy_depth($term->depth) .' '. $term->name .' ('. ( _taxonomy_image_exists($term->tid) ? l(t('edit image'), "admin/taxonomy/image/edit/$term->tid") : l(t('upload image'), "admin/taxonomy/image/add/$term->tid") ) .')<br />';
+        $data =  str_repeat('--', $term->depth) .' '. $term->name .' ('. ( _taxonomy_image_exists($term->tid) ? l(t('edit image'), "admin/taxonomy/image/edit/$term->tid") : l(t('upload image'), "admin/taxonomy/image/add/$term->tid") ) .')<br />';
         /* use taxonomy_image_display() instead of _taxonomy_image_exists() in
         ** case image display recursion is enabled...
         */
         $image = taxonomy_image_display($term->tid) ? taxonomy_image_display($term->tid) : '';
         $rows[] = array(array('data' => $data, 'colspan' => 2), $image);
       }
-    }
+    }  
+    
     $output .= theme('table', $header, $rows);
   }
 
@@ -341,7 +351,6 @@ function taxonomy_image_get_term($tid) {
 }
 
 function taxonomy_image_form($edit = array()) {
-
   $form['#method'] = 'post';
   $form['#action'] = 0;
   $form['#attributes'] = array('enctype' => 'multipart/form-data');
@@ -383,10 +392,11 @@ function taxonomy_image_form($edit = arr
     );
   }
 
-  return drupal_get_form('taxonomy_image_form', $form);
+  return $form;
 }
 
-function taxonomy_image_save($edit) {
+function taxonomy_image_save($tid) {
+  $edit['tid'] = $tid;
   $fields = array('tid', 'path');
   if ($file = file_save_upload('path', file_create_path(variable_get('taxonomy_image_path', 'category_pictures')))) {
     $edit['path'] = $file->filepath;
