 modules/mm_export/mm_export.info             |  2 +-
 modules/mm_export/mm_export.module           | 56 ++++++++++++----------
 modules/mm_ftp/mm_ftp.inc                    | 16 +++----
 modules/mm_ftp/mm_ftp.info                   |  2 +-
 modules/mm_ftp/mm_ftp.install                | 15 +++---
 modules/mm_ftp/mm_ftp.module                 | 71 +++++++++++++++-------------
 modules/mm_ftp/mm_ftp_test.inc               | 14 +++---
 modules/mm_ftp/mm_ftp_token.inc              | 20 ++++----
 modules/mm_getid3/mm_getid3.info             |  2 +-
 modules/mm_getid3/mm_getid3.module           | 16 +++----
 modules/mm_imageache/mm_imagecache.info      |  2 +-
 modules/mm_imageache/mm_imagecache.module    |  2 +-
 modules/mm_mailhandler/mm_mailhandler.info   |  3 +-
 modules/mm_mailhandler/mm_mailhandler.module | 24 +++++-----
 modules/mm_s3/S3.php                         |  2 +-
 modules/mm_s3/mm_s3.info                     |  3 +-
 modules/mm_s3/mm_s3.install                  |  8 ++--
 modules/mm_s3/mm_s3.module                   | 26 +++++-----
 modules/mm_s3/mm_s3_test.inc                 | 17 ++++---
 modules/mm_token/mm_token.info               |  2 +-
 modules/mm_token/mm_token.module             | 24 +++++-----
 modules/mm_views/mm_views.info               |  4 +-
 modules/mm_views/mm_views.module             | 22 ++++-----
 23 files changed, 178 insertions(+), 175 deletions(-)

diff --git a/modules/mm_export/mm_export.info b/modules/mm_export/mm_export.info
index f8d921c..093c19b 100644
--- a/modules/mm_export/mm_export.info
+++ b/modules/mm_export/mm_export.info
@@ -1,6 +1,6 @@
 name = "Media Mover Exporter"
 description = Provides export/import for Media Mover configurations and steps, as well as Features support.
 package = "Media Mover"
-core = 6.x
+core = 7.x
 php = 5.0
 dependencies[] = "ctools"
