? cck_gallery.no_template_copying.patch
Index: cck_gallery.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck_gallery/cck_gallery.module,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 cck_gallery.module
--- cck_gallery.module	29 Mar 2009 15:00:41 -0000	1.1.2.2
+++ cck_gallery.module	7 Apr 2009 10:45:21 -0000
@@ -8,6 +8,7 @@
  * with CCK content types
  */
 
+
 /**
  * Implementation of hook_perm().
  */
@@ -215,10 +216,12 @@ function cck_gallery_theme() {
     'views_view_unformatted__gallery_contents' => array (
       'arguments' => array('view' => NULL, 'options' => NULL, 'rows' => NULL, 'title' => NULL),
       'template' => 'theme/views-view-unformatted--gallery-contents',
+      'path' => drupal_get_path('module', 'cck_gallery'),
     ),
     'views_view_list__gallery_list_page' => array (
       'arguments' => array('view' => NULL, 'options' => NULL, 'rows' => NULL, 'title' => NULL),
       'template' => 'theme/views-view-list--gallery-list-page',
+      'path' => drupal_get_path('module', 'cck_gallery'),
     ),
   );
 }
@@ -243,10 +246,12 @@ function cck_gallery_preprocess_node(&$v
     $display = variable_get('cck_gallery_contents_view_display', 'default');
     if ($vars['type'] === 'cck_gallery') {
       $vars['gallery'] =  views_embed_view($view, $display, $vars['nid']);
+       $vars['template_file'] = 'node-cck_gallery.tpl.php';
     } elseif ($vars['type'] === 'cck_image') {
       //offer the gallery as a rendered view
       $vars['gallery'] =  views_embed_view($view, $display, $vars['field_gallery'][0]['nid']);
-      
+      $vars['template_file'] = 'node-cck_image.tpl.php';
+
       //load the gallery view object
       $data = views_get_view($view);
       //configure the argumemts
@@ -296,3 +301,12 @@ function cck_gallery_preprocess_node(&$v
     }
   }
 }
+/**
+ * Implementation of hook_theme_registry_alter().
+ * We append cck_gallery/theme to the array of paths 
+ */
+function cck_gallery_theme_registry_alter(&$theme_registry) {
+  $theme_hook = 'node';
+  $modulepath = drupal_get_path('module', 'cck_gallery');
+  array_push($theme_registry[$theme_hook]['theme paths'], $modulepath.'/theme');
+}
\ No newline at end of file
