Index: pathauto.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.module,v
retrieving revision 1.44.4.46
diff -u -r1.44.4.46 pathauto.module
--- pathauto.module	29 Oct 2007 18:49:58 -0000	1.44.4.46
+++ pathauto.module	1 Nov 2007 21:28:20 -0000
@@ -592,6 +592,7 @@
           $category = (object) $object;
           path_set_alias('taxonomy/term/'. $category->tid);
           path_set_alias('forum/'. $category->tid);
+          path_set_alias('image/tid'. $category->tid);
           path_set_alias('taxonomy/term/'. $category->tid .'/0/feed');
           break;
         default:
Index: pathauto_taxonomy.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto_taxonomy.inc,v
retrieving revision 1.20.4.16
diff -u -r1.20.4.16 pathauto_taxonomy.inc
--- pathauto_taxonomy.inc	25 Oct 2007 17:18:57 -0000	1.20.4.16
+++ pathauto_taxonomy.inc	1 Nov 2007 21:28:20 -0000
@@ -29,8 +29,9 @@
       if (sizeof($vocabularies) > 0) {
         $settings['patternitems'] = array();
         $forum_vid = variable_get('forum_nav_vocabulary', '');
+        $image_vid = variable_get('image_gallery_nav_vocabulary', '');
         foreach ($vocabularies as $vocab) {
-          if ($vocab->vid != $forum_vid) {
+          if ($vocab->vid != $forum_vid  && $vocab->vid != $image_vid) {
             $vocabname = $vocab->name;
             $fieldlabel = t('Pattern for all %vocab-name paths', array('%vocab-name' => $vocabname));
             $settings['patternitems'][$vocab->vid] = $fieldlabel;
@@ -49,8 +50,9 @@
  */ 
 function taxonomy_pathauto_bulkupdate() {
   $forum_vid = variable_get('forum_nav_vocabulary', '');
-  $query = "SELECT tid, vid, name, src, dst FROM {term_data} LEFT JOIN {url_alias} ON CONCAT('taxonomy/term/', tid) = src WHERE src IS NULL AND vid != %d";
-  $result = db_query_range($query, $forum_vid, 0, variable_get('pathauto_max_bulk_update', 50));
+  $image_vid = variable_get('image_gallery_nav_vocabulary', '');
+  $query = "SELECT tid, vid, name, src, dst FROM {term_data} LEFT JOIN {url_alias} ON CONCAT('taxonomy/term/', tid) = src WHERE src IS NULL AND vid != %d AND vid != %d";
+  $result = db_query_range($query, $forum_vid, $image_vid, 0, variable_get('pathauto_max_bulk_update', 50));
   
   $count = 0;
   $placeholders = array();
@@ -76,6 +78,7 @@
   $placeholders = pathauto_get_placeholders('taxonomy', $category);    
   
   $forum_vid = variable_get('forum_nav_vocabulary', '');
+  $image_vid = variable_get('image_gallery_nav_vocabulary', '');
   // If we're in a forum vocabulary, also create a forum container, forum, or forum topic alias.
   if (module_exists('forum') && $forum_vid == (int)$category->vid) {
     $src = 'forum/'. $category->tid;
@@ -83,6 +86,12 @@
       $count++;
     }
   }
+  elseif (module_exists('image_gallery') && $image_vid == (int)$category->vid) {
+    $src = 'image/tid/'. $category->tid;
+    if ($alias = pathauto_create_alias('image_gallery', $op, $placeholders, $src, $vid)) {
+      $count++;
+    }
+  }
   else {
     $src = 'taxonomy/term/'. $category->tid;
     if ($alias = pathauto_create_alias('taxonomy', $op, $placeholders, $src, $category->vid)) {
@@ -140,4 +149,53 @@
   drupal_set_message(format_plural($count,
     "Bulk update of forums and forum containers completed, one alias generated.",
     "Bulk update of forums and forum containers completed, @count aliases generated."));
-}
\ No newline at end of file
+}
+
+
+/*
+ * Implementation of hook_pathauto() for immage_gallery module
+ */
+function image_gallery_pathauto($op) {
+  switch ($op) {
+    case 'settings':
+      $settings = array();
+      $settings['module'] = 'image_gallery';
+      $settings['token_type'] = 'taxonomy';
+      $settings['groupheader'] = t('Image gallery path settings');
+      $settings['patterndescr'] = t('Pattern for galleries');
+      $settings['patterndefault'] = t('[vocab-raw]/[catpath-raw]');
+      $patterns = token_get_list('taxonomy');
+      foreach ($patterns as $type => $pattern_set) {
+        if ($type != 'global') {
+          foreach ($pattern_set as $pattern => $description) {
+            $settings['placeholders'][t('['. $pattern .']')] = t($description);
+          }
+        }
+      }
+      $settings['supportsfeeds'] = '0/feed';
+      $settings['bulkname'] = t('Bulk generate galleries paths');
+      $settings['bulkdescr'] = t('Generate aliases for all existing image galleries which do not already have aliases.');
+      return (object) $settings;
+    default:
+      break;
+  }
+}
+
+/**
+ *  Generate aliases for all image galleries without aliases
+ */
+function image_gallery_pathauto_bulkupdate() {
+  $image_vid = variable_get('image_gallery_nav_vocabulary', '');
+  $query = "SELECT tid, vid, name, src, dst FROM {term_data} LEFT JOIN {url_alias} ON CONCAT('image/tid/', tid) = src WHERE vid = %d AND src IS NULL";
+  $result = db_query_range($query, $image_vid, 0, variable_get('pathauto_max_bulk_update', 50));
+
+  $count = 0;
+  $placeholders = array();
+  while ($category = db_fetch_object($result)) {
+    $count = _taxonomy_pathauto_alias($category, 'bulkupdate') + $count;
+  }
+
+  drupal_set_message(format_plural($count,
+    "Bulk update of image galleries completed, one alias generated.",
+    "Bulk update of image galleries completed, @count aliases generated."));
+}
