diff -up -r itunes.admin.inc itunes.admin.inc
--- itunes.admin.inc	2011-09-08 11:08:20.560293000 -0700
+++ itunes.admin.inc	2011-09-08 11:09:23.323788000 -0700
@@ -140,4 +140,4 @@ function theme_itunes_admin_settings($fo
   $header[] = t('Source to use as author');
 
   return theme('table', $header, $rows) . drupal_render($form);
-}
\ No newline at end of file
+}
diff -up -r itunes.module itunes.module
--- itunes.module	2011-09-08 11:08:20.497410000 -0700
+++ itunes.module	2011-09-08 11:09:23.779666000 -0700
@@ -19,7 +19,7 @@ function itunes_menu() {
     'page arguments' => array('itunes_admin_settings'),
     'access arguments' => array('administer site configuration'),
     'file' => 'itunes.admin.inc',
-    'description' => 'Determine which node types can track iTunes information.'
+    'description' => 'Determine which node types can track iTunes information.',
   );
   return $items;
 }
@@ -52,8 +52,8 @@ function itunes_views_api() {
 function itunes_help($section, $arg) {
   switch ($section) {
     case 'admin/settings/itunes':
-      return '<p>'. t("This form allows you to determine which content types need to be have the iTunes feed item data fields added to them.") .'<br />'
-        . t("If the <a href='!filefield-url'>FileField</a> module is installed then you can choose which field to include as an enclosure in RSS feeds.", array('!filefield-url' => url('http://drupal.org/project/filefield'))) .'</p>';
+      return '<p>' . t("This form allows you to determine which content types need to be have the iTunes feed item data fields added to them.") . '<br />'
+        . t("If the <a href='!filefield-url'>FileField</a> module is installed then you can choose which field to include as an enclosure in RSS feeds.", array('!filefield-url' => url('http://drupal.org/project/filefield'))) . '</p>';
   }
 }
 
@@ -92,13 +92,19 @@ function itunes_form_alter(&$form, &$for
         '#description' => t('The contents of this tag are shown in a separate window that appears when the "circled i" in the Description column is clicked. It also appears on the iTunes page for your podcast.'),
       );
       $form['itunes']['explicit'] = array(
-        '#type' => 'select', '#title' => t('Explicit'),
-        '#options' => array(0 => 'Unspecified', ITUNES_EXPLICIT_YES => 'Yes', ITUNES_EXPLICIT_CLEAN => 'Clean'),
+        '#type' => 'select',
+        '#title' => t('Explicit'),
+        '#options' => array(
+          0 => 'Unspecified',
+          ITUNES_EXPLICIT_YES => 'Yes',
+          ITUNES_EXPLICIT_CLEAN => 'Clean',
+        ),
         '#default_value' => isset($node->itunes['explicit']) ? $node->itunes['explicit'] : 0,
         '#description' => t('If select "yes", an "explicit" parental advisory graphic will appear next to your podcast artwork on the iTunes Music Store, and in the Name column in iTunes. If you select "clean", the parental advisory type is considered Clean, meaning that no explicit language or adult content is included anywhere in the episode, and a "clean" graphic will appear.'),
       );
       $form['itunes']['block'] = array(
-        '#type' => 'checkbox', '#title' => t('Block'),
+        '#type' => 'checkbox',
+        '#title' => t('Block'),
         '#default_value' => isset($node->itunes['block']) ? $node->itunes['block'] : 0,
         '#description' => t('Check this to prevent this episode from appearing in the iTunes Podcast directory. For example, you may want a specific episode blocked from iTunes if its content might cause the feed to be removed from iTunes.'),
       );
diff -up -r views/itunes.views.inc views/itunes.views.inc
--- views/itunes.views.inc	2011-09-08 11:08:21.141203000 -0700
+++ views/itunes.views.inc	2011-09-08 11:09:23.877697000 -0700
@@ -25,4 +25,4 @@ function itunes_views_plugins() {
       ),
     ),
   );
