? addthis_integration_ds.patch
Index: addthis.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/addthis/addthis.module,v
retrieving revision 1.13.2.23
diff -u -p -r1.13.2.23 addthis.module
--- addthis.module	10 Mar 2010 16:45:53 -0000	1.13.2.23
+++ addthis.module	22 May 2010 17:04:23 -0000
@@ -106,6 +106,37 @@ function addthis_views_api() {
 }
 
 /**
+ * Implementation of hook_ds_fields().
+ */
+function addthis_ds_fields($type_name, $build_mode, $extra) {
+  if (variable_get('addthis_nodetype_' . $type_name, 1)) {
+    return array(
+      'nd' => array(
+        'addthis' => array(
+          'title' => t('AddThis'),
+          'type' => DS_FIELD_TYPE_FUNCTION,
+          'status' => DS_FIELD_STATUS_STATIC,
+          'properties' => array(
+            'formatters' => array(
+              '_addthis_ds_create_button' => t('AddThis'),
+            ),
+          ),
+        ),
+      ),
+    );
+  }
+}
+
+/**
+ * Internal function for Display Suite to return the code for AddThis button.
+ */
+function _addthis_ds_create_button($field) {
+  if (isset($field['object'])) {
+    return _addthis_create_button($field['object'], TRUE);
+  }
+}
+
+/**
  * Internal function to generate code for AddThis button
  *
  * @return
