? tb_another_cleanup-d6.patch
Index: tweetbutton.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tweetbutton/Attic/tweetbutton.admin.inc,v
retrieving revision 1.1.4.3
diff -u -p -r1.1.4.3 tweetbutton.admin.inc
--- tweetbutton.admin.inc	19 Aug 2010 21:18:50 -0000	1.1.4.3
+++ tweetbutton.admin.inc	20 Aug 2010 02:32:46 -0000
@@ -2,13 +2,13 @@
 // $Id: tweetbutton.admin.inc,v 1.1.4.3 2010/08/19 21:18:50 timmillwood Exp $
 
 function tweetbutton_admin_settings() {
-	$form = array();
-  
+  $form = array();
+
   $form['button'] = array(
     '#type' => 'fieldset',
     '#title' => t('Choose your button. Customize it'),
   );
-  
+
   $form['button']['tweetbutton_button'] = array(
     '#type' => 'select',
     '#options' => array(
@@ -19,20 +19,18 @@ function tweetbutton_admin_settings() {
     '#default_value' => variable_get('tweetbutton_button', 'vertical'),
     '#id' => 'tweetbutton-button',
   );
-  
-  
+
   $form['button']['tweetbutton_tweet_text'] = array(
     '#type'          => 'textfield',
     '#title'         => t('Tweet Text'),
-    '#default_value' => variable_get('tweetbutton_tweet_text',''),
-    '#description'   => t('This is the text that people will include in their Tweet when they share from your website. If left empty title will be used. ' .
-      'Available tokens are: !title, !author_name, !node_type, !node_url (NOTE: Twitter will generate short url for the node)'),
+    '#default_value' => variable_get('tweetbutton_tweet_text', ''),
+    '#description'   => t('This is the text that people will include in their Tweet when they share from your website. If left empty title will be used. Available tokens are: !title, !author_name, !node_type, !node_url (NOTE: Twitter will generate short url for the node)'),
   );
-  
+
   $form['button']['tweetbutton_tweet_url'] = array(
     '#type'          => 'textfield',
     '#title'         => t('URL'),
-    '#default_value' => variable_get('tweetbutton_tweet_url',''),
+    '#default_value' => variable_get('tweetbutton_tweet_url', ''),
     '#description'   => t('Leave blank for using the URL of the node the button is on.'),
   );
 
@@ -47,67 +45,62 @@ function tweetbutton_admin_settings() {
       'es' => t('Spanish'),
       'ja' => t('Japanese'),
     ),
-    '#default_value' => variable_get('tweetbutton_language',''),
+    '#default_value' => variable_get('tweetbutton_language', ''),
   );
-  
+
   $form['follow'] = array(
     '#type' => 'fieldset',
     '#title' => t('Recommend people to follow'),
   );
-  
+
   $form['follow']['tweetbutton_account'] = array(
     '#type' => 'textfield',
     '#title' => t('Twitter account to follow'),
     '#description' => t('This user will be @mentioned in the suggested'),
-    '#default_value' => variable_get('tweetbutton_account',''),
+    '#default_value' => variable_get('tweetbutton_account', ''),
     '#id' => 'tweetbutton-account',
   );
-  
+
   $form['follow']['tweetbutton_rel_account_name'] = array(
     '#type' => 'textfield',
     '#title' => t('Related Account'),
-    '#default_value' => variable_get('tweetbutton_rel_account_name',''),
+    '#default_value' => variable_get('tweetbutton_rel_account_name', ''),
   );
-  
+
   $form['follow']['tweetbutton_rel_account_description'] = array(
     '#type' => 'textfield',
     '#title' => t('Related Account Description'),
-    '#default_value' => variable_get('tweetbutton_rel_account_description',''),
+    '#default_value' => variable_get('tweetbutton_rel_account_description', ''),
   );
-  
+
   $form['preview'] = array(
     '#type' => 'fieldset',
     '#title' => t('Preview'),
   );
-  
+
   $attributes = tweetbutton_get_attributes();
-  
-  $markup = '<div id="tweetbutton-preview"><a href="http://twitter.com/share" class="twitter-share-button" '. drupal_attributes($attributes).'>Tweet</a></div>';
+
+  $markup = '<div id="tweetbutton-preview"><a href="http://twitter.com/share" class="twitter-share-button" '. drupal_attributes($attributes) .'>Tweet</a></div>';
   $form['preview']['tweetbutton_preview'] = array(
     '#type' => 'markup',
-    '#value' => $markup, 
+    '#value' => $markup,
   );
 
-  drupal_set_html_head('<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>'); 
-	drupal_add_css(drupal_get_path('module', 'tweetbutton').'/tweetbutton.css');
+  drupal_set_html_head('<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>');
+  drupal_add_css(drupal_get_path('module', 'tweetbutton') .'/tweetbutton.css');
   return system_settings_form($form);
 }
 
 function tweetbutton_node_settings() {
-	$form = array();
-  
-  $node_types = node_get_types();
-  foreach($node_types as $node_type) {
-    $types[$node_type->type] = $node_type->name;
-  }
-  
+  $form = array();
+
   $form['tweetbutton_node_types'] = array(
     '#type' => 'checkboxes',
     '#title' => t('Node Types'),
-    '#options' => $types,
-    '#default_value' => variable_get('tweetbutton_node_types', array('article')),
+    '#options' => node_get_types('names'),
+    '#default_value' => variable_get('tweetbutton_node_types', array('story')),
   );
-  
+
   $form['tweetbutton_node_location'] = array(
     '#type'    => 'checkboxes',
     '#title'   => t('Locations'),
@@ -117,14 +110,14 @@ function tweetbutton_node_settings() {
     ),
     '#default_value' => variable_get('tweetbutton_node_location', array('full')),
   );
-  
-  
+
+
   $form['tweetbutton_node_weight'] = array(
     '#type'          => 'weight',
     '#title'         => t('Weight'),
     '#default_value' => variable_get('tweetbutton_node_weight', -5),
     '#description'   => t('Heavier weight will sink button to bottom on node view'),
   );
-  
+
   return system_settings_form($form);
-}
\ No newline at end of file
+}
Index: tweetbutton.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tweetbutton/Attic/tweetbutton.css,v
retrieving revision 1.1.4.3
diff -u -p -r1.1.4.3 tweetbutton.css
--- tweetbutton.css	19 Aug 2010 21:18:50 -0000	1.1.4.3
+++ tweetbutton.css	20 Aug 2010 02:32:46 -0000
@@ -1,8 +1,5 @@
-/* $Id: $ */
-
-#tweetbutton-preview {
-}
+/* $Id$ */
 
 .tweetbutton {
   float:right;
-}
\ No newline at end of file
+}
Index: tweetbutton.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tweetbutton/tweetbutton.info,v
retrieving revision 1.1.4.1
diff -u -p -r1.1.4.1 tweetbutton.info
--- tweetbutton.info	16 Aug 2010 17:16:02 -0000	1.1.4.1
+++ tweetbutton.info	20 Aug 2010 02:32:46 -0000
@@ -1,3 +1,4 @@
+; $Id$
 name = Tweetbutton
 description = Add tweet button to  your website without having to leave the page
 core = 6.x
