Index: tweetmeme.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tweetmeme/tweetmeme.admin.inc,v
retrieving revision 1.2.2.1
diff -u -p -r1.2.2.1 tweetmeme.admin.inc
--- tweetmeme.admin.inc	14 Aug 2009 20:44:53 -0000	1.2.2.1
+++ tweetmeme.admin.inc	4 Oct 2010 11:03:25 -0000
@@ -1,7 +1,11 @@
 <?php
 // $Id: tweetmeme.admin.inc,v 1.2.2.1 2009/08/14 20:44:53 robloach Exp $
 
-function tweetmeme_admin_settings() {
+/**
+ * @todo Please document this function.
+ * @see http://drupal.org/node/1354
+ */
+function tweetmeme_admin_settings($form, &$form_state) {
   $form['tweetmeme_source'] = array(
     '#type' => 'textfield',
     '#title' => t('Twitter name'),
@@ -12,7 +16,7 @@ function tweetmeme_admin_settings() {
     '#type' => 'checkboxes',
     '#title' => t('Content types'),
     '#description' => t('Which content types to apply the TweetMeme button to.'),
-    '#options' => node_get_types('names'),
+    '#options' => node_type_get_names(),
     '#default_value' => variable_get('tweetmeme_types', array()),
   );
   $form['tweetmeme_urlShortener'] = array(
@@ -30,9 +34,9 @@ function tweetmeme_admin_settings() {
       'su.pr' => 'su.pr',
       'ow.ly' => 'ow.ly',
       'lopurls.us' => 'lopurls.us',
-      'twurl.nl' => 'twurl.nl'
+      'twurl.nl' => 'twurl.nl',
     ),
-    '#default_value' => variable_get('tweetmeme_urlShortener', '')
+    '#default_value' => variable_get('tweetmeme_urlShortener', ''),
   );
   $form['tweetmeme_location'] = array(
     '#type' => 'checkboxes',
Index: tweetmeme.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tweetmeme/tweetmeme.info,v
retrieving revision 1.1
diff -u -p -r1.1 tweetmeme.info
--- tweetmeme.info	27 Apr 2009 04:30:02 -0000	1.1
+++ tweetmeme.info	4 Oct 2010 11:03:25 -0000
@@ -1,4 +1,8 @@
 ; $Id: tweetmeme.info,v 1.1 2009/04/27 04:30:02 robloach Exp $
 name = TweetMeme
 description = Allows tracking of links on Twitter, through the TweetMeme web service.
-core = 6.x
+core = 7.x
+configure = admin/config/tweetmeme
+files[] = tweetmeme.admin.inc
+files[] = tweetmeme.install
+files[] = tweetmeme.module
Index: tweetmeme.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tweetmeme/Attic/tweetmeme.install,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 tweetmeme.install
--- tweetmeme.install	14 Aug 2009 03:34:26 -0000	1.1.2.2
+++ tweetmeme.install	4 Oct 2010 11:03:25 -0000
@@ -2,7 +2,13 @@
 // $Id: tweetmeme.install,v 1.1.2.2 2009/08/14 03:34:26 robloach Exp $
 
 /**
- * Implementation of hook_uninstall().
+ * @file
+ * Install, update and uninstall functions for the tweetmeme module.
+ *
+ */
+
+/**
+ * Implements hook_uninstall().
  */
 function tweetmeme_uninstall() {
   variable_del('tweetmeme_types');
Index: tweetmeme.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tweetmeme/tweetmeme.module,v
retrieving revision 1.2.2.4
diff -u -p -r1.2.2.4 tweetmeme.module
--- tweetmeme.module	14 Aug 2009 20:44:53 -0000	1.2.2.4
+++ tweetmeme.module	4 Oct 2010 11:03:25 -0000
@@ -35,7 +35,7 @@ function tweetmeme_perm() {
  * Implementation of hook_menu().
  */
 function tweetmeme_menu() {
-  $items['admin/settings/tweetmeme'] = array(
+  $items['admin/config/tweetmeme'] = array(
     'title' => 'TweetMeme',
     'description' => 'Provides the configuration options for how TweetMeme operates on the site.',
     'page callback' => 'drupal_get_form',
@@ -47,158 +47,162 @@ function tweetmeme_menu() {
 }
 
 /**
- * Implementation of hook_block().
+ * Implementation of hook_block_info().
  */
-function tweetmeme_block($op = 'list', $delta = 0, $edit = array()) {
-  // The $op parameter determines what piece of information is being requested.
-  switch ($op) {
-    case 'list':
-      $blocks['tweetmeme'] = array(
-        'info' => t('TweetMeme Widget'),
-      );
-      return $blocks;
-    case 'configure':
-      $form = array();
-      if ($delta == 'tweetmeme') {
-        $form['filter'] = array(
-          '#type' => 'fieldset',
-          '#title' => t('Filter'),
-          '#collapsible' => TRUE,
-          '#collapsed' => FALSE,
-          '#description' => t('You can find out more about these options at the <a href="@url">TweetMeme Widget</a> site.', array('@url' => 'http://widget.tweetmeme.com/')),
-        );
-        $form['filter']['tweetmeme_filter'] = array(
-          '#type' => 'select',
-          '#title' => t('Filter by'),
-          '#default_value' => variable_get('tweetmeme_filter',  'category'),
-          '#options' => array(
-            'category' => t('Category'),
-            'channel' => t('Channel'),
-            'domain' => t('Domain'),
-          ),
-        );
-        $form['filter']['tweetmeme_filter_option'] = array(
-          '#type' => 'textfield',
-          '#title' => t('Filter Option'),
-          '#default_value' => variable_get('tweetmeme_filter_option',  '1'),
-        );
-        $form['display'] = array(
-          '#type' => 'fieldset',
-          '#title' => t('Display Options'),
-          '#collapsible' => TRUE,
-          '#collapsed' => TRUE,
-        );
-        $form['display']['tweetmeme_media'] = array(
-          '#type' => 'select',
-          '#title' => t('Media'),
-          '#default_value' => variable_get('tweetmeme_media',  'all'),
-          '#options' => array(
-            'all' => t('All'),
-            'news' => t('News'),
-            'images' => t('Images'),
-            'videos' => t('Videos'),
-          ),
-        );
-        $form['display']['tweetmeme_number_of_items'] = array(
-          '#type' => 'select',
-          '#title' => t('Number of items'),
-          '#default_value' => variable_get('tweetmeme_number_of_items',  5),
-          '#options' => drupal_map_assoc(array(5, 10, 15, 20)),
-        );
-        $form['display']['tweetmeme_width'] = array(
-          '#type' => 'textfield',
-          '#title' => t('Width'),
-          '#default_value' => variable_get('tweetmeme_width',  '300px'),
-        );
-        $form['display']['tweetmeme_header'] = array(
-          '#type' => 'textfield',
-          '#title' => t('Header'),
-          '#default_value' => variable_get('tweetmeme_header',  '#45B4DA'),
-        );
-        $form['display']['tweetmeme_border_width'] = array(
-          '#type' => 'textfield',
-          '#title' => t('Border Width'),
-          '#default_value' => variable_get('tweetmeme_border_width',  '1px'),
-        );
-        $form['display']['tweetmeme_border_color'] = array(
-          '#type' => 'textfield',
-          '#title' => t('Border Color'),
-          '#default_value' => variable_get('tweetmeme_border_color',  '#DCDCDC'),
-        );
-      }
-      return $form;
-    case 'save':
-      if ($delta == 'tweetmeme') {
-        variable_set('tweetmeme_filter', $edit['tweetmeme_filter']);
-        variable_set('tweetmeme_filter_option', $edit['tweetmeme_filter_option']);
-        variable_set('tweetmeme_media', $edit['tweetmeme_media']);
-        variable_set('tweetmeme_number_of_items', $edit['tweetmeme_number_of_items']);
-        variable_set('tweetmeme_width', $edit['tweetmeme_width']);
-        variable_set('tweetmeme_header', $edit['tweetmeme_header']);
-        variable_set('tweetmeme_border_width', $edit['tweetmeme_border_width']);
-        variable_set('tweetmeme_border_color', $edit['tweetmeme_border_color']);
-      }
-      return;
-    case 'view': default:
-      switch ($delta) {
-        case 'tweetmeme':
-          $block['subject'] = t('TweetMeme');
-          $block['content'] = '<script type="text/javascript">';
-          $filter = variable_get('tweetmeme_filter',  'category');
-          $filter_option = variable_get('tweetmeme_filter_option', '1');
-          $media = variable_get('tweetmeme_media', 'all');
-          $number_of_items = variable_get('tweetmeme_number_of_items', '5');
-          $width = variable_get('tweetmeme_width', '300px');
-          $header = variable_get('tweetmeme_header', '#45B4DA');
-          $border_width = variable_get('tweetmeme_border_width', '1px');
-          $border_color = variable_get('tweetmeme_border_color', '#DCDCDC');
-          $block['content'] .= "tweetmeme_$filter = '$filter_option';tweetmeme_width = '$width';tweetmeme_header =  '$header';tweetmeme_border_width = '$border_width';tweetmeme_border_color = '$border_color'";
-          $block['content'] .= '</script><script type="text/javascript" src="http://tweetmeme.com/i/scripts/widget.js"></script>';
-          break;
-      }
-      return $block;
+function tweetmeme_block_info() {
+  $blocks = array();
+  $blocks['tweetmeme'] = array(
+    'info' => t('TweetMeme Widget'),
+    'cache' => DRUPAL_CACHE_GLOBAL,
+  );
+  return $blocks;
+}
+
+/**
+ * Implementation of hook_block_info().
+ */
+function tweetmeme_block_configure($delta = '') {
+  $form = array();
+  if ($delta == 'tweetmeme') {
+    $form['filter'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Filter'),
+      '#collapsible' => TRUE,
+      '#collapsed' => FALSE,
+      '#description' => t('You can find out more about these options at the <a href="@url">TweetMeme Widget</a> site.', array('@url' => 'http://widget.tweetmeme.com/')),
+    );
+    $form['filter']['tweetmeme_filter'] = array(
+      '#type' => 'select',
+      '#title' => t('Filter by'),
+      '#default_value' => variable_get('tweetmeme_filter',  'category'),
+      '#options' => array(
+        'category' => t('Category'),
+        'channel' => t('Channel'),
+        'domain' => t('Domain'),
+      ),
+    );
+    $form['filter']['tweetmeme_filter_option'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Filter Option'),
+      '#default_value' => variable_get('tweetmeme_filter_option',  '1'),
+    );
+    $form['display'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Display Options'),
+      '#collapsible' => TRUE,
+      '#collapsed' => TRUE,
+    );
+    $form['display']['tweetmeme_media'] = array(
+      '#type' => 'select',
+      '#title' => t('Media'),
+      '#default_value' => variable_get('tweetmeme_media',  'all'),
+      '#options' => array(
+        'all' => t('All'),
+        'news' => t('News'),
+        'images' => t('Images'),
+        'videos' => t('Videos'),
+      ),
+    );
+    $form['display']['tweetmeme_number_of_items'] = array(
+      '#type' => 'select',
+      '#title' => t('Number of items'),
+      '#default_value' => variable_get('tweetmeme_number_of_items',  5),
+      '#options' => drupal_map_assoc(array(5, 10, 15, 20)),
+    );
+    $form['display']['tweetmeme_width'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Width'),
+      '#default_value' => variable_get('tweetmeme_width',  '300px'),
+    );
+    $form['display']['tweetmeme_header'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Header'),
+      '#default_value' => variable_get('tweetmeme_header',  '#45B4DA'),
+    );
+    $form['display']['tweetmeme_border_width'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Border Width'),
+      '#default_value' => variable_get('tweetmeme_border_width',  '1px'),
+    );
+    $form['display']['tweetmeme_border_color'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Border Color'),
+      '#default_value' => variable_get('tweetmeme_border_color',  '#DCDCDC'),
+    );
+  }
+  return $form;
+}
+
+/**
+ * Implementation of hook_block_info().
+ */
+function tweetmeme_block_save($delta = '', $edit = array()) {
+  if ($delta == 'tweetmeme') {
+    variable_set('tweetmeme_filter', $edit['tweetmeme_filter']);
+    variable_set('tweetmeme_filter_option', $edit['tweetmeme_filter_option']);
+    variable_set('tweetmeme_media', $edit['tweetmeme_media']);
+    variable_set('tweetmeme_number_of_items', $edit['tweetmeme_number_of_items']);
+    variable_set('tweetmeme_width', $edit['tweetmeme_width']);
+    variable_set('tweetmeme_header', $edit['tweetmeme_header']);
+    variable_set('tweetmeme_border_width', $edit['tweetmeme_border_width']);
+    variable_set('tweetmeme_border_color', $edit['tweetmeme_border_color']);
   }
 }
 
 /**
+ * Implementation of hook_block_info().
+ */
+function tweetmeme_block_view($delta = '') {
+  $block = array();
+  if ($delta == 'tweetmeme') {
+    $block['subject'] = t('TweetMeme');
+    $block['content'] = '<script type="text/javascript">';
+    $filter = variable_get('tweetmeme_filter',  'category');
+    $filter_option = variable_get('tweetmeme_filter_option', '1');
+    $media = variable_get('tweetmeme_media', 'all');
+    $number_of_items = variable_get('tweetmeme_number_of_items', '5');
+    $width = variable_get('tweetmeme_width', '300px');
+    $header = variable_get('tweetmeme_header', '#45B4DA');
+    $border_width = variable_get('tweetmeme_border_width', '1px');
+    $border_color = variable_get('tweetmeme_border_color', '#DCDCDC');
+    $block['content'] .= "tweetmeme_$filter = '$filter_option';tweetmeme_width = '$width';tweetmeme_header =  '$header';tweetmeme_border_width = '$border_width';tweetmeme_border_color = '$border_color'";
+    $block['content'] .= '</script><script type="text/javascript" src="http://tweetmeme.com/i/scripts/widget.js"></script>';
+  }
+  return $block;
+}
+
+/**
  * Implementation of hook_nodeapi().
  */
-function tweetmeme_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
-  if ($op == 'view') {
-    // Make sure we're on the right content type.
-    if (!in_array($node->type, variable_get('tweetmeme_types', array()), TRUE)) {
-      return NULL;
-    }
-
-    // Make sure we're actually building the page to render in a browser.
-    if ($node->build_mode != NODE_BUILD_NORMAL) {
-      return NULL;
-    }
-
-    // Make sure the user has access to use TweetMeme.
-    if (!user_access('access tweetmeme')) {
-      return NULL;
-    }
-
-    // Retrieve the location where we should show it, the style and the URL of the button.
-    $location = variable_get('tweetmeme_location', array());
-    $style = variable_get('tweetmeme_style', 'normal');
-    $url = url('node/' . $node->nid, array('absolute' => TRUE));
-
-    // Check in the teaser view.
-    if ($teaser && !empty($location['teasers'])) {
-      $node->content['tweetmeme'] = array(
-        '#value' => theme('tweetmeme_button', $url, $style),
-        '#weight' => -10,
-      );
-    }
-    // Check in the full view.
-    else if(!$teaser && !empty($location['content'])) {
-      $node->content['tweetmeme'] = array(
-        '#value' => theme('tweetmeme_button', $url, $style),
-        '#weight' => -10,
-      );
-    }
+function tweetmeme_node_view(&$node, $view_mode) {
+  // Make sure we're on the right content type.
+  if (!in_array($node->type, variable_get('tweetmeme_types', array()), TRUE)) {
+    return NULL;
+  }
+
+  // Make sure the user has access to use TweetMeme.
+  if (!user_access('access tweetmeme')) {
+    return NULL;
+  }
+
+  // Retrieve the location where we should show it, the style and the URL of the button.
+  $location = variable_get('tweetmeme_location', array());
+  $style = variable_get('tweetmeme_style', 'normal');
+  $url = url('node/' . $node->nid, array('absolute' => TRUE));
+
+  // Check in the teaser view.
+  if ($view_mode == 'teaser' && !empty($location['teasers'])) {
+    $node->content['tweetmeme'] = array(
+      '#markup' => theme('tweetmeme_button', $url, $style),
+      '#weight' => -10,
+    );
+  }
+  // Check in the full view.
+  else if($view_mode == 'full' && !empty($location['content'])) {
+    $node->content['tweetmeme'] = array(
+      '#markup' => theme('tweetmeme_button', $url, $style),
+      '#weight' => -10,
+    );
   }
 }
 
@@ -208,10 +212,7 @@ function tweetmeme_nodeapi(&$node, $op, 
 function tweetmeme_theme($existing, $type, $theme, $path) {
   return array(
     'tweetmeme_button' => array(
-      'arguments' => array(
-        'url' => NULL,
-        'style' => NULL,
-      ),
+      'variables' => array('url' => NULL, 'style' => 'normal'),
     ),
   );
 }
@@ -219,8 +220,10 @@ function tweetmeme_theme($existing, $typ
 /**
  * Displays the TweetMeme button
  */
-function theme_tweetmeme_button($url, $style = 'normal') {
+function theme_tweetmeme_button($variables) {
   drupal_add_css(drupal_get_path('module', 'tweetmeme') . '/tweetmeme.css');
+  $url = $variables['url'];
+  $style = $variables['style'];
   $output = '<div class="tweetmeme tweetmeme-button"><script type="text/javascript">';
   $output .= "tweetmeme_url = '$url';\n";
   if ($style != 'normal') {