diff --git a/modules/mm_export/mm_export.module b/modules/mm_export/mm_export.module
index 1920b6f..b02b572 100644
--- a/modules/mm_export/mm_export.module
+++ b/modules/mm_export/mm_export.module
@@ -8,17 +8,17 @@
 
 
 /**
- * Implementation of hook_menu().
+ * Implements hook_menu().
  */
 function mm_export_menu() {
-  $items['admin/build/media_mover/tools/import'] = array(
+  $items[MMA_CONFIG_PATH . '/tools/import'] = array(
     'title' => 'Import configuration',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('mm_export_import_configuration_form'),
     'access arguments' => array('administer media_mover'),
     'type' => MENU_LOCAL_TASK,
   );
-  $items['admin/build/media_mover/tools/export/configuration'] = array(
+  $items[MMA_CONFIG_PATH . '/tools/export/configuration'] = array(
     'title' => 'Export configuration',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('mm_export_export_configuration_form'),
@@ -32,17 +32,17 @@ function mm_export_menu() {
 /**
  * Export a configuration and display it in a form.
  */
-function mm_export_export_configuration_form(&$form_state, $cid = FALSE) {
+function mm_export_export_configuration_form($form, &$form_state, $cid = FALSE) {
   if ($cid) {
     $configuration = media_mover_api_configuration_load($cid);
   }
-  elseif ($cid = $form_state['values']['cid']) {
+  elseif ($cid = (isset($form_state['values']) ? $form_state['values']['cid'] : FALSE)) {
     $configuration = media_mover_api_configuration_load($cid);
   }
 
-  if (! $configuration) {
+  if (!isset($configuration)) {
     // Get all configurations
-    if (! $configurations = media_mover_api_configurations_load()) {
+    if (!$configurations = media_mover_api_configurations_load()) {
       drupal_set_message(t('There are no configurations in the system to export'), 'error');
       return array();
     }
@@ -94,7 +94,7 @@ function mm_export_export_configuration_form_submit(&$form, &$form_state) {
 /**
  * Form for the configuration import
  */
-function mm_export_import_configuration_form($form_state) {
+function mm_export_import_configuration_form($form, $form_state) {
   $form = array();
   $form['instructions'] = array(
     '#type' => 'markup',
@@ -126,8 +126,8 @@ function mm_export_import_configuration_form_validate(&$form, &$form_state) {
 
   // Ensure that this is a configuration object
   if (! is_a($configuration, 'media_mover_configuration')) {
-  	form_set_error('configuration', t('The code you entered was not a valid configuration.'));
-  	return;
+    form_set_error('configuration', t('The code you entered was not a valid configuration.'));
+    return;
   }
 
   // Is there an existing configuration by this cid?
@@ -136,32 +136,32 @@ function mm_export_import_configuration_form_validate(&$form, &$form_state) {
       the system. You can change the name and id of your configuration to import it.
       You may also !edit_the_existing_one.', array(
         '%id' => $configuration->cid,
-        '!edit_the_existing_one' => l('edit the existing configuration', 'admin/build/media_mover/config/' . $import_configuration->cid)
+        '!edit_the_existing_one' => l('edit the existing configuration', MMA_CONFIG_PATH . '/config/' . $import_configuration->cid)
       )), 'error');
   }
 
-	// Investigate each of the steps
-	foreach ($configuration->steps as $import_step) {
-		// Do a module dependency check
-		if (! module_exists($import_step->module)) {
-			form_set_error('configuration', t('The module: %module is required for this configuration but is not installed.
+  // Investigate each of the steps
+  foreach ($configuration->steps as $import_step) {
+    // Do a module dependency check
+    if (! module_exists($import_step->module)) {
+      form_set_error('configuration', t('The module: %module is required for this configuration but is not installed.
 			  In order to use this configuration you will need to install it.', array(
 			    '%module' => $import_step->module,
 			  ))
 			);
-		}
-		// Check to see if this sid exists
-		if ($step = media_mover_api_step_get($import_step->sid)) {
+    }
+    // Check to see if this sid exists
+    if ($step = media_mover_api_step_get($import_step->sid)) {
       // Check to see that the build and settings values are the same
       if ($step->settings != $import_step->settings) {
-      	form_set_error('configuration', t('The step %step already exists however it
+        form_set_error('configuration', t('The step %step already exists however it
       	  does not match the one that you are importing', array(
       	    '%step' => $import_step->name
       	   ))
       	);
       }
-		}
-	}
+    }
+  }
 
 }
 
@@ -178,7 +178,7 @@ function mm_export_import_configuration_form_submit(&$form, &$form_state) {
   eval($form_state['values']['configuration']);
   $configuration->save();
   unset($form_state['storage']);
-  $form['#redirect'] = 'admin/build/media_mover/configuration/' . $configuration->cid . '/view';
+  $form_state['#redirect'] = MMA_CONFIG_PATH . '/configuration/' . $configuration->cid . '/view';
   drupal_set_message(t('Your configuration has been imported'));
 }
 
@@ -293,11 +293,11 @@ function mm_export_step_dependencies($sid) {
 
 
 /**
-* Implementation of hook_ctools_plugin_directory().
-*/
+ * Implements hook_ctools_plugin_directory().
+ */
 function mm_export_ctools_plugin_directory($module, $type) {
   // Load the export_ui plugin.
-  if ($type =='export_ui') {
+  if ($type == 'export_ui') {
     // return 'plugins/export_ui';
   }
 }
@@ -305,6 +305,10 @@ function mm_export_ctools_plugin_directory($module, $type) {
 
 
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function mm_export_presets_load($name = NULL) {
   // Use Ctools export API to fetch all presets from the DB as well as code.
   ctools_include('export');
diff --git a/modules/mm_ftp/mm_ftp.inc b/modules/mm_ftp/mm_ftp.inc
index 38ecb0a..d73e6ee 100644
--- a/modules/mm_ftp/mm_ftp.inc
+++ b/modules/mm_ftp/mm_ftp.inc
@@ -1,7 +1,5 @@
 <?php
 
-// $Id$
-
 /**
  * @file
  * Provides FTP wrapper functionality for FTP operations
@@ -54,13 +52,13 @@ function mm_ftp_parse_single_file($file_item, $parent_directory) {
   switch ($matches[1]) {
     case '-':
       $type = 'file';
-    break;
+      break;
     case 'd':
       $type = 'directory';
-    break;
+      break;
     case 'l':
       $type = 'link';
-    break;
+      break;
   }
 
   $file = array(
@@ -100,7 +98,7 @@ function mm_ftp_put_file($ftp_connection, $local_filepath, $remote_filepath, $re
     }
   }
 
-   // Open the file that is being moved
+  // Open the file that is being moved
   $put_file = fopen($local_filepath, 'r');
   // put this file on the ftp server
   if (! ftp_fput($ftp_connection, $remote_filepath, $put_file, FTP_BINARY)) {
@@ -147,7 +145,7 @@ function mm_ftp_delete_file($ftp_connection, $remote_filepath) {
 function mm_ftp_get($ftp_connection, $remote_filepath, $local_filepath, $acl = 0600) {
   // Ensure that this file is not changing
   $modified_time = ftp_mdtm($ftp_connection, $remote_filepath);
-  if ($modified_time > time() - variable_get('mm_ftp_file_mod_time', 2)) {
+  if ($modified_time > REQUEST_TIME - variable_get('mm_ftp_file_mod_time', 2)) {
     watchdog('mm_ftp', 'FTP file appears to be modified: !file', array('!file' => $remote_filepath), WATCHDOG_ERROR);
     return FALSE;
   }
@@ -180,13 +178,13 @@ function mm_ftp_mkdir($ftp_connection, $path) {
   // Break the full path into an array of directories
   $dir = split("/", $path);
   $create_directory = $dir[0];
-  for ($i=0; $i<count($dir); $i++) {
+  for ($i = 0; $i < count($dir); $i++) {
     // On the first pass we do not append the next directory
     if ($i) {
       $create_directory .= "/" . $dir[$i];
     }
     if (!ftp_chdir($ftp_connection, $path)) {
-      ftp_chdir($ftp_connection,"/"); 
+      ftp_chdir($ftp_connection, "/");
       // Create the directory
       if (! ftp_mkdir($ftp_connection, $create_directory)) {
         return FALSE;
diff --git a/modules/mm_ftp/mm_ftp.info b/modules/mm_ftp/mm_ftp.info
index 7f7a5bc..bcc3a60 100644
--- a/modules/mm_ftp/mm_ftp.info
+++ b/modules/mm_ftp/mm_ftp.info
@@ -2,4 +2,4 @@ name = FTP Media Mover
 description = Adds FTP services for Media Mover
 package = "Media Mover"
 dependencies[] = media_mover_api
-core = 6.x
\ No newline at end of file
+core = 7.x
diff --git a/modules/mm_ftp/mm_ftp.install b/modules/mm_ftp/mm_ftp.install
index baa0449..5ca9780 100644
--- a/modules/mm_ftp/mm_ftp.install
+++ b/modules/mm_ftp/mm_ftp.install
@@ -1,7 +1,5 @@
 <?php
 
-// $Id$
-
 /**
  * @file
  * Install file for mm ftp
@@ -11,8 +9,7 @@
  * Implements hook_install().
  */
 function mm_ftp_install() {
-  // Create tables.
-  drupal_install_schema('mm_ftp');
+  // drupal_(un)install_schema functions are called automatically in D7.
 }
 
 
@@ -20,7 +17,7 @@ function mm_ftp_install() {
  * Implements hook_uninstall().
  */
 function mm_ftp_uninstall() {
-  drupal_uninstall_schema('mm_ftp');
+  // drupal_(un)install_schema functions are called automatically in D7.
 }
 
 
@@ -29,20 +26,20 @@ function mm_ftp_uninstall() {
  */
 function mm_ftp_schema() {
   $schema['mm_ftp_tokens'] = array(
-    'description' => t('Holds user tokens to match against uploaded files'),
+    'description' => 'Holds user tokens to match against uploaded files',
     'fields' => array(
       'uid' => array(
-        'description' => t('Drupal user ID'),
+        'description' => 'Drupal user ID',
         'type' => 'int',
         'unsigned' => TRUE
       ),
       'token' => array(
-        'description' => t('Token value'),
+        'description' => 'Token value',
         'type' => 'text',
         'size' => 'small'
       ),
       'date' => array(
-        'description' => t('Date added'),
+        'description' => 'Date added',
         'type' => 'int',
         'not null' => TRUE,
         'default' => 0,
diff --git a/modules/mm_ftp/mm_ftp.module b/modules/mm_ftp/mm_ftp.module
index 376359a..2a16bac 100644
--- a/modules/mm_ftp/mm_ftp.module
+++ b/modules/mm_ftp/mm_ftp.module
@@ -15,15 +15,20 @@ define('MM_FTP_TOKEN_LENGTH', 6);
 /* ************************************************ */
 
 /**
- * Implements hook_perm()
+ * Implements hook_permission().
  */
-function mm_ftp_perm() {
-  return array('upload files to ftp');
+function mm_ftp_permission() {
+  return array(
+    'upload files to ftp' => array(
+      'title' => t('upload files to ftp'),
+      'description' => t('Upload files to ftp'),
+    ),
+  );
 }
 
 
 /**
- * Implements hook_menu()
+ * Implements hook_menu().
  */
 function mm_ftp_menu() {
   $items = array();
@@ -35,7 +40,7 @@ function mm_ftp_menu() {
     'file' => 'mm_ftp_token.inc',
     'type' => MENU_NORMAL_ITEM,
   );
-  $items['admin/build/media_mover/settings/mm_ftp'] = array(
+  $items[MMA_CONFIG_PATH . '/settings/mm_ftp'] = array(
     'title' => 'FTP Tokens',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('mm_ftp_admin_token', TRUE),
@@ -43,7 +48,7 @@ function mm_ftp_menu() {
     'file' => 'mm_ftp_token.inc',
     'type' => MENU_NORMAL_ITEM,
   );
-  $items['admin/build/media_mover/tests/mm_ftp'] = array(
+  $items[MMA_CONFIG_PATH . '/tests/mm_ftp'] = array(
     'title' => 'FTP Test',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('mm_ftp_test_form'),
@@ -56,11 +61,11 @@ function mm_ftp_menu() {
 
 
 /**
- * Implementation of hook_help().
+ * Implements hook_help().
  */
 function mm_ftp_help($path, $arg) {
   switch ($path) {
-    case 'admin/modules#description' :
+    case 'admin/modules#description':
       return t('Harvest module for Media Mover. Allows users to retrieve files through FTP for furthur processing.');
   }
   return;
@@ -74,8 +79,10 @@ function mm_ftp_help($path, $arg) {
  */
 function mm_ftp_cron() {
   // check the database for expired tokens
-  $date = time() - (variable_get('mm_ftp_token_duration', 2880) * 60);
-  db_query('DELETE FROM {mm_ftp_tokens} WHERE date < %d', $date);
+  $date = REQUEST_TIME - (variable_get('mm_ftp_token_duration', 2880) * 60);
+  db_delete('mm_ftp_tokens')
+  ->condition('date', $date, '<')
+  ->execute();
 }
 
 
@@ -92,7 +99,7 @@ function mm_ftp_media_mover() {
     'description' => t('Select: from a FTP server'),
     'callback' => 'mm_ftp_select',
     'configuration' => 'mm_ftp_select_config',
-    'harvest' => TRUE,
+    'select' => 1,
   );
   $items['store'] = array(
     'description' => t('Store: on a FTP server'),
@@ -117,7 +124,7 @@ function mm_ftp_token_values($type, $object = NULL) {
       foreach ($config as $k => $v) {
         $values[$k] = $v;
       }
-    break;
+      break;
   }
   return $values;
 }
@@ -312,7 +319,7 @@ function mm_ftp_connect($configuration, $display = FALSE) {
     watchdog('mm_ftp', $message, $params, WATCHDOG_ERROR);
     return;
   }
-	return $connection;
+  return $connection;
 }
 
 
@@ -323,7 +330,7 @@ function mm_ftp_connect($configuration, $display = FALSE) {
  * @return unknown_type
  */
 function mm_ftp_select($step) {
-  require_once('mm_ftp.inc');
+  module_load_include('inc', 'mm_ftp');
   // Can we connect to the FTP server?
   if (! $connection = mm_ftp_connect($step->settings)) {
     return;
@@ -360,7 +367,7 @@ function mm_ftp_select($step) {
       }
 
       // Should we try to associate this file with a user?
-      if ($step->settings['associate_file_with_user']  && $select) {
+      if ($step->settings['associate_file_with_user']   && $select) {
         // Do not harvest files which are not associated with a user
         if (! mm_ftp_file_associate_user($file)) {
           $select = FALSE;
@@ -376,31 +383,31 @@ function mm_ftp_select($step) {
         switch ($step->settings['mm_ftp_delete_files']) {
           case 'all_files':
             $delete  = TRUE;
-          break;
+            break;
           case 'selected_files':
             // Only delete if this file was selected
             if ($select) {
               $delete = TRUE;
             }
-          break;
+            break;
           case 'no_delete':
             $delete = FALSE;
-          break;
+            break;
         }
       }
 
       // Are we allowed to harvest this file?
       if ($select) {
-      	// Build a filepath to store this file
-      	$local_filepath = file_create_filename(basename($file->filepath), media_mover_api_dir_path($step->sid));
-      	// Were we able to download the file?
-      	if (mm_ftp_get($ftp_connection, $file->filepath, $local_filepath)) {
+        // Build a filepath to store this file
+        $local_filepath = file_create_filename(basename($file->filepath), media_mover_api_dir_path($step->sid));
+        // Were we able to download the file?
+        if (mm_ftp_get($ftp_connection, $file->filepath, $local_filepath)) {
           // Save the source path so that we can do uniqueness checking easily
-				  $file->source_uri = $file->uri;
-				  $file->uri = $local_filepath;
-				  $file->data['file']->filemime = $mime;
-				  $file->data['file']->filesize = filesize($local_filepath);
-				  $file->data['file']->filename = basename($local_filepath);
+          $file->source_uri = $file->uri;
+          $file->uri = $local_filepath;
+          $file->data['file']->filemime = $mime;
+          $file->data['file']->filesize = filesize($local_filepath);
+          $file->data['file']->filename = basename($local_filepath);
           // If we have a UID, associate it
           if (isset($file->uid)) {
             $file->data['user']->uid = $file->uid;
@@ -409,7 +416,7 @@ function mm_ftp_select($step) {
         }
         // Failed to download file
         else {
-          watchdog('mm_ftp', t('Error down loading %file from FTP server.', array('%file' => $file->filepath), WATCHDOG_ERROR));
+          watchdog('mm_ftp', 'Error down loading %file from FTP server.', array('%file' => $file->filepath), WATCHDOG_ERROR);
         }
       }
 
@@ -439,7 +446,7 @@ function mm_ftp_store($step, $file) {
     return;
   }
 
-  require_once('mm_ftp.inc');
+  module_load_include('inc', 'mm_ftp');
   // Extract out the connection
   extract($connection);
   // Create the remote filename
@@ -449,7 +456,7 @@ function mm_ftp_store($step, $file) {
     // Check to see if file exists on remote server by checking the files size
     if (ftp_size($ftp_connection, $remote_file_name)) {
       // Try to rename the file someting unique
-      $remote_file_name = pathinfo($file->filepath, PATHINFO_FILENAME) . '.' . time() . '.' . pathinfo($file->filepath, PATHINFO_EXTENSION);
+      $remote_file_name = pathinfo($file->filepath, PATHINFO_FILENAME) . '.' . REQUEST_TIME . '.' . pathinfo($file->filepath, PATHINFO_EXTENSION);
       $remote_file_name = $step->settings['mm_ftp_dir'] . '/' . $remote_file_name;
     }
   }
@@ -505,13 +512,13 @@ function mm_ftp_file_associate_user(&$file) {
     $directory_name = array_pop($directories);
   }
   // Try to find this directory_name or file creator as a UID
-  if ($uid = db_result(db_query("SELECT uid FROM {users} WHERE name = '%s' OR name = '%s'", $directory_name, $file->creator))) {
+  if ($uid = db_query("SELECT uid FROM {users} WHERE name = :dirname OR name = :creator", array(':dirname' => $directory_name, ':creator' => $file->creator))->fetchField()) {
     $file->uid = $uid;
     return TRUE;
   }
 
   // Now look for a token on the file
-  require_once('mm_ftp_token.inc');
+  module_load_include('inc', 'mm_ftp', 'mm_ftp_token');
   if (mm_ftp_token_check($file)) {
     return TRUE;
   }
diff --git a/modules/mm_ftp/mm_ftp_test.inc b/modules/mm_ftp/mm_ftp_test.inc
index 7a9fab8..9c29668 100644
--- a/modules/mm_ftp/mm_ftp_test.inc
+++ b/modules/mm_ftp/mm_ftp_test.inc
@@ -1,7 +1,5 @@
 <?php
 
-// $Id$
-
 /**
  * @file
  * Provides testing functions for mm_ftp
@@ -15,7 +13,7 @@
  * ftp settings
  * @return unknown_type
  */
-function mm_ftp_test_form() {
+function mm_ftp_test_form($form, &$form_state) {
   $form = array();
 
   // find all the media mover configurations that us FTP
@@ -50,7 +48,7 @@ function mm_ftp_test_form() {
  */
 function mm_ftp_test_form_submit($form, &$form_state) {
   // load the FTP library
-  require_once('mm_ftp.inc');
+  module_load_include('inc', 'mm_ftp');
 
   $configuration = media_mover_api_configuration_load($form_state['values']['cid']);
   // find the FTP settings
@@ -73,15 +71,15 @@ function mm_ftp_test_form_submit($form, &$form_state) {
 
   // -------------------------------------------
   // get our test file
-  $path = drupal_get_path('module', 'mm_ftp') .'/test.png';
+  $path = drupal_get_path('module', 'mm_ftp') . '/test.png';
   // Create the remote filename
   $remote_file_name = $step->settings['mm_ftp_dir'] . '/' . basename($path);
   // Get the result, string if sucess, FALSE if failed
   // copy the file to the server
   if (mm_ftp_put_file($ftp_connection, $path, $remote_file_name)) {
     $modified_time = ftp_mdtm($ftp_connection, $remote_file_name);
-    $delta = $modified_time - time();
-    drupal_set_message(t('Copied file to: %server%path', array('%server' => $conf['mm_ftp_host'] .'/', '%path' => $remote_file_name)));
+    $delta = $modified_time - REQUEST_TIME;
+    drupal_set_message(t('Copied file to: %server%path', array('%server' => $conf['mm_ftp_host'] . '/', '%path' => $remote_file_name)));
     drupal_set_message(t('FTP Server time differs with Web server time by approximately %delta seconds.', array('%delta' => $delta)));
   }
 
@@ -108,7 +106,7 @@ function mm_ftp_test_form_submit($form, &$form_state) {
     drupal_set_message(t('Deleted the file from the local filesystem.'));
   }
   variable_set('mm_ftp_file_mod_time', $mm_ftp_file_mod_time);
-  
+
 
   // close the connection manually
   ftp_close($connection['ftp_connection']);
diff --git a/modules/mm_ftp/mm_ftp_token.inc b/modules/mm_ftp/mm_ftp_token.inc
index 6b0ce2c..2d39bbb 100644
--- a/modules/mm_ftp/mm_ftp_token.inc
+++ b/modules/mm_ftp/mm_ftp_token.inc
@@ -1,7 +1,5 @@
 <?php
 
-// $Id$
-
 /**
  * @file
  * Provides token services
@@ -27,8 +25,8 @@ function mm_ftp_admin_token_form() {
     '#default_value' => variable_get('mm_ftp_token_duration', 2880),
     '#description' => t('The token duration is time in minutes that a users token is valid for uploading. This associates a user with the content that they uploaded on the ftp server.'),
   );
-  $text = t("You can upload files via our FTP server with the following information. \nAppend the on to the end of your file name. We will associate your user account with your file through this token.\n".
-    "Our FTP server is located at:\n ftp://myserver.com \nYou can use the user name anonymous and password anonymous\n".
+  $text = t("You can upload files via our FTP server with the following information. \nAppend the on to the end of your file name. We will associate your user account with your file through this token.\n" .
+    "Our FTP server is located at:\n ftp://myserver.com \nYou can use the user name anonymous and password anonymous\n" .
     "Your file should look like\n  myfile.mov.32a18b");
   $form['mm_ftp_admin']['mm_ftp_info'] = array(
     '#title' => t('FTP information'),
@@ -61,7 +59,7 @@ function mm_ftp_admin_token_form() {
  * @return array
  *   drupal form array
  */
-function mm_ftp_token_ftp_form($form_state) {
+function mm_ftp_token_ftp_form($form, &$form_state) {
   global $user;
   $form['mmftp_info']['text'] = array(
     '#type' => 'markup',
@@ -88,10 +86,16 @@ function mm_ftp_token_ftp_form_submit($form, &$form_state) {
   global $user;
 
   // create a token
-  $token = drupal_substr(drupal_get_token(time()), 0, MM_FTP_TOKEN_LENGTH);
+  $token = drupal_substr(drupal_get_token(REQUEST_TIME), 0, MM_FTP_TOKEN_LENGTH);
 
   // save the token
-  db_query("INSERT INTO {mm_ftp_tokens} (uid, token, date) VALUES (%d, '%s', '%s')", $user->uid, $token, time() );
+  $id = db_insert('mm_ftp_tokens')
+  ->fields(array(
+    'uid' => $user->uid,
+    'token' => $token,
+    'date' => REQUEST_TIME,
+  ))
+  ->execute();
 
   // email the user the token
   drupal_mail('mm_ftp', 'ftp_token', $user->mail, user_preferred_language($account),
@@ -123,7 +127,7 @@ function mm_ftp_token_ftp_form_submit($form, &$form_state) {
 function mm_ftp_token_check(&$file) {
   // Did we get a token?
   if (mm_ftp_token_extract($file)) {
-    if ($uid = db_result(db_query('SELECT uid FROM {mm_ftp_tokens} WHERE token = "%s"', $file->token))) {
+    if ($uid = db_query('SELECT uid FROM {mm_ftp_tokens} WHERE token = :token', array(':token' => $file->token))->fetchField()) {
       $file['uid'] = $uid;
       return TRUE;
     }
diff --git a/modules/mm_getid3/mm_getid3.info b/modules/mm_getid3/mm_getid3.info
index 3f24991..f22bef2 100644
--- a/modules/mm_getid3/mm_getid3.info
+++ b/modules/mm_getid3/mm_getid3.info
@@ -2,5 +2,5 @@ name =  Media Mover GetId3 module
 description = Allows for reading and writing of metadata on files
 package = "Media Mover"
 dependencies[] = media_mover_api
-core = 6.x
+core = 7.x
 php = 5.0
diff --git a/modules/mm_getid3/mm_getid3.module b/modules/mm_getid3/mm_getid3.module
index 1b250d8..5c1b03b 100644
--- a/modules/mm_getid3/mm_getid3.module
+++ b/modules/mm_getid3/mm_getid3.module
@@ -11,7 +11,7 @@
 
 
 /**
- * Implementation of hook_media_mover()
+ * Implements hook_media_mover().
  */
 function mm_getid3_media_mover() {
   switch ($op) {
@@ -37,25 +37,23 @@ function mm_getid3_media_mover() {
       switch ($action_id) {
         case 'read':
           return mm_getid3_meta_read($file, $configuration);
-        break;
+          break;
         case 'write':
           return mm_getid3_meta_write($file, $configuration);
-        break;
+          break;
       }
-    break;
+      break;
 
     case 'config':
       switch ($action_id) {
         case 'read':
           return mm_getid3_meta_read_config($configuration);
-        break;
+          break;
         case 'write':
           return mm_getid3_meta_write_config($configuration);
-        break;
+          break;
       }
-    break;
-
-    break;
+      break;
   }
 }
 
diff --git a/modules/mm_imageache/mm_imagecache.info b/modules/mm_imageache/mm_imagecache.info
index 5dbe2b7..4097c8d 100644
--- a/modules/mm_imageache/mm_imagecache.info
+++ b/modules/mm_imageache/mm_imagecache.info
@@ -4,4 +4,4 @@ package = "Media Mover"
 dependencies[] = media_mover_api
 dependencies[] = imagecache
 dependencies[] = imagecache_ui
-core = 6.x
\ No newline at end of file
+core = 7.x
diff --git a/modules/mm_imageache/mm_imagecache.module b/modules/mm_imageache/mm_imagecache.module
index fe48a4c..973d0da 100644
--- a/modules/mm_imageache/mm_imagecache.module
+++ b/modules/mm_imageache/mm_imagecache.module
@@ -64,7 +64,7 @@ function mm_imagecache_process($step, $file) {
   foreach ($step->settings['imagecaches'] as $imagecache_name) {
     // Get the imagecache preset from the preset name
     $preset = imagecache_preset_by_name($imagecache_name);
-    // @TODO should we the destination URL to be configurable? By default, it would be here:
+    // @TODO should the destination URL be configurable? By default, it would be here:
     $destination = imagecache_create_path($preset['presetname'], $file->filepath);
 
     // Process the actual file
diff --git a/modules/mm_mailhandler/mm_mailhandler.info b/modules/mm_mailhandler/mm_mailhandler.info
index 773f5e6..c89d955 100644
--- a/modules/mm_mailhandler/mm_mailhandler.info
+++ b/modules/mm_mailhandler/mm_mailhandler.info
@@ -3,4 +3,5 @@ description = Adds email attachment harvesting to Media Mover
 package = "Media Mover"
 dependencies[] = media_mover_api
 dependencies[] =  mailhandler
-core=6.x
+core = 7.x
+
diff --git a/modules/mm_mailhandler/mm_mailhandler.module b/modules/mm_mailhandler/mm_mailhandler.module
index ba28bf9..e24f08f 100644
--- a/modules/mm_mailhandler/mm_mailhandler.module
+++ b/modules/mm_mailhandler/mm_mailhandler.module
@@ -11,11 +11,11 @@ define('MM_EMAIL_WATCHDOG_TYPE', 'media_mover');
 
 
 /**
- * Implementation of hook_help().
+ * Implements hook_help().
  */
 function mm_mailhandler_help($path, $arg) {
   switch ($path) {
-    case 'admin/modules#description' :
+    case 'admin/modules#description':
       return t('Harvest module for Media Mover. Allows users to retrieve email attachments for furthur processing.');
   }
   return;
@@ -23,13 +23,13 @@ function mm_mailhandler_help($path, $arg) {
 
 
 /**
- * Implementation of hook_menu()
+ * Implements hook_menu().
  *
  * @return array
  */
 function mm_mailhandler_menu() {
   $items = array();
-  $items['admin/build/media_mover/tests/mm_mailhandler'] = array(
+  $items[MMA_CONFIG_PATH . '/tests/mm_mailhandler'] = array(
     'title' => 'MailHandler Test',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('mm_mailhandler_test_form'),
@@ -54,7 +54,7 @@ function mm_mailhandler_media_mover() {
     'description' => t('Harvest attachments from an email account.'),
     'callback' => 'mm_mailhandler_harvest',
     'configuration' => 'mm_mailhandler_harvest_config',
-    'harvest' => true,
+    'select' => 1,
   );
   return $items;
 }
@@ -98,7 +98,7 @@ function mm_mailhandler_harvest_config($step) {
     '#description' => t('This username is used while logging into this mailbox during mail retrieval.'),
   );
 
-   $form['mm_mailhandler']['pass'] = array(
+  $form['mm_mailhandler']['pass'] = array(
     '#type' => 'textfield',
     '#title' => t('User password for mailbox'),
     '#default_value' => $step->settings['pass'],
@@ -142,9 +142,9 @@ function mm_mailhandler_harvest_config($step) {
   );
 
   $form['mm_mailhandler']['delete_after_read'] = array(
-    '#type' => 'checkbox', 
-    '#title' => t('Delete messages after they are processed?'), 
-    '#default_value' => $step->settings['delete_after_read'], 
+    '#type' => 'checkbox',
+    '#title' => t('Delete messages after they are processed?'),
+    '#default_value' => $step->settings['delete_after_read'],
     '#description' => t('Uncheck this box to leave read messages in the mailbox. They will not be processed again unless they become marked as unread.')
   );
 
@@ -314,11 +314,11 @@ function mm_mailhandler_attachments($node, $settings) {
         // now we need to save the file
         $path =  media_mover_api_dir_path(MM_EMAIL_ATTACHMENTS_SUBDIRECTORY);
         // get file path from media mover.
-        $file = $path .'/'. $part->filename;
+        $file = $path . '/' . $part->filename;
         // build the file name
         $file = file_destination($file, FILE_EXISTS_RENAME);
         // make sure the directory exists
-        file_check_directory($path, FILE_CREATE_DIRECTORY);
+        file_prepare_directory($path, FILE_CREATE_DIRECTORY);
         // save the file data
         $file = file_save_data($part->data, $file);
 
@@ -356,7 +356,7 @@ function mm_mailhandler_attachments($node, $settings) {
  * MailHandler  settings
  * @return unknown_type
  */
-function mm_mailhandler_test_form() {
+function mm_mailhandler_test_form($form, &$form_state) {
   // find all the media mover configurations that use MailHandler
   if (! $options = media_mover_api_configurations_get_by_module('mm_mailhandler')) {
     drupal_set_message(t('You need to have Media Mover configurations which use MailHandler in order to test your connection'));
diff --git a/modules/mm_s3/S3.php b/modules/mm_s3/S3.php
index e69abdc..7ccf4a6 100644
--- a/modules/mm_s3/S3.php
+++ b/modules/mm_s3/S3.php
@@ -534,7 +534,7 @@ class S3 {
       $loggingEnabled = $dom->createElement('LoggingEnabled');
       $loggingEnabled->appendChild($dom->createElement('TargetBucket', $targetBucket));
       $loggingEnabled->appendChild($dom->createElement('TargetPrefix', $targetPrefix));
-      // TODO: Add TargetGrants?
+      // @TODO: Add TargetGrants?
       $bucketLoggingStatus->appendChild($loggingEnabled);
     }
     $dom->appendChild($bucketLoggingStatus);
diff --git a/modules/mm_s3/mm_s3.info b/modules/mm_s3/mm_s3.info
index d164e38..f000e1a 100644
--- a/modules/mm_s3/mm_s3.info
+++ b/modules/mm_s3/mm_s3.info
@@ -1,7 +1,6 @@
-; $Id;
 name = S3 Media Mover module
 description = Allows Media Mover modules to store files on Amazon's S3 system
 package = "Media Mover"
 dependencies[] = media_mover_api
 files[] = S3.php
-core=6.x
\ No newline at end of file
+core=7.x
diff --git a/modules/mm_s3/mm_s3.install b/modules/mm_s3/mm_s3.install
index 8f85666..9ce15f7 100644
--- a/modules/mm_s3/mm_s3.install
+++ b/modules/mm_s3/mm_s3.install
@@ -1,7 +1,5 @@
 <?php
 
-// $Id$
-
 /**
  * @file
  * Installation for mm_s3
@@ -30,8 +28,8 @@ function mm_s3_requirements($phase) {
  *   Array
  */
 function mm_s3_install() {
-  $ret = array();
-  $ret[] = update_sql("ALTER TABLE {files} ADD s3_data longtext NOT NULL");
+  // @todo 1. {files} table has been removed in D7, 2. there is hook_schema_alter for things like this
+  db_add_field('files', 's3_data', array('type' => 'text', 'size' => 'big', 'not null' => TRUE, 'default' => ''));
 }
 
 
@@ -42,5 +40,5 @@ function mm_s3_install() {
  *   Array
  */
 function mm_s3_uninstall() {
-  $ret[] = update_sql("ALTER TABLE {files} DROP COLUMN s3_data");
+  db_drop_field('files', 's3_data');
 }
\ No newline at end of file
diff --git a/modules/mm_s3/mm_s3.module b/modules/mm_s3/mm_s3.module
index ddd836b..e78c740 100755
--- a/modules/mm_s3/mm_s3.module
+++ b/modules/mm_s3/mm_s3.module
@@ -21,7 +21,7 @@ define('ACL_PUBLIC_READ_WRITE', 'public-read-write');
  */
 function mm_s3_menu() {
   // test page
-  $items['admin/build/media_mover/tests/mm_s3'] = array(
+  $items[MMA_CONFIG_PATH . '/tests/mm_s3'] = array(
     'title' => 'S3 Test',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('mm_s3_test_form'),
@@ -31,7 +31,7 @@ function mm_s3_menu() {
   );
 
   // Settings page
-  $items['admin/build/media_mover/settings/mm_s3'] = array(
+  $items[MMA_CONFIG_PATH . '/settings/mm_s3'] = array(
     'title' => 'S3',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('mm_s3_admin_form'),
@@ -64,7 +64,7 @@ function mm_s3_media_mover() {
 
 
 /**
- * Implements hook_filepath_alter
+ * Implements hook_filepath_alter().
  */
 function mm_s3_media_mover_filepath_alter(&$file) {
 
@@ -84,7 +84,7 @@ function mm_s3_media_mover_filepath_alter(&$file) {
 /**
  * Settings for S3
  */
-function mm_s3_admin_form() {
+function mm_s3_admin_form($form, &$form_state) {
   $form['mm_s3'] = array(
     '#element_validate' => array('mm_s3_admin_validate')
   );
@@ -92,7 +92,7 @@ function mm_s3_admin_form() {
     '#type' => 'markup',
     '#description' => t('Global settings for Media Mover S3 configurations.
       You can test your settings by doing a !link.',
-      array('!link' => l(t('S3 test'), 'admin/build/media_mover/tests/mm_s3'))),
+      array('!link' => l(t('S3 test'), MMA_CONFIG_PATH . '/tests/mm_s3'))),
   );
 
   $form['mm_s3']['mm_s3_bucket'] = array(
@@ -152,7 +152,7 @@ function mm_s3_admin_validate($element, &$form_state) {
     // Does this bucket exist?
     if (! mm_s3_is_dir($form_state['values']['mm_s3_bucket'], $s3)) {
       // try to create the bucket
-      if (! $s3->putBucket($form_state['values']['mm_s3_bucket'],  $form_state['values']['mm_s3_default_perm'], FALSE, FALSE)) {
+      if (! $s3->putBucket($form_state['values']['mm_s3_bucket'],   $form_state['values']['mm_s3_default_perm'], FALSE, FALSE)) {
         form_error($element, t('Could not create your bucket on the Amazon servers. You need to choose a different name'));
       }
     }
@@ -340,7 +340,7 @@ function mm_s3_validate_action_settings($element, &$form_state) {
       // does this bucket exist?
       if (! mm_s3_is_dir($values['mm_s3_bucket'], $s3)) {
         // try to create the bucket
-        if (! $s3->putBucket($values['mm_s3_bucket'],  $values['mm_s3_perm'], FALSE, FALSE)) {
+        if (! $s3->putBucket($values['mm_s3_bucket'],   $values['mm_s3_perm'], FALSE, FALSE)) {
           form_error($element, t('Could not create your bucket on the Amazon servers. You need to choose a different name'));
         }
       }
@@ -367,7 +367,7 @@ function mm_s3_send($step, $file) {
   // can we read the file?
   if (! is_readable($file->filepath)) {
     watchdog('mm_s3', 'Source file !source is not readable',
-      array('!source' => $file->filepath), WATCHDOG_ERROR, l($file->mmfid, 'admin/build/media_mover/file/edit/'. $file->mmfid));
+      array('!source' => $file->filepath), WATCHDOG_ERROR, l($file->mmfid, MMA_CONFIG_PATH . '/file/edit/' . $file->mmfid));
     return;
   }
 
@@ -378,7 +378,7 @@ function mm_s3_send($step, $file) {
 
   // Set the S3 filename based on settings
   if ($step->settings['filepath'] == 'filename') {
-  	$s3_filename = basename($file->filepath);
+    $s3_filename = basename($file->filepath);
   }
   // Use the full filepath
   elseif ($step->settings['filepath'] == 'full_filepath') {
@@ -448,7 +448,7 @@ function mm_s3_initialize($key = FALSE, $skey = FALSE) {
     // Were errors passed back?
     if ($result) {
       drupal_set_message(t('There was an error in your S3 account information: <br />!error: !description <br/>Please update your !settings',
-        array('!error' => $result['code'], '!description' => $result['message'], '!settings' => l(t('settings'), 'admin/build/media_mover/settings'))),
+        array('!error' => $result['code'], '!description' => $result['message'], '!settings' => l(t('settings'), MMA_CONFIG_PATH . '/settings'))),
         'error'
       );
       return FALSE;
@@ -541,8 +541,8 @@ function mm_s3_copy($source, $destination, $perm = ACL_PUBLIC_READ, $request_hea
   // Error check
   if (! $info['hash']) {
     // Error condition when trying to put file up
-    $message = 'Could not upload file to amazon. Reporting error: <pre>'. print_r($s3, TRUE) .'</pre>';
-    $link = l('Change S3 Settings',  'admin/settings/media_mover');
+    $message = 'Could not upload file to amazon. Reporting error: <pre>' . print_r($s3, TRUE) . '</pre>';
+    $link = l('Change S3 Settings',   MMA_CONFIG_PATH . '/settings/mm_s3');
     watchdog('mm_s3', $message, array(), WATCHDOG_ERROR, $link);
     return FALSE;
   }
@@ -708,7 +708,7 @@ function mm_s3_create_uri($file_data = FALSE) {
 
 
 /**
- * Implementation of hook_xspf_playlist_item_alter().
+ * Implements hook_xspf_playlist_item_alter().
  *
  * This is an ugly way of overriding S3 file paths for
  * Media Mover
diff --git a/modules/mm_s3/mm_s3_test.inc b/modules/mm_s3/mm_s3_test.inc
index 5143510..dee2e8f 100644
--- a/modules/mm_s3/mm_s3_test.inc
+++ b/modules/mm_s3/mm_s3_test.inc
@@ -1,7 +1,5 @@
 <?php
 
-// $Id$
-
 /**
  * @file
  * This file provides some testing configuration for the s3 module
@@ -18,7 +16,7 @@
  * ftp settings
  * @return unknown_type
  */
-function mm_s3_test_form() {
+function mm_s3_test_form($form, &$form_state) {
   $form = array();
 
   // find all the media mover configurations that us FTP
@@ -57,7 +55,7 @@ function mm_s3_test_form_submit($form, &$form_state) {
   // file name is the file name
   $test_upload_name = basename($test_upload);
   // path to the download file. drupal files should be writeable
-  $test_download = file_directory_path() . '/s3_download_'. $test_upload_name;
+  $test_download = file_directory_path() . '/s3_download_' . $test_upload_name;
 
   // Get the configuration data
   $configuration = media_mover_api_configuration_load($form_state['values']['cid']);
@@ -69,18 +67,19 @@ function mm_s3_test_form_submit($form, &$form_state) {
     }
   }
 
-  $destination = $conf['mm_s3_bucket'] .'/'. baseName($test_upload);
+  $destination = $conf['mm_s3_bucket'] . '/' . baseName($test_upload);
 
   /* **************************************************** */
 
   // Check if our upload file exists
-  if (!file_exists($test_upload) || !is_file($test_upload))
+  if (!file_exists($test_upload) || !is_file($test_upload)) {
     exit("\nERROR: No such file: $test_upload\n\n");
+  }
 
   // Are the keys good?
   if ($s3 = mm_s3_initialize()) {
     // List your buckets:
-    drupal_set_message("Listing all buckets for your S3 account:<br />". theme('item_list', mm_s3_scandir()));
+    drupal_set_message(t('Listing all buckets for your S3 account:') . '<br />' . theme('item_list', array('items' => mm_s3_scandir())));
 
     // Does the requested bucket exist?
     if (mm_s3_is_dir($conf['mm_s3_bucket'])) {
@@ -112,7 +111,7 @@ function mm_s3_test_form_submit($form, &$form_state) {
     $info = $s3->getObjectInfo($conf['mm_s3_bucket'], baseName($conf['test_upload']));
     drupal_set_message(t('S3::getObjecInfo(): Info for !file: !items', array(
       '!file' => $destination,
-      '!items' => theme('item_list', $info)
+      '!items' => theme('item_list', array('items' => $info))
     )));
 
 
@@ -124,7 +123,7 @@ function mm_s3_test_form_submit($form, &$form_state) {
       }
       drupal_set_message(t('Showing the files in !bucket: !items', array(
         '!bucket' => $conf['mm_s3_bucket'],
-        '!items' => theme('item_list', $list)
+        '!items' => theme('item_list', array('items' => $list))
       )));
     }
 
diff --git a/modules/mm_token/mm_token.info b/modules/mm_token/mm_token.info
index 6355c45..425f0e5 100644
--- a/modules/mm_token/mm_token.info
+++ b/modules/mm_token/mm_token.info
@@ -1,7 +1,7 @@
 name = Media Mover API Token
 description = Token implementation for Media Mover
 package = "Media Mover"
-core= 6.x
+core = 7.x
 dependencies[] = token
 dependencies[] = media_mover_api
 
diff --git a/modules/mm_token/mm_token.module b/modules/mm_token/mm_token.module
index 82233a8..830af44 100644
--- a/modules/mm_token/mm_token.module
+++ b/modules/mm_token/mm_token.module
@@ -1,7 +1,5 @@
 <?php
 
-// $Id$
-
 /**
  * @file
  * Provides media mover tokens
@@ -22,7 +20,7 @@ function mm_token_get_config($cid) {
 }
 
 /**
- * Implementation of hook_token_values().
+ * Implements hook_token_values().
  */
 function mm_token_token_values($type, $object = NULL) {
   $values = array();
@@ -44,20 +42,21 @@ function mm_token_token_values($type, $object = NULL) {
             }
             if (function_exists("{$state['module']}_token_values")) {
               //Would be nice to have this stuff... but not sure how to integrate nicely without jumbling the interface.
-              $extra_config_tokens = call_user_func("{$state['module']}_token_values",$type,unserialize($state['configuration']));
+              $extra_config_tokens = call_user_func("{$state['module']}_token_values", $type, unserialize($state['configuration']));
               foreach ($extra_config_tokens as $config_key => $config_val) {
                 $values["{$verb}-{$state_key}-{$config_key}"] = $config_val;
               }
             }
           }
-        } else {
+        }
+        else {
           $values[$k] = $v;
         }
       }
       break;
     case 'mm_file':
 
-      $file = (object)$object;
+      $file = (object) $object;
 
       foreach ($file as $key => $v) {
 
@@ -69,7 +68,8 @@ function mm_token_token_values($type, $object = NULL) {
           foreach ($v as $file_key => $file_v) {
             $values['data-' . $file_key] = $file_v;
           }
-        } else {
+        }
+        else {
           $values[$key] = $v;
         }
       }
@@ -80,13 +80,13 @@ function mm_token_token_values($type, $object = NULL) {
 }
 
 /**
- * Implementation of hook_token_list().
+ * Implements hook_token_list().
  */
 function mm_token_token_list($type = 'all') {
 
   //@TODO: Flesh these out with real descriptions
   if ($type == 'mm_file' || $type == 'all') {
-    $tokens['Media Mover File'] = array (
+    $tokens['Media Mover File'] = array(
 	    'mmfid' => t('Media Mover File Id'),
 	    'nid' => t('Node Id of assocaited node (if any)'),
 	    'fid' => t('File Id of associated file type entry (if any)'),
@@ -102,19 +102,19 @@ function mm_token_token_list($type = 'all') {
     );
 
     $tokens['Media Mover File'] = array_merge($tokens['Media Mover File'],
-	    array (
+	    array(
 		    'data-filesize' => t('Filesize of completed file'),
 		    'data-filename' => t('Filename of compelted file'),
 		    'data-filepath' => t('Filepath of completed file'),
 		    'data-harvest_module' => t('Module used for harvesting'),
 		    'data-harvest_action' => t('Action of harvesting Module'),
 		    'data-harvest_file' => t('Harvested file'),
-		    'data-node' => t('Node??'), )
+		    'data-node' => t('Node??'),)
 	    );
   }
 
   if ($type == "mm_config") {
-    $tokens['Media Mover Configuration'] = array (
+    $tokens['Media Mover Configuration'] = array(
        'cid' => t('Media Mover Configuration '),
        'name' => t('Name of Configuration'),
        'description' => t('Configuration description'),
diff --git a/modules/mm_views/mm_views.info b/modules/mm_views/mm_views.info
index f9d3f57..1ff974b 100644
--- a/modules/mm_views/mm_views.info
+++ b/modules/mm_views/mm_views.info
@@ -1,7 +1,7 @@
-;$Id;
 name = Media Mover Views
 description = Provides Media Mover Views integration
 package = "Media Mover"
 dependencies[] = media_mover_api 
 dependencies[] = views
-core=6.x
\ No newline at end of file
+core = 7.x
+
diff --git a/modules/mm_views/mm_views.module b/modules/mm_views/mm_views.module
index a3fc5d1..88d9b27 100644
--- a/modules/mm_views/mm_views.module
+++ b/modules/mm_views/mm_views.module
@@ -7,7 +7,7 @@
 /* ********************************************** */
 
 /**
- * Implementation of hook_media_mover().
+ * Implements hook_media_mover().
  * @return array()
  */
 function mm_views_media_mover() {
@@ -16,7 +16,7 @@ function mm_views_media_mover() {
     'description' => t('Select: files from a view'),
     'configuration' => 'mm_views_select_config',
     'callback' => 'mm_views_select',
-    'harvest' => TRUE,
+    'select' => 1,
   );
   return $items;
 }
@@ -114,15 +114,15 @@ function mm_views_select($step) {
             'relationship' => 'none',
           ),
         ));
-      break;
+        break;
 
       case 'argument':
         $view->set_arguments(array($step->stop_time));
-      break;
+        break;
 
       default:
       case 'none':
-      break;
+        break;
     }
   }
 
@@ -176,8 +176,8 @@ function mm_views_views_tables() {
  */
 function views_handler_filter_media_mover_api_list() {
   // get a list of all configurations
-  $results = db_query('SELECT cid, name FROM {media_mover_config_list} ORDER BY cid');
-  while ($config = db_fetch_object($results)) {
+  $results = db_query('SELECT cid, name FROM {media_mover_config_list} ORDER BY cid')->execute();
+  while ($config = $results->fetchObject()) {
     $mmconfig[$config->cid] = $config->name;
   }
   return $mmconfig;
@@ -203,24 +203,24 @@ function views_handler_filter_media_mover_api_custom($op, $filter, $filterinfo,
       $clause = "'" . implode("','", $filter['value']) . "'";
       $where = "$tablename.cid IN ($clause)";
       $query->add_where($where);
-    break;
+      break;
 
     case 'AND':
       foreach ($filter['value'] as $cid) {
         $clause[] = "$tablename.cid = $cid";
       }
       $query->add_where(implode(' AND ', $clause));
-    break;
+      break;
 
     case 'NOR':
       $clause = "'" . implode("','", $filter['value']) . "'";
       $where = "$tablename.cid NOT IN ($clause)";
       $query->add_where($where);
-    break;
+      break;
 
     default:
       $query->add_where('');
-    break;
+      break;
   }
 
 }
