? LICENSE.txt
Index: addthis.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/addthis/addthis.module,v
retrieving revision 1.13.2.18
diff -u -p -r1.13.2.18 addthis.module
--- addthis.module	18 May 2009 16:31:31 -0000	1.13.2.18
+++ addthis.module	25 Jun 2009 02:02:25 -0000
@@ -96,6 +96,16 @@ function addthis_theme() {
 }
 
 /**
+ * Implementation of hook_views_api().
+ */
+function addthis_views_api() {
+  return array(
+    'api' => 2,
+    'path' => drupal_get_path('module', 'addthis'),
+  );
+}
+
+/**
  * Internal function to generate code for AddThis button
  *
  * @return
Index: addthis.views.inc
===================================================================
RCS file: addthis.views.inc
diff -N addthis.views.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ addthis.views.inc	25 Jun 2009 02:02:25 -0000
@@ -0,0 +1,38 @@
+<?php
+// $Id$
+/**
+ * @file
+ * Provide views data and handlers for addthis.module
+ */
+
+/**
+ * Implementation of hook_views_data().
+ */
+function addthis_views_data() {
+  // We're registering the 'custom_teasers' table.
+  $data['node']['addthis'] = array(
+    'title' => t('AddThis'),
+    'help' => t('An <a href="http://www.addthis.com/">AddThis</a> button.'),
+    'field' => array(
+      'handler' => 'addthis_handler_field_service_links',
+    ),
+  );
+
+  return $data;
+}
+
+/**
+ * Implementation of hook_views_handlers().
+ */
+function addthis_views_handlers() {
+  return array(
+    'info' => array(
+      'path' => drupal_get_path('module', 'addthis'),
+    ),
+    'handlers' => array(
+      'addthis_handler_field_service_links' => array(
+        'parent' => 'views_handler_field',
+      ),
+    ),
+  );
+}
\ No newline at end of file
Index: addthis_handler_field_service_links.inc
===================================================================
RCS file: addthis_handler_field_service_links.inc
diff -N addthis_handler_field_service_links.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ addthis_handler_field_service_links.inc	25 Jun 2009 02:02:25 -0000
@@ -0,0 +1,42 @@
+<?php
+// $Id$
+
+/**
+ * A handler to provide an AddThis field for a particular node.
+ *
+ * @ingroup views_field_handlers
+ */
+class addthis_handler_field_service_links extends views_handler_field {
+  function construct() {
+    parent::construct();
+    $this->additional_fields['nid'] = 'nid';
+    $this->additional_fields['title'] = 'title';
+  }
+
+  function query() {
+    $this->ensure_my_table();
+    $this->add_additional_fields();
+  }
+
+  function option_definition() {
+    $options = parent::option_definition();
+
+    return $options;
+  }
+
+  function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+
+    // Remove the alteration stuff
+    unset($form['alter']);
+  }
+
+  function render($values) {
+    if (user_access('view addthis')) {
+      $node = new stdClass();
+      $node->nid = $values->{$this->aliases['nid']};
+      $node->title = $values->{$this->aliases['title']};
+      return _addthis_create_button($node, TRUE);
+    }
+  }
+}
\ No newline at end of file