Index: tweetbutton.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tweetbutton/Attic/tweetbutton.install,v
retrieving revision 1.1.4.3
diff -u -p -r1.1.4.3 tweetbutton.install
--- tweetbutton.install	19 Aug 2010 21:18:50 -0000	1.1.4.3
+++ tweetbutton.install	20 Aug 2010 02:32:46 -0000
@@ -2,7 +2,7 @@
 // $Id: tweetbutton.install,v 1.1.4.3 2010/08/19 21:18:50 timmillwood Exp $
 
 function tweetbutton_uninstall() {
-	variable_del('tweetbutton_button');
+  variable_del('tweetbutton_button');
   variable_del('tweetbutton_tweet_text');
   variable_del('tweetbutton_tweet_url');
   variable_del('tweetbutton_language');
@@ -11,6 +11,5 @@ function tweetbutton_uninstall() {
   variable_del('tweetbutton_rel_account_description');
   variable_del('tweetbutton_node_weight');
   variable_del('tweetbutton_node_types');
-  variable_del('tweetbutton_node_location');  
-    
-}
\ No newline at end of file
+  variable_del('tweetbutton_node_location');
+}
Index: tweetbutton.js
===================================================================
RCS file: tweetbutton.js
diff -N tweetbutton.js
--- tweetbutton.js	17 Aug 2010 14:28:39 -0000	1.1.4.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
-// $Id$
-
-(function ($) {
-  
-  Drupal.behaviors.tweetbutton = {
-    attach: function(context) {
-//      $('#tweetbutton-%').change();
-    }  
-  }
-  
-})(jQuery);
\ No newline at end of file
Index: tweetbutton.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tweetbutton/tweetbutton.module,v
retrieving revision 1.1.4.3
diff -u -p -r1.1.4.3 tweetbutton.module
--- tweetbutton.module	19 Aug 2010 21:15:14 -0000	1.1.4.3
+++ tweetbutton.module	20 Aug 2010 02:32:46 -0000
@@ -2,28 +2,27 @@
 // $Id: tweetbutton.module,v 1.1.4.3 2010/08/19 21:15:14 timmillwood Exp $
 
 /**
- * Implementation of hook_help()
+ * Implementation of hook_help().
  */
 function tweetbutton_help($path, $arg) {
-  $output = NULL;
-  switch($path) {
+  switch ($path) {
     case 'admin/help#tweetbutton':
       return t('This button allows your website to let people share content on Twitter without having to leave the page. Promote strategic Twitter accounts at the same time while driving traffic to your website.');
   }
 }
 
 /**
- * Implementation of hook_menu()
- */ 
+ * Implementation of hook_menu().
+ */
 function tweetbutton_menu() {
   $items = array();
-  
+
   $items['admin/settings/tweetbutton/list'] = array(
     'title'            => 'Tweetbutton Settings',
     'type'             => MENU_DEFAULT_LOCAL_TASK,
     'weight'           => -1,
   );
-  
+
   $items['admin/settings/tweetbutton'] = array(
     'title'            => 'Tweetbutton Settings',
     'description'      => 'Configure tweetbutton settings',
@@ -33,7 +32,7 @@ function tweetbutton_menu() {
     'file'             => 'tweetbutton.admin.inc',
     'weight'           => 0,
   );
-  
+
   $items['admin/settings/tweetbutton/node'] = array(
     'title'            => 'Tweetbutton Node Settings',
     'description'      => 'Configure tweetbutton for nodes',
@@ -44,12 +43,12 @@ function tweetbutton_menu() {
     'weight'           => 1,
     'type'             => MENU_LOCAL_TASK,
   );
-  
+
   return $items;
 }
 
 /**
- * Implementation of hook_theme()
+ * Implementation of hook_theme().
  */
 function tweetbutton_theme() {
   return array(
@@ -60,7 +59,7 @@ function tweetbutton_theme() {
 }
 
 /**
- * Implementation of hook_permission()
+ * Implementation of hook_permission().
  */
 function tweetbutton_perm() {
   return array(
@@ -69,34 +68,32 @@ function tweetbutton_perm() {
   );
 }
 
-
 /**
- * Implementation of hook_nodeapi()
+ * Implementation of hook_nodeapi().
  */
 function tweetbutton_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
-  if($a3) {
+  if ($a3) {
     $node_location = 'teaser';
   }
   else {
     $node_location = 'full';
   }
 
-  if (in_array($node->type, variable_get('tweetbutton_node_types', array('article')), TRUE) 
+  if ($op == 'view' && in_array($node->type, variable_get('tweetbutton_node_types', array('story')), TRUE)
     && in_array($node_location, variable_get('tweetbutton_node_location', array('full')), TRUE)
-    && user_access('access tweetbutton')
-    && $op == 'view') {
-    
-    drupal_set_html_head('<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>'); 
-    drupal_add_css(drupal_get_path('module', 'tweetbutton').'/tweetbutton.css');
-    
+    && user_access('access tweetbutton')) {
+
+    drupal_set_html_head('<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>');
+    drupal_add_css(drupal_get_path('module', 'tweetbutton') .'/tweetbutton.css');
+
     // @todo: Add support for token replacements
     $token_replacements = array(
       '!title'        => $node->title,
       '!author_name'  => $node->name,
       '!node_type'    => $node->type,
-      '!node_url'     => url('node/'.$node->nid, array('absolute' => TRUE)),
+      '!node_url'     => url('node/'. $node->nid, array('absolute' => TRUE)),
     );
-    
+
     $node->content['tweetbutton'] = array(
       '#tokens'   => $token_replacements,
       '#weight'   => variable_get('tweetbutton_node_weight', -5),
@@ -105,20 +102,19 @@ function tweetbutton_nodeapi(&$node, $op
   }
 }
 
-
 function tweetbutton_get_attributes($tokens = array()) {
-  // If data-url is not set then use node url, in teaser mode we want to set this parameter 
-  // to fetch different counters for each node
+  // If data-url is not set then use node url, in teaser mode we want to set this parameter
+  // to fetch different counters for each node.
   $node_url    = isset($tokens['!node_url'])? $tokens['!node_url']: '';
-  
+
   $button_type = variable_get('tweetbutton_button', 'vertical');
-  $tweet_text  = variable_get('tweetbutton_tweet_text','');
-  $tweet_url   = variable_get('tweetbutton_tweet_url','');
-  $language    = variable_get('tweetbutton_language','');
-  $account     = variable_get('tweetbutton_account','');
-  $rel_account = variable_get('tweetbutton_rel_account_name','');
-  $rel_desc    = variable_get('tweetbutton_rel_account_description','');
-  
+  $tweet_text  = variable_get('tweetbutton_tweet_text', '');
+  $tweet_url   = variable_get('tweetbutton_tweet_url', '');
+  $language    = variable_get('tweetbutton_language', '');
+  $account     = variable_get('tweetbutton_account', '');
+  $rel_account = variable_get('tweetbutton_rel_account_name', '');
+  $rel_desc    = variable_get('tweetbutton_rel_account_description', '');
+
   $attributes =  array(
     'data-count'   => $button_type,
     'data-via'     => $account,
@@ -132,8 +128,8 @@ function tweetbutton_get_attributes($tok
 
 function theme_tweetbutton_display($variables) {
   $attributes = tweetbutton_get_attributes($variables['#tokens']);
-  
-  $link = '<div class="tweetbutton"><a href="http://twitter.com/share" class="twitter-share-button" ' .
-    drupal_attributes($attributes). '>Tweet</a></div>';
+
+  $link = '<div class="tweetbutton"><a href="http://twitter.com/share" class="twitter-share-button" '.
+    drupal_attributes($attributes) .'>Tweet</a></div>';
   return $link;
 }
