? 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 01:58:34 -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 01:58:34 -0000 @@ -0,0 +1,38 @@ + t('AddThis'), + 'help' => t('An AddThis 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 01:58:34 -0000 @@ -0,0 +1,42 @@ +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