Index: taxonomy_theme_pathes.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_theme/taxonomy_theme_pathes.inc,v
retrieving revision 1.4
diff -u -r1.4 taxonomy_theme_pathes.inc
--- taxonomy_theme_pathes.inc	20 Oct 2006 07:42:28 -0000	1.4
+++ taxonomy_theme_pathes.inc	13 Feb 2007 23:29:32 -0000
@@ -1,11 +1,11 @@
 <?php
-// $Id: taxonomy_theme_pathes.inc,v 1.4 2006/10/20 07:42:28 profix898 Exp $
+// $Id: taxonomy_theme_paths.inc,v 1.4 2006/10/20 07:42:28 profix898 Exp $
 
 /**
- * function _taxonomy_theme_select_pathes().
- * (assign theme to Drupal pathes and path aliases (incl. i18n support))
+ * function _taxonomy_theme_select_paths().
+ * (assign theme to Drupal paths and path aliases (incl. i18n support))
  */
-function _taxonomy_theme_select_pathes(&$custom_theme, $uri) {
+function _taxonomy_theme_select_paths(&$custom_theme, $uri) {
   $offset  = (variable_get('clean_url', 0) ? 0 : 3) + strlen(base_path());
   $alias_uri = substr(request_uri(), $offset);
   if (module_exists('i18n')) {
@@ -14,8 +14,8 @@
   $alias_uri = $alias_uri ? $alias_uri : '/';
   $themes = list_themes();
   foreach ($themes as $themex) {
-    $pathes_regexp = _taxonomy_theme_expcache($themex->name);
-    if (preg_grep($pathes_regexp, array($uri, $alias_uri))) {
+    $paths_regexp = _taxonomy_theme_expcache($themex->name);
+    if (preg_grep($paths_regexp, array($uri, $alias_uri))) {
       $custom_theme = $themex->name;
     }
   }
@@ -23,7 +23,7 @@
 
 /**
  * function _taxonomy_theme_expcache().
- * (build cacheable regexps from from pathes table)
+ * (build cacheable regexps from from paths table)
  */
 function _taxonomy_theme_expcache($theme_name = NULL) {
   static $cache;
@@ -33,14 +33,14 @@
   }
   // build new regexps from table and put them into cache
   if (!isset($cache[$theme_name])) {
-    $result = db_query("SELECT path FROM {theme_pathes} WHERE theme = '%s'", $theme_name);
+    $result = db_query("SELECT path FROM {theme_paths} WHERE theme = '%s'", $theme_name);
     if (db_num_rows($result)) {
       while ($path = db_fetch_object($result)) {
-        $pathes .= empty($pathes) ? '' : '|';
-        $pathes .= str_replace(array('*', '/'), array('.*', '\/'), drupal_get_normal_path($path->path));
+        $paths .= empty($paths) ? '' : '|';
+        $paths .= str_replace(array('*', '/'), array('.*', '\/'), drupal_get_normal_path($path->path));
       }
     }
-    $cache[$theme_name] = '/^('.$pathes.')$/';
+    $cache[$theme_name] = '/^('.$paths.')$/';
   }
   
   return $cache[$theme_name];
Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_theme/README.txt,v
retrieving revision 1.9
diff -u -r1.9 README.txt
--- README.txt	9 Oct 2006 22:14:49 -0000	1.9
+++ README.txt	13 Feb 2007 23:19:33 -0000
@@ -9,7 +9,7 @@
 
 The taxonomy_theme module allows you to change the theme of a given node
 based on the taxonomy term, vocabulary or nodetype of that node. You can
-also theme your forums and map themes to Drupal pathes or path aliases
+also theme your forums and map themes to Drupal paths or path aliases
 directly.
 
 *****************************************************************************
@@ -64,7 +64,7 @@
 You can assign themes to every Drupal path and path alias. To assign a
 theme for a particular path enter the path into according textarea in
 'Extended (Pathes)' section (visible only with this option enabled).
-Extended options have higher priority. Themes assigned to pathes
+Extended options have higher priority. Themes assigned to paths
 override themes from taxonomy selection methods (e.g. vocab-based).
 
 - "Enable 'Themes for Views'"
Index: taxonomy_theme.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_theme/taxonomy_theme.info,v
retrieving revision 1.2
diff -u -r1.2 taxonomy_theme.info
--- taxonomy_theme.info	9 Oct 2006 22:14:49 -0000	1.2
+++ taxonomy_theme.info	13 Feb 2007 23:20:04 -0000
@@ -1,6 +1,6 @@
 ; $Id: taxonomy_theme.info,v 1.2 2006/10/09 22:14:49 profix898 Exp $
 
 name = "Taxonomy Theme"
-description = "Map themes to nodes, taxonomy vocabs/terms or Drupal pathes/path aliases."
+description = "Map themes to nodes, taxonomy vocabs/terms or Drupal paths/path aliases."
 
 dependencies = taxonomy
Index: taxonomy_theme.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_theme/taxonomy_theme.install,v
retrieving revision 1.7
diff -u -r1.7 taxonomy_theme.install
--- taxonomy_theme.install	9 Oct 2006 22:14:49 -0000	1.7
+++ taxonomy_theme.install	13 Feb 2007 23:37:29 -0000
@@ -6,7 +6,7 @@
     case 'mysql':
     case 'mysqli':
       // insert table
-      db_query("CREATE TABLE {theme_pathes} (
+      db_query("CREATE TABLE {theme_paths} (
                 path varchar(255) NOT NULL default '',
                 theme varchar(48) NULL,
                 PRIMARY KEY (path)
@@ -17,7 +17,7 @@
       break;
     case 'pgsql':
       // insert table
-      db_query("CREATE TABLE {theme_pathes} (
+      db_query("CREATE TABLE {theme_paths} (
                 path varchar(255) NOT NULL default '',
                 theme varchar(48) NULL default '',
                 PRIMARY KEY (path)
@@ -80,9 +80,13 @@
   return $ret;
 }
 
+function taxonomy_theme_update_4() {
+  return array(update_sql("RENAME TABLE {theme_pathes} TO {theme_paths}"));
+}
+
 function taxonomy_theme_uninstall() {
-  //drop tables
-  db_query('DROP TABLE {theme_pathes}');
+  //drop table
+  db_query('DROP TABLE {theme_paths}');
   //remove variables
   db_query("DELETE FROM {variable} WHERE name LIKE 'taxonomy_theme_%'");
 }
Index: taxonomy_theme.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_theme/taxonomy_theme.module,v
retrieving revision 1.48
diff -u -r1.48 taxonomy_theme.module
--- taxonomy_theme.module	23 Oct 2006 06:50:50 -0000	1.48
+++ taxonomy_theme.module	13 Feb 2007 23:53:23 -0000
@@ -18,7 +18,7 @@
     $items[] = array(
       'path' => 'admin/settings/taxonomy_theme',
       'title' => t('Taxonomy Theme'),
-      'description' => t('Assign themes to taxonomy terms/vocabs and Drupal pathes.'),
+      'description' => t('Assign themes to taxonomy terms/vocabs and Drupal paths.'),
       'callback' => 'taxonomy_theme_admin',
       'callback arguments' => 'taxonomy_theme_admin_form',
       'access' => user_access('administer taxonomy_theme'),
@@ -53,7 +53,7 @@
       if (variable_get('taxonomy_theme_extended_enable', 0)) {
         $items[] = array(
           'path' => 'admin/settings/taxonomy_theme/extended',
-          'title' => t('Extended (Pathes)'),
+          'title' => t('Extended (Paths)'),
           'callback' => 'taxonomy_theme_admin',
           'callback arguments' => 'taxonomy_theme_admin_extended_form',
           'access' => user_access('administer taxonomy_theme'),
@@ -98,6 +98,23 @@
 }
 
 /**
+ * Implementation of hook_node_type().
+ */
+function taxonomy_theme_node_type($op, $info) {
+  switch ($op){
+    case 'update':
+      $default_theme = variable_get('theme_default', 'bluemarine');
+      $nodetype_theme = variable_get('taxonomy_theme_nodetype|'.$info->old_type, $default_theme);
+      variable_set('taxonomy_theme_nodetype|'.$info->type, $nodetype_theme);
+      variable_del('taxonomy_theme_nodetype|'.$info->old_type);
+      break;
+    case 'delete':
+      variable_del('taxonomy_theme_nodetype|'.$info->type);
+      break;
+  }
+}
+
+/**
  * function _taxonomy_theme_assign().
  */
 function _taxonomy_theme_assign() {
@@ -128,8 +145,8 @@
   }
   // perform extended (path-based) theme selection
   if (variable_get('taxonomy_theme_extended_enable', 0)) {
-    require_once (drupal_get_path('module', 'taxonomy_theme').'/taxonomy_theme_pathes.inc');
-    _taxonomy_theme_select_pathes($custom_theme, $uri);
+    require_once (drupal_get_path('module', 'taxonomy_theme').'/taxonomy_theme_paths.inc');
+    _taxonomy_theme_select_paths($custom_theme, $uri);
   }
   // only apply for theme != default theme (users can have own default theme)
   if (isset($custom_theme) && ($custom_theme != $default_theme)) {
Index: taxonomy_theme_admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_theme/taxonomy_theme_admin.inc,v
retrieving revision 1.8
diff -u -r1.8 taxonomy_theme_admin.inc
--- taxonomy_theme_admin.inc	19 Dec 2006 22:59:26 -0000	1.8
+++ taxonomy_theme_admin.inc	13 Feb 2007 23:48:43 -0000
@@ -1,7 +1,7 @@
 <?php
 // $Id: taxonomy_theme_admin.inc,v 1.8 2006/12/19 22:59:26 profix898 Exp $
 
-require_once (drupal_get_path('module', 'taxonomy_theme').'/taxonomy_theme_pathes.inc');
+require_once (drupal_get_path('module', 'taxonomy_theme').'/taxonomy_theme_paths.inc');
 require_once (drupal_get_path('module', 'taxonomy_theme').'/taxonomy_theme_taxonomy.inc');
 
 /**
@@ -44,7 +44,7 @@
     '#type' => 'checkbox',
     '#title' => t('Enable \'Extended\' (path-based) assignment of themes'),
     '#default_value' => $extended_enabled,
-    '#description' => t('Enables you to assign themes to pathes (e.g. node/21) and path aliases.'),
+    '#description' => t('Enables you to assign themes to paths (e.g. node/21) and path aliases.'),
   );
   if (module_exists('views')) {
     $form['global']['taxonomy_theme_viewspages'] = array(
@@ -341,24 +341,24 @@
   );
   if (variable_get('taxonomy_theme_extended_enable', 0)) {
     $form['taxonomy_theme_extended']['help'] = array('#value' => t('<p>To assign a theme for a particular path enter the path into according textarea.<br />Enter one path per line as Drupal paths (or path aliases). Character \'*\' is a wildcard.<br /><i>Adding \'node/6\' to the \'bluemarine\' field will assign bluemarine theme to node 6.</i></p>'));
-    $form['taxonomy_theme_extended']['theme_pathes'] = array('#tree' => TRUE);
+    $form['taxonomy_theme_extended']['theme_paths'] = array('#tree' => TRUE);
     $options_admin_themes = _taxonomy_theme_options(TRUE, FALSE);
     foreach($options_admin_themes as $themex) {
-      $form['taxonomy_theme_extended']['theme_pathes'][$themex] = array(
+      $form['taxonomy_theme_extended']['theme_paths'][$themex] = array(
         '#type' => 'fieldset',
         '#title' => $themex,
         '#collapsible' => TRUE,
         '#collapsed' => TRUE,
       );
-      unset($pathes);
-      $result = db_query("SELECT path FROM {theme_pathes} WHERE theme = '%s'", $themex);
+      unset($paths);
+      $result = db_query("SELECT path FROM {theme_paths} WHERE theme = '%s'", $themex);
       while ($path = db_fetch_object($result)) {
-        $pathes .= $path->path."\r\n"; 
+        $paths .= $path->path."\r\n";
       }
-      $form['taxonomy_theme_extended']['theme_pathes'][$themex]['pathes'] = array(
+      $form['taxonomy_theme_extended']['theme_paths'][$themex]['paths'] = array(
         '#type' => 'textarea',
         '#rows' => 10,
-        '#default_value' => $pathes,
+        '#default_value' => $paths,
       );
     }
   }
@@ -422,7 +422,7 @@
 function taxonomy_theme_admin_form_submit($form_id, $form_data) {
   if ($form_data['op'] == t('Save configuration')) {
     // save settings
-    unset($form_data['op'], $form_data['submit'], $form_data['reset'], $form_data['form_id']);
+    unset($form_data['op'], $form_data['submit'], $form_data['reset'], $form_data['form_token'], $form_data['form_id']);
     foreach ($form_data as $key => $value) {
       _taxonomy_theme_variable_set($key, $value);
     }
@@ -444,23 +444,23 @@
 function taxonomy_theme_admin_extended_form_submit($form_id, $form_data) {
   if ($form_data['op'] == t('Save configuration')) {
     // save settings
-    db_query("DELETE FROM {theme_pathes}");
-    foreach ($form_data['theme_pathes'] as $theme => $data) {
-      $pathes = preg_split('/(\r\n?|\n)/', $data['pathes'], -1, PREG_SPLIT_NO_EMPTY);
-      foreach ($pathes as $path) {
+    db_query("DELETE FROM {theme_paths}");
+    foreach ($form_data['theme_paths'] as $theme => $data) {
+      $paths = preg_split('/(\r\n?|\n)/', $data['paths'], -1, PREG_SPLIT_NO_EMPTY);
+      foreach ($paths as $path) {
         while ($path{0} == '/') {
           $path = substr($path, 1);
         }
-        db_query("INSERT INTO {theme_pathes} (path, theme) VALUES ('%s', '%s')", $path, $theme);
+        db_query("INSERT INTO {theme_paths} (path, theme) VALUES ('%s', '%s')", $path, $theme);
       }
     }
-    _taxonomy_theme_expcache(); // reset pathes cache
+    _taxonomy_theme_expcache(); // reset paths cache
     drupal_set_message(t('The configuration options have been saved.'));
   }
   else {
     // reset settings
-    db_query("DELETE FROM {theme_pathes}");
-    _taxonomy_theme_expcache(); // reset pathes cache
+    db_query("DELETE FROM {theme_paths}");
+    _taxonomy_theme_expcache(); // reset paths cache
     drupal_set_message(t('All configuration options have been set to default values.'));
   }
 }
@@ -574,7 +574,7 @@
   if (module_exists('i18n')) {
     i18n_get_lang_prefix($node_path, true);
   }
-  $node_theme = db_result(db_query("SELECT theme FROM {theme_pathes} WHERE path = '%s'", $node_path));
+  $node_theme = db_result(db_query("SELECT theme FROM {theme_paths} WHERE path = '%s'", $node_path));
   if (!$node_theme) {
     $node_theme = 'default';
   }
@@ -598,7 +598,7 @@
  * (hook into views administration form)
  */
 function _taxonomy_theme_alter_views($options_themes, $form_id, &$form) {
-  $view_theme = db_result(db_query("SELECT theme FROM {theme_pathes} WHERE path = '%s'", $form['page-info']['url']['#default_value']));
+  $view_theme = db_result(db_query("SELECT theme FROM {theme_paths} WHERE path = '%s'", $form['page-info']['url']['#default_value']));
   if (!$view_theme) {
     $view_theme = 'default';
   }
@@ -648,27 +648,27 @@
   }
   // submit node form pages
   else if ($form_id == $form_data['type'].'_node_form') {
-    db_query("DELETE FROM {theme_pathes} WHERE path = '%s'", 'node/'.$form_data['nid']);
+    db_query("DELETE FROM {theme_paths} WHERE path = '%s'", 'node/'.$form_data['nid']);
     if (isset($form_data['path']) && !empty($form_data['path'])) {
-      db_query("DELETE FROM {theme_pathes} WHERE path = '%s'", $form_data['path']);
+      db_query("DELETE FROM {theme_paths} WHERE path = '%s'", $form_data['path']);
     }
     if ($form_data['theme'] != 'default') {
       if (isset($form_data['path']) && !empty($form_data['path'])) {
-        db_query("INSERT INTO {theme_pathes} (path, theme) VALUES ('%s', '%s')", $form_data['path'], $form_data['theme']);
+        db_query("INSERT INTO {theme_paths} (path, theme) VALUES ('%s', '%s')", $form_data['path'], $form_data['theme']);
       }
       else {
-        db_query("INSERT INTO {theme_pathes} (path, theme) VALUES ('%s', '%s')", 'node/'.$form_data['nid'], $form_data['theme']);
+        db_query("INSERT INTO {theme_paths} (path, theme) VALUES ('%s', '%s')", 'node/'.$form_data['nid'], $form_data['theme']);
       }
     }
-    _taxonomy_theme_expcache(); // reset pathes cache
+    _taxonomy_theme_expcache(); // reset paths cache
   }
   // submit edit view page
   else if (($form_id == 'views_edit_view') && !empty($form_data['url'])) {
-    db_query("DELETE FROM {theme_pathes} WHERE path = '%s'", drupal_get_normal_path($form_data['url']));
+    db_query("DELETE FROM {theme_paths} WHERE path = '%s'", drupal_get_normal_path($form_data['url']));
     if ($form_data['theme'] != 'default') {
-      db_query("INSERT INTO {theme_pathes} (path, theme) VALUES ('%s', '%s')", drupal_get_normal_path($form_data['url']), $form_data['theme']);
+      db_query("INSERT INTO {theme_paths} (path, theme) VALUES ('%s', '%s')", drupal_get_normal_path($form_data['url']), $form_data['theme']);
     }
-    _taxonomy_theme_expcache(); // reset pathes cache
+    _taxonomy_theme_expcache(); // reset paths cache
   }
 }
 
