? addthis_bookmark.admin.inc
? addthis_rss.admin.inc
Index: addthis.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/addthis/addthis.admin.inc,v
retrieving revision 1.1.2.8
diff -u -p -r1.1.2.8 addthis.admin.inc
--- addthis.admin.inc	18 May 2009 16:21:36 -0000	1.1.2.8
+++ addthis.admin.inc	11 Feb 2010 01:33:19 -0000
@@ -38,114 +38,5 @@ function addthis_admin_settings() {
     '#description'   => t('Display an AddThis button in the node teasers.'),
   );
 
-  $form['addthis_button_settings'] = array(
-    '#type'         => 'fieldset',
-    '#title'        => t('Button image settings'),
-    '#collapsible'  => TRUE,
-    '#collapsed'    => TRUE,
-  );
-  $form['addthis_button_settings']['addthis_image'] = array(
-    '#type'          => 'textfield',
-    '#title'         => t('Button image url'),
-    '#default_value' => variable_get('addthis_image', 'http://s9.addthis.com/button1-share.gif'),
-    '#description'   => t('URL for small image in the button. Example: http://s9.addthis.com/button1-share.gif'),
-  );
-  $form['addthis_button_settings']['addthis_image_secure'] = array(
-    '#type'          => 'textfield',
-    '#title'         => t('Button image url for secure https connection'),
-    '#default_value' => variable_get('addthis_image_secure', 'https://secure.addthis.com/button1-share.gif'),
-    '#description'   => t('This is only required if your site uses secure https connections. Example: https://secure.addthis.com/button1-share.gif'),
-  );
-  $form['addthis_button_settings']['addthis_image_width'] = array(
-    '#type'          => 'textfield',
-    '#title'         => t('Button image width'),
-    '#default_value' => variable_get('addthis_image_width', '125'),
-    '#description'   => t('Width for button image. Example: 125'),
-  );
-  $form['addthis_button_settings']['addthis_image_height'] = array(
-    '#type'          => 'textfield',
-    '#title'         => t('Button image height'),
-    '#default_value' => variable_get('addthis_image_height', '16'),
-    '#description'   => t('Height for button image. Example: 16'),
-  );
-  $form['addthis_button_settings']['addthis_image_attributes'] = array(
-    '#type'          => 'textfield',
-    '#title'         => t('Button image HTML attributes'),
-    '#default_value' => variable_get('addthis_image_attributes', 'alt=""'),
-    '#description'   => t('Extra HTML attributes for img tag. Example: alt=""'),
-  );
-
-  $form['addthis_widget_settings'] = array(
-    '#type'         => 'fieldset',
-    '#title'        => t('Widget settings'),
-    '#collapsible'  => TRUE,
-    '#collapsed'    => TRUE,
-  );
-  $form['addthis_widget_settings']['addthis_dropdown_disabled'] = array(
-    '#type'          => 'checkbox',
-    '#title'         => t('Disable dropdown'),
-    '#default_value' => variable_get('addthis_dropdown_disabled', '0'),
-    '#description'   => t('You can disable the dropdown for selecting where to share your link and use a pop-up window instead. This can be useful if the button is for example located next to a flash object.'),
-  );
-  $form['addthis_widget_settings']['addthis_logo'] = array(
-    '#type'          => 'textfield',
-    '#title'         => t('Logo url'),
-    '#default_value' => variable_get('addthis_logo', 'http://www.addthis.com/images/yourlogo.png'),
-    '#description'   => t('The logo to display on the popup window (about 200x50 pixels). The popup window is show when the user selects the \'More\' choice. Example: http://www.your-website.com/img/mylogo.gif'),
-  );
-  $form['addthis_widget_settings']['addthis_logo_background'] = array(
-    '#type'          => 'textfield',
-    '#title'         => t('Logo background color'),
-    '#default_value' => variable_get('addthis_logo_background', 'EFEFFF'),
-    '#description'   => t('The color to use as a background around the logo in the popup. Example: EFEFEF'),
-  );
-  $form['addthis_widget_settings']['addthis_logo_color'] = array(
-    '#type'          => 'textfield',
-    '#title'         => t('Logo text color'),
-    '#default_value' => variable_get('addthis_logo_color', '666699'),
-    '#description'   => t('The color to use for the text next to the logo in the popup. Example: 666666'),
-  );
-  $form['addthis_widget_settings']['addthis_brand'] = array(
-    '#type'          => 'textfield',
-    '#title'         => t('Brand text'),
-    '#default_value' => variable_get('addthis_brand', ''),
-    '#description'   => t('The brand name to display in the drop-down (top right). Example: My Website. Leave blank to use the site_name variable, currently set to !site_name', array('!site_name' => variable_get('site_name', 'Drupal'))),
-  );
-  $form['addthis_widget_settings']['addthis_options'] = array(
-    '#type'          => 'textarea',
-    '#title'         => t('Options'),
-    '#default_value' => variable_get('addthis_options', 'favorites, email, digg, delicious, myspace, facebook, google, live, more'),
-    '#description'   => t('A comma-separated ordered list of options to include in the drop-down. Example: favorites, email, digg, delicious, more<br/>Currently supported options:<br/>
-	aim, aolfav, ask, backflip, ballhype, blinklist, blogmarks, bluedot, buzz, delicious, digg, diigo, email, facebook, favorites, fark, feedmelinks, friendfeed, furl, google, kaboodle, kirtsy, linkedin, live, magnolia, misterwong, mixx, multiply, myweb, myspace, netvous, newsvine, pownce, propeller, reddit, segnalo, sharedstuff, slashdot, spurl, stumbleupon, stylehive, tailrank, technorati, thisnext, twitter, yardbarker, yahoobkm, more<br />
-        The most up-to-date list can be found <a href="!url">here</a>.', array('!url' => url('http://addthis.com/customization.php'))),
-  );
-  $form['addthis_widget_settings']['addthis_offset_top'] = array(
-    '#type'          => 'textfield',
-    '#title'         => t('Offset top'),
-    '#default_value' => variable_get('addthis_offset_top', '2'),
-    '#description'   => t('Vertical offset for the drop-down window (in pixels). Example: 2'),
-  );
-  $form['addthis_widget_settings']['addthis_offset_left'] = array(
-    '#type'          => 'textfield',
-    '#title'         => t('Offset top'),
-    '#default_value' => variable_get('addthis_offset_left', '2'),
-    '#description'   => t('Horizontal offset for the drop-down window (in pixels). Example: 2'),
-  );
-  $form['addthis_widget_settings']['addthis_disable_flash'] = array(
-    '#type'          => 'checkbox',
-    '#title'         => t('Disable Flash cookie'),
-    '#default_value' => variable_get('addthis_disable_flash', '0'),
-    '#description'   => t('AddThis.com uses Flash cookies by default to <a href="http://www.addthis.com/blog/2009/01/05/the-addthis-flash-cookie-we-need-your-feedback/">provide more accurate tracking information</a>. Some people consider this <a href="http://drupal.org/node/364078">a privacy concern</a> and Flash cookies can be replaced with normal ones by checking this checkbox.'),
-  );
-  $form['addthis_widget_settings']['addthis_widget_version'] = array(
-    '#type'          => 'select',
-    '#title'         => t('Widget Version'),
-    '#default_value' => variable_get('addthis_widget_version', '152'),
-    '#options'       => array(
-        152 => t('152 - Uses a popup window for the more option'),
-        200 => t('200 - Adds lightbox support for the more option')
-    ),
-    '#description'   => t('The version of the addthis widget to use.'),
-  );
   return system_settings_form($form);
 }