-}
\ No newline at end of file
+}
diff -up -r views/itunes_plugin_style_rss.inc views/itunes_plugin_style_rss.inc
--- views/itunes_plugin_style_rss.inc	2011-09-08 11:08:21.239353000 -0700
+++ views/itunes_plugin_style_rss.inc	2011-09-08 11:09:24.329761000 -0700
@@ -14,18 +14,54 @@ class itunes_plugin_style_rss extends vi
   function option_definition() {
     $options = parent::option_definition();
 
-    $options['subtitle'] = array('default' => '', 'translatable' => TRUE);
-    $options['summary'] = array('default' => '', 'translatable' => TRUE);
-    $options['author'] = array('default' => '', 'translatable' => TRUE);
-    $options['copyright'] = array('default' => '', 'translatable' => TRUE);
-    $options['image_url'] = array('default' => '', 'translatable' => FALSE);
-    $options['explicit'] = array('default' => 0, 'translatable' => FALSE);
-    $options['block'] = array('default' => 0, 'translatable' => FALSE);
-    $options['owner_name'] = array('default' => '', 'translatable' => FALSE);
-    $options['owner_email'] = array('default' => '', 'translatable' => FALSE);
-    $options['categories'] = array('default' => array('', '', ''), 'translatable' => FALSE);
-    $options['keywords'] = array('default' => '', 'translatable' => TRUE);
-    $options['new_feed_url'] = array('default' => '', 'translatable' => FALSE);
+    $options['subtitle'] = array(
+      'default' => '',
+      'translatable' => TRUE,
+    );
+    $options['summary'] = array(
+      'default' => '',
+      'translatable' => TRUE,
+    );
+    $options['author'] = array(
+      'default' => '',
+      'translatable' => TRUE,
+    );
+    $options['copyright'] = array(
+      'default' => '',
+      'translatable' => TRUE,
+    );
+    $options['image_url'] = array(
+      'default' => '',
+      'translatable' => FALSE,
+    );
+    $options['explicit'] = array(
+      'default' => 0,
+      'translatable' => FALSE,
+    );
+    $options['block'] = array(
+      'default' => 0,
+      'translatable' => FALSE,
+    );
+    $options['owner_name'] = array(
+      'default' => '',
+      'translatable' => FALSE,
+    );
+    $options['owner_email'] = array(
+      'default' => '',
+      'translatable' => FALSE,
+    );
+    $options['categories'] = array(
+      'default' => array('', '', ''),
+      'translatable' => FALSE,
+    );
+    $options['keywords'] = array(
+      'default' => '',
+      'translatable' => TRUE,
+    );
+    $options['new_feed_url'] = array(
+      'default' => '',
+      'translatable' => FALSE,
+    );
 
     return $options;
   }
@@ -75,13 +111,19 @@ class itunes_plugin_style_rss extends vi
       '#description' => t('Podcasters occasionally need to move their feed from one location to another. To do so without losing subscribers, you must convey the change directly to all users who are subscribed to your feed. Specify the <a href="http://www.apple.com/itunes/podcasts/specs.html#changing">new feed url tag</a> here if desired.'),
     );
     $form['explicit'] = array(
-      '#type' => 'select', '#title' => t('Explicit'),
-      '#options' => array(0 => 'Unspecified', ITUNES_EXPLICIT_YES => 'Yes', ITUNES_EXPLICIT_CLEAN => 'Clean'),
+      '#type' => 'select',
+      '#title' => t('Explicit'),
+      '#options' => array(
+        0 => 'Unspecified',
+        ITUNES_EXPLICIT_YES => 'Yes',
+        ITUNES_EXPLICIT_CLEAN => 'Clean',
+      ),
       '#default_value' => $this->options['explicit'],
       '#description' => t('If select "yes", an "explicit" parental advisory graphic will appear next to your podcast artwork on the iTunes Music Store, and in the Name column in iTunes. If you select "clean", the parental advisory type is considered Clean, meaning that no explicit language or adult content is included anywhere in the episode, and a "clean" graphic will appear.'),
     );
     $form['block'] = array(
-      '#type' => 'checkbox', '#title' => t('Hide'),
+      '#type' => 'checkbox',
+      '#title' => t('Hide'),
       '#default_value' => $this->options['block'],
       '#description' => t('Check this to prevent the entire podcast from appearing in the iTunes Podcast directory.'),
     );
@@ -101,11 +143,11 @@ class itunes_plugin_style_rss extends vi
     $category_options = array('' => t('- None selected -'));
     foreach (itunes_categories() as $top_level => $children) {
       $category_options[] = (object) array(
-        'option' => array($top_level => $top_level)
+        'option' => array($top_level => $top_level),
       );
       foreach ($children as $second_level) {
         $category_options[] = (object) array(
-          'option' => array($top_level . '|' . $second_level => ' - ' . $second_level)
+          'option' => array($top_level . '|' . $second_level => ' - ' . $second_level),
         );
       }
     }
