*** mm_cck.module.orig	2009-08-13 12:11:54.000000000 -0400
--- mm_cck.module	2009-08-13 12:08:25.000000000 -0400
*************** function phptemplate_filefield_file($fil
*** 27,39 ****
    // can we find a MM file for this file?
    // This is the only change to this theme function 
    if ($mm_file = media_mover_api_file_fetch(array('fid' => $file['fid']))) {
!     // get the last file
!     if ($url = media_mover_api_config_current_file($mm_file, 'final')) {
!       // should we set an absolute url?
!       if (strstr('http', $url)) {
!         $options['absolute'] = true;
        }
      }
    }
    else { 
      $path = $file['filepath'];
--- 27,48 ----
    // can we find a MM file for this file?
    // This is the only change to this theme function 
    if ($mm_file = media_mover_api_file_fetch(array('fid' => $file['fid']))) {
!     // get the list of configurations to override
!     $configurations = variable_get('mm_cck_override', false);
!     // if this config is not overridden then continue
!     if (! $configurations[$mm_file['cid']]) {
!       // get the last file
!       if ($url = media_mover_api_config_current_file($mm_file, 'final')) {
!         // should we set an absolute url?
!         if (strstr('http', $url)) {
!           $options['absolute'] = true;
!         }
        }
      }
+     else {
+       $path = $file['filepath'];
+       $url = file_create_url($path);
+     }
    }
    else { 
      $path = $file['filepath'];
*************** function mm_cck_media_mover($op, $action
*** 118,123 ****
--- 127,137 ----
            // @TODO: check action that is being deleted and remove single files based on config
          }
          break;
+       // define global settings for this module
+       // @return array drupal form array
+       case 'admin':
+         return mm_cck_admin();
+       break;
      }
    }
  }
*************** function mm_cck_find_local_file($file) {
*** 578,580 ****
--- 592,624 ----
      }
    }
  }
+ 
+ /**
+  * builds the admin form
+  * @return drupal form array
+  */
+ function mm_cck_admin() {
+ 
+   $form['mm_cck'] = array(
+     '#type' => 'fieldset',
+     '#title' => t('CCK'),
+     '#description' => t('Select the configurations which should NOT replace the CCK FileField link.  This will prevent processes like thumbnail generation from changing the link to the file.'),
+     '#collapsed' => false,
+     '#collapsible' => true,
+   );
+   
+   // get a list of all current MM configurations
+   $configurations = media_mover_api_get_configurations();
+   foreach ($configurations as $configuration) {
+     $options[$configuration->cid] = '<strong>'. $configuration->name .'</strong><br />'. $configuration->description;
+   }
+ 
+   $form['mm_cck']['mm_cck_override'] = array(
+     '#title' => t('Select the configurations to override (not replace link)'),
+     '#type' => 'checkboxes',
+     '#options' => $options,
+     '#default_value' => variable_get('mm_cck_override', array()),
+   );     
+    
+   return $form;
+ }