\ No newline at end of file
Index: addthis.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/addthis/addthis.module,v
retrieving revision 1.13.2.20
diff -u -p -r1.13.2.20 addthis.module
--- addthis.module	22 Oct 2009 17:57:50 -0000	1.13.2.20
+++ addthis.module	11 Feb 2010 01:33:19 -0000
@@ -40,13 +40,44 @@ function addthis_link($type, $node=NULL,
 function addthis_menu() {
   $items = array();
 
-  $items['admin/settings/addthis'] = array(
-    'title'            => 'AddThis',
-    'description'      => 'Set username and customize look and feel for <a href="http://www.addthis.com/">AddThis</a> button.',
+  $items['admin/settings/addthis/settings'] = array(
+    'title'            => t('AddThis Settings'),
+    'type'             => MENU_NORMAL_ITEM,
+    'description'      => t('Set username and customize look and feel for <a href="http://www.addthis.com/">AddThis</a> button.'),
     'page callback'    => 'drupal_get_form',
     'page arguments'   => array('addthis_admin_settings'),
     'access arguments' => array('administer addthis'),
     'file'             => 'addthis.admin.inc',
+    'weight'           => 0,
+  );
+  $items['admin/settings/addthis/settings/general'] = array(
+    'title'            => t('AddThis Settings'),
+    'type'             => MENU_DEFAULT_LOCAL_TASK,
+    'description'      => t('Set username and customize look and feel for <a href="http://www.addthis.com/">AddThis</a> button.'),
+    'page callback'    => 'drupal_get_form',
+    'page arguments'   => array('addthis_admin_settings'),
+    'access arguments' => array('administer addthis'),
+    'file'             => 'addthis.admin.inc',
+    'weight'           => 0,
+  );
+  $items['admin/settings/addthis/settings/bookmark'] = array(
+    'title'            => t('AddThis Bookmark'),
+    'type'             => MENU_LOCAL_TASK,
+    'description'      => t('Set username and customize look and feel for <a href="http://www.addthis.com/">AddThis</a> button.'),
+    'page callback'    => 'drupal_get_form',
+    'page arguments'   => array('addthis_bookmark_admin_settings'),
+    'access arguments' => array('administer addthis'),
+    'file'             => 'addthis_bookmark.admin.inc',
+    'weight'           => 1,
+  );
+  $items['admin/settings/addthis/settings/rss'] = array(
+    'title'            => t('AddThis RSS Feed'),
+    'type'             => MENU_LOCAL_TASK,
+    'page callback'    => 'drupal_get_form',
+    'page arguments'   => array('addthis_rss_admin_settings'),
+    'access arguments' => array('administer addthis'),
+    'file'             => 'addthis_rss.admin.inc',
+    'weight'           => 2,
   );
 
   return $items;
@@ -143,6 +174,19 @@ function _addthis_create_button($node=NU
 }
 
 /**
+ * Create the AddThis HTML.
+ *
+ * @param $settings
+ * an array of settings that specify how the administrator wants the button output
+ *
+ * @return $html
+ * the HTML for the addthis button
+ */
+function _addthis_gen_html($settings) {
+  
+}
+
+/**
  * Theme the AddThis button.
  */
 function theme_addthis_button($node, $teaser) {
@@ -155,8 +199,10 @@ function theme_addthis_button($node, $te
     ));
   }
 
-  if (variable_get('addthis_dropdown_disabled', '0')) {
-    return ( sprintf('
+  $html = ''; // container to stuff all the html into
+  
+  if (variable_get('addthis_dropdown_disabled', '0') == '1') {
+    $html .= ( sprintf('
       <a class="addthis-button" href="http://www.addthis.com/bookmark.php"
         onclick="addthis_url   = location.href; addthis_title = document.title; return addthis_click(this);">
       <img src="%s" width="%d" height="%d" %s /></a>
@@ -167,8 +213,8 @@ function theme_addthis_button($node, $te
       addslashes(variable_get('addthis_image_attributes', 'alt=""'))
     ));
   }
-  else {
-    return ( sprintf('
+  if (variable_get('addthis_dropdown_disabled', '0') == '0') {
+    $html .= ( sprintf('
       <a class="addthis-button" href="http://www.addthis.com/bookmark.php"
         onmouseover="return addthis_open(this, \'\', \'%s\', \'%s\')"
         onmouseout="addthis_close()"
@@ -184,4 +230,22 @@ function theme_addthis_button($node, $te
       $_SERVER['HTTPS'] == 'on' ? 'https://secure.addthis.com' : 'http://s7.addthis.com'
     ));
   }
+  if (variable_get('addthis_rss_enabled', '0') == '1') { // ?username=%s&amp;h1=%s&amp;t1= (removed from url, not sure I will need it)
+    $username = addslashes(variable_get('addthis_username', 'my-username'));
+    $feed = addslashes(variable_get('addthis_rss_feed', url('node/feed', array('absolute' => 1))));
+    $html .= ( sprintf('
+      <a class="addthis-rss-button" href="http://addthis.com/feed.php?username=%s&amp;h1=%s&amp;t1=" onclick="return addthis_open(this, \'feed\', \'%s\')" target="_blank"><img src="%s" width="%d" height="%d" style="border:0;" %s /></a>
+      <script type="text/javascript" src="%s/js/' . variable_get('addthis_rss_widget_version', '250') . '/addthis_widget.js#username=%s"></script>',
+      $username,
+      rawurlencode($feed),
+      $feed,
+      $_SERVER['HTTPS'] == 'on' ? addslashes(variable_get('addthis_rss_image_secure', 'https://secure.addthis.com/button1-rss.gif')) : addslashes(variable_get('addthis_rss_image', 'http://s9.addthis.com/button1-rss.gif')),
+      addslashes(variable_get('addthis_rss_image_width', '125')),
+      addslashes(variable_get('addthis_rss_image_height', '16')),
+      variable_get('addthis_rss_image_attributes', 'alt=""'),
+      $_SERVER['HTTPS'] == 'on' ? 'https://secure.addthis.com' : 'http://s7.addthis.com',
+      $username
+    ));
+  }
+  return $html;
 }