@@ -113,8 +155,8 @@ class itunes_plugin_style_rss extends vi
       '#type' => 'fieldset',
       '#title' => t('Categories'),
       '#collapsible' => TRUE,
-      '#description' => '<p>'. t('There are two ways to browse podcast subject categories on iTunes: click Browse in the Quick Links box or click a selection in the Category box. The former method leads to a text-based table, while the latter leads to pages that include the podcast art.') .'</p>'
-        .'<p>'. t('For placement within the older, text-based browse system, podcast feeds may list up to 3 category/subcategory pairs. (For example, "Music" counts as 1, as does "Business > Careers.") For placement within the newer browse system based on Category links, however, and for placement within the Top Podcasts lists that appear in the right column of most podcast pages, only the first category listed in the feed is used.') .'</p>',
+      '#description' => '<p>' . t('There are two ways to browse podcast subject categories on iTunes: click Browse in the Quick Links box or click a selection in the Category box. The former method leads to a text-based table, while the latter leads to pages that include the podcast art.') . '</p>'
+        . '<p>' . t('For placement within the older, text-based browse system, podcast feeds may list up to 3 category/subcategory pairs. (For example, "Music" counts as 1, as does "Business > Careers.") For placement within the newer browse system based on Category links, however, and for placement within the Top Podcasts lists that appear in the right column of most podcast pages, only the first category listed in the feed is used.') . '</p>',
     );
     $form['categories'][0] = array(
       '#type' => 'select',
diff -up -r itunes.admin.inc itunes.admin.inc
--- itunes.admin.inc	2011-09-08 11:11:06.950694000 -0700
+++ itunes.admin.inc	2011-09-08 11:11:36.051131000 -0700
@@ -8,8 +8,8 @@
 /**
  * Settings form.
  */
-function itunes_admin_settings() {
-  $node_types = node_get_types();
+function itunes_admin_settings($form, &$form_state) {
+  $node_types = node_type_get_types();
   $content_module_exists = module_exists('content');
   $content_types = $content_module_exists ? content_types() : array();
 
@@ -104,12 +104,21 @@ function itunes_admin_settings() {
   return $form;
 }
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function itunes_admin_settings_validate($form, &$form_state) {
   // Retrieve selected types - Forms API sets the value of unselected checkboxes to 0.
   $form_state['values']['itunes_types'] = array_keys(array_filter($form_state['values']['itunes_types']));
 }
 
-function theme_itunes_admin_settings($form) {
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
+function theme_itunes_admin_settings($variables) {
+  $form = $variables['0'];
   $rows = array();
   $header = array($form['itunes_types']['#title']);
   unset($form['itunes_types']['#title']);
@@ -139,5 +148,5 @@ function theme_itunes_admin_settings($fo
   }
   $header[] = t('Source to use as author');
 
-  return theme('table', $header, $rows) . drupal_render($form);
+  return theme('table', array('header' => $header, 'rows' => $rows)) . drupal_render_children($form);
 }
diff -up -r itunes.info itunes.info
--- itunes.info	2011-09-08 11:11:06.730760000 -0700
+++ itunes.info	2011-09-08 11:11:37.124080000 -0700
@@ -1,12 +1,14 @@
 name = iTunes
 description = An iTunes specific RSS plugin for views feeds.
-core = 6.x
+core = 7.x
 dependencies[] = views
 dependencies[] = views_ui
 
 ; Information added by drupal.org packaging script on 2011-02-25
 version = "6.x-1.x-dev"
-core = "6.x"
+core = 7.x
 project = "itunes"
 datestamp = "1298619480"
 
+
+files[] = views/itunes_plugin_style_rss.inc
diff -up -r itunes.install itunes.install
--- itunes.install	2011-09-08 11:11:06.802640000 -0700
+++ itunes.install	2011-09-08 11:11:36.253190000 -0700
@@ -6,38 +6,41 @@
  */
 
 /**
- * Implementation of hook_install().
+ * Implements hook_install().
  */
 function itunes_install() {
   // Migrate old audio_itunes data.
   if (db_table_exists('audio_itunes_item')) {
     $ret = array();
-    db_rename_table($ret, 'audio_itunes_item', 'itunes_item');
+    db_rename_table('audio_itunes_item', 'itunes_item');
 
     // Check if the audio module got around to adding a nid field.
-    if (!db_column_exists('itunes_item', 'nid')) {
+    if (!db_field_exists('itunes_item', 'nid')) {
       $nid_field = array(
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => TRUE,
         'default' => 0,
       );
-      db_add_field($ret, 'itunes_item', 'nid', $nid_field);
+      db_add_field('itunes_item', 'nid', $nid_field);
 
       // Assign nids from the node table.
-      $ret[] = update_sql("UPDATE {itunes_item} i INNER JOIN {node} n ON i.vid = n.vid SET i.nid = n.nid");
+      // TODO update_sql has been removed. Use the database API for any schema or data changes.
+      $ret[] = array() /* update_sql("UPDATE {itunes_item} i INNER JOIN {node} n ON i.vid = n.vid SET i.nid = n.nid") */;
     }
   }
   else {
-    drupal_install_schema('itunes');
+    // TODO The drupal_(un)install_schema functions are called automatically in D7.
+    // drupal_install_schema('itunes')
   }
 }
 
 /**
- * Implementation of hook_uninstall().
+ * Implements hook_uninstall().
  */
 function itunes_uninstall() {
-  drupal_uninstall_schema('itunes');
+  // TODO The drupal_(un)install_schema functions are called automatically in D7.
+  // drupal_uninstall_schema('itunes')
   variable_del('itunes_types');
   variable_del('itunes_enclosure_source');
   variable_del('itunes_keyword_source');
@@ -45,11 +48,11 @@ function itunes_uninstall() {
 }
 
 /**
- * Implementation of hook_schema().
+ * Implements hook_schema().
  */
 function itunes_schema() {
   $schema['itunes_item'] = array(
-    'description' => t('Audio iTunes item.'),
+    'description' => 'Audio iTunes item.',
     'fields' => array(
       'vid' => array(
         'type' => 'int',
@@ -108,5 +111,8 @@ function itunes_update_6100() {
     variable_del('itunes_vocabularies');
   }
 
-  return $ret;
+  // hook_update_N() no longer returns a $ret array. Instead, return
+  // nothing or a translated string indicating the update ran successfully.
+  // See http://drupal.org/node/224333#update_sql.
+  return t('TODO Add a descriptive string here to show in the UI.') /* $ret */;
 }
diff -up -r itunes.module itunes.module
--- itunes.module	2011-09-08 11:11:07.165820000 -0700
+++ itunes.module	2011-09-08 11:11:36.580052000 -0700
@@ -9,11 +9,11 @@ define('ITUNES_EXPLICIT_CLEAN', 2);
  */
 
 /**
- * Implementation of hook_menu().
+ * Implements hook_menu().
  */
 function itunes_menu() {
   $items = array();
-  $items['admin/settings/itunes'] = array(
+  $items['admin/config/itunes'] = array(
     'title' => 'iTunes',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('itunes_admin_settings'),
@@ -25,19 +25,19 @@ function itunes_menu() {
 }
 
 /**
- * Implementation of hook_theme().
+ * Implements hook_theme().
  */
 function itunes_theme() {
   return array(
     'itunes_admin_settings' => array(
-      'arguments' => array('form'),
+      'variables' => array('form'),
       'file' => 'itunes.admin.inc',
     ),
   );
 }
 
 /**
- * Implementation of hook_views_api().
+ * Implements hook_views_api().
  */
 function itunes_views_api() {
   return array(
@@ -47,18 +47,18 @@ function itunes_views_api() {
 }
 
 /**
- * Implementation of hook_help().
+ * Implements hook_help().
  */
 function itunes_help($section, $arg) {
   switch ($section) {
-    case 'admin/settings/itunes':
+    case 'admin/config/itunes':
       return '<p>' . t("This form allows you to determine which content types need to be have the iTunes feed item data fields added to them.") . '<br />'
         . t("If the <a href='!filefield-url'>FileField</a> module is installed then you can choose which field to include as an enclosure in RSS feeds.", array('!filefield-url' => url('http://drupal.org/project/filefield'))) . '</p>';
   }
 }
 
 /**
- * Implementation of hook_form_alter().
+ * Implements hook_form_alter().
  *
  * We add in extra iTunes specific information to the node edit forms.
  */
@@ -113,7 +113,7 @@ function itunes_form_alter(&$form, &$for
 }
 
 /**
- * Implements hook_content_extra_fields()
+ * Implements hook_content_extra_fields().
  *
  * CCK hook to allow moving the iTunes field set around in the node edit form.
  */
@@ -128,14 +128,15 @@ function itunes_content_extra_fields($ty
 }
 
 /**
- * Implementation of hook_nodeapi().
+ * Implements hook_nodeapi().
  */
-function itunes_nodeapi(&$node, $op, $arg) {
+function itunes_nodeapi_OLD(&$node, $op, $arg) {
+  // TODO Remaining code in this function needs to be moved to the appropriate new hook function.
   $types = variable_get('itunes_types', array('audio'));
   if (in_array($node->type, $types)) {
     switch ($op) {
       case 'load':
-        $result = db_query("SELECT * FROM {itunes_item} WHERE vid = %d", $node->vid);
+        $result = db_query("SELECT * FROM {itunes_item} WHERE vid = :vid", array(':vid' => $node->vid));
         if ($result) {
           return array('itunes' => db_fetch_array($result));
         }
@@ -144,7 +145,11 @@ function itunes_nodeapi(&$node, $op, $ar
       case 'update':
         // Delete and insert rather than updating in case the node doesn't have
         // an existing record.
-        db_query("DELETE FROM {itunes_item} WHERE vid = %d", $node->vid);
+        // TODO Please review the conversion of this statement to the D7 database API syntax.
+        /* db_query("DELETE FROM {itunes_item} WHERE vid = %d", $node->vid) */
+        db_delete('itunes_item')
+  ->condition('vid', $node->vid)
+  ->execute();
         // INTENTIONALLY NO BREAK HERE.
       case 'insert':
         if (!empty($node->itunes)) {
@@ -154,11 +159,19 @@ function itunes_nodeapi(&$node, $op, $ar
         break;
 
       case 'delete':
-        db_query("DELETE FROM {itunes_item} WHERE nid = %d", $node->nid);
+        // TODO Please review the conversion of this statement to the D7 database API syntax.
+        /* db_query("DELETE FROM {itunes_item} WHERE nid = %d", $node->nid) */
+        db_delete('itunes_item')
+  ->condition('nid', $node->nid)
+  ->execute();
         break;
 
       case 'delete revision':
-        db_query("DELETE FROM {itunes_item} WHERE vid = %d", $node->vid);
+        // TODO Please review the conversion of this statement to the D7 database API syntax.
+        /* db_query("DELETE FROM {itunes_item} WHERE vid = %d", $node->vid) */
+        db_delete('itunes_item')
+  ->condition('vid', $node->vid)
+  ->execute();
         break;
 
       case 'rss item':
@@ -242,7 +255,7 @@ function itunes_nodeapi(&$node, $op, $ar
         $author_source = variable_get('itunes_author_source', array());
         if (!empty($author_source[$node->type])) {
           if ($author_source[$node->type] == 'node_author') {
-            $author = strip_tags(theme('username', $node));
+            $author = strip_tags(theme('username', array('account' => $node)));
           }
           else {
             $author_field = $node->$author_source[$node->type];
@@ -295,6 +308,10 @@ function itunes_nodeapi(&$node, $op, $ar
   }
 }
 
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
 function itunes_explicit($value) {
   if ($value == ITUNES_EXPLICIT_YES) {
     return 'yes';
diff -up -r views/itunes.views.inc views/itunes.views.inc
--- views/itunes.views.inc	2011-09-08 11:11:07.277701000 -0700
+++ views/itunes.views.inc	2011-09-08 11:11:36.671076000 -0700
@@ -6,7 +6,7 @@
  */
 
 /**
- * Implementation of hook_views_plugins().
+ * Implements hook_views_plugins().
  */
 function itunes_views_plugins() {
   return array(
diff -up -r views/itunes.views_default.inc views/itunes.views_default.inc
--- views/itunes.views_default.inc	2011-09-08 11:11:07.259669000 -0700
+++ views/itunes.views_default.inc	2011-09-08 11:11:36.803188000 -0700
@@ -5,7 +5,7 @@
  * Default iTunes view.
  */
 /**
- * Implementation of hook_views_default_views().
+ * Implements hook_views_default_views().
  */
 function itunes_views_default_views() {
   $itunes_types = array();