Index: facebookshare.admin.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/facebookshare/facebookshare.admin.inc,v
retrieving revision 1.2
diff -u -r1.2 facebookshare.admin.inc
--- facebookshare.admin.inc	8 Apr 2010 15:54:37 -0000	1.2
+++ facebookshare.admin.inc	21 Jul 2010 12:39:11 -0000
@@ -1,56 +1,62 @@
-<?php
-// $Id: facebookshare.admin.inc,v 1.2 2010/04/08 15:54:37 willsteinmetz Exp $
-
-/**
- * @file
- * Administration settings form area for Facebook Share module
- */
-
-/**
- * Form for settings for the Facebook Share module
- */
-function facebookshare_admin_settings() {
-  drupal_add_css(drupal_get_path('module', 'facebookshare') . '/facebookshare.admin.css');
-  
-  $form['facebookshare_types'] = array(
-    '#type' => 'checkboxes',
-    '#title' => t('Content types'),
-    '#description' => t('Which content types to apply the Facebook Share button to.'),
-    '#options' => node_get_types('names'),
-    '#default_value' => variable_get('facebookshare_types', array()),
-  );
-  $form['facebookshare_location'] = array(
-    '#type' => 'checkboxes',
-    '#title' => t('Location'),
-    '#description' => t('Where to show the Facebook Share button.'),
-    '#options' => array(
-      'content' => t('Full view'),
-      'teasers' => t('Teasers'),
-    ),
-    '#default_value' => variable_get('facebookshare_location', array()),
-  );
-  $sizes = array('box_count' => '', 'button_count' => '', 'button' => '', 'icon_link' => '', 'icon' => '');
-  foreach ($sizes as $size => $button) {
-    $sizes[$size] = theme(
-      'facebookshare_button',
-      'http://www.facebook.com/facebook-widgets/share.php',
-      $size,
-      variable_get('facebookshare_text', '')
-    );
-  }
-  $form['facebookshare_size'] = array(
-    '#type' => 'radios',
-    '#title' => t('Button size'),
-    '#required' => TRUE,
-    '#options' => $sizes,
-    '#default_value' => variable_get('facebookshare_size', ''),
-  );
-  $form['facebookshare_text'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Share button text'),
-    '#default_value' => variable_get('facebookshare_text', ''),
-    '#description' => t('Leave blank for default "Share" text'),
-  );
-  
-  return system_settings_form($form);
-}
\ No newline at end of file
+<?php
+/**
+ * @file
+ * Administration settings form area for Facebook Share module
+ */
+
+/**
+ * Form for settings for the Facebook Share module
+ */
+function facebookshare_admin_settings($form, &$form_state) {
+  drupal_add_css(drupal_get_path('module', 'facebookshare') . '/facebookshare.admin.css');
+
+  $form['facebookshare_types'] = array(
+    '#type' => 'checkboxes',
+    '#title' => t('Content types'),
+    '#description' => t('Which content types to apply the Facebook Share button to.'),
+    '#options' => node_type_get_names(),
+    '#default_value' => variable_get('facebookshare_types'),
+  );
+  $form['facebookshare_location'] = array(
+    '#type' => 'checkboxes',
+    '#title' => t('Location'),
+    '#description' => t('Where to show the Facebook Share button.'),
+    '#options' => array(
+      'content' => t('Full view'),
+      'teasers' => t('Teasers'),
+    ),
+    '#default_value' => variable_get('facebookshare_location'),
+  );
+  $form['facebookshare_weight'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Weight'),
+    '#description' => t('The weight of which the Facebook widget should appear on the content.'),
+    '#default_value' => variable_get('facebookshare_weight', '-10'),
+    '#size' => 5,
+  );
+  $sizes = array('box_count' => '', 'button_count' => '', 'button' => '', 'icon_link' => '', 'icon' => '');
+  foreach ($sizes as $size => $button) {
+    $sizes[$size] = theme(
+      'facebookshare_button',
+      array('url' => 'http://www.facebook.com/facebook-widgets/share.php',
+            'size' => $size,
+            'text' => variable_get('facebookshare_text'))
+    );
+  }
+  $form['facebookshare_size'] = array(
+    '#type' => 'radios',
+    '#title' => t('Button size'),
+    '#required' => TRUE,
+    '#description' => t('What kind of button to show.'),
+    '#options' => $sizes,
+    '#default_value' => variable_get('facebookshare_size', ''),
+  );
+  $form['facebookshare_text'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Share button text'),
+    '#default_value' => variable_get('facebookshare_text'),
+    '#description' => t('Leave blank for default "Share" text'),
+  );
+
+  return system_settings_form($form);
+}
Index: facebookshare.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/facebookshare/facebookshare.module,v
retrieving revision 1.2
diff -u -r1.2 facebookshare.module
--- facebookshare.module	8 Apr 2010 15:54:37 -0000	1.2
+++ facebookshare.module	21 Jul 2010 12:39:11 -0000
@@ -1,129 +1,149 @@
-<?php
-// $Id: facebookshare.module,v 1.2 2010/04/08 15:54:37 willsteinmetz Exp $
-
-/**
- * @file
- * Adds a button to a node to share on a user's Facebook stream
- */
-
-/**
- * Implements hook_help()
- */
-function facebookshare_help($path, $arg) {
-  switch ($path) {
-    case 'admin/settings/facebookshare':
-    case 'admin/help#facebookshare':
-      return '<p>'. t('Provides a way for viewers to share a link to a node on' .
-        ' their Facebook stream.') .'</p>';
-  }
-}
-
-/**
- * Implements hook_perm()
- */
-function facebookshare_perm() {
-  return array(
-    'administer facebookshare',
-    'access facebookshare'
-  );
-}
-
-/**
- * Implements hook_menu()
- */
-function facebookshare_menu() {
-  $item['admin/settings/facebookshare'] = array(
-    'title' => 'Facebook Share',
-    'description' => 'Provides the configuration options for how Facebook Share operates on the site.',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('facebookshare_admin_settings'),
-    'access arguments' => array('administer facebookshare'),
-    'file' => 'facebookshare.admin.inc',
-  );
-  
-  return $item;
-}
-
-/**
- * Implements hook_nodeapi()
- */
-function facebookshare_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
-  if ($op == 'view') {
-    // Make sure we're on the right content type.
-    if (!in_array($node->type, variable_get('facebookshare_types', array()), TRUE)) {
-      return NULL;
-    }
-
-    // Make sure we're actually building the page to render in a browser.
-    if ($node->build_mode != NODE_BUILD_NORMAL) {
-      return NULL;
-    }
-
-    // Make sure the user has access to use Facebook Share.
-    if (!user_access('access facebookshare')) {
-      return NULL;
-    }
-    
-    // Retrieve the location where we should show it, the style and the URL of the button.
-    $location = variable_get('facebookshare_location', array());
-    $url = url('node/' . $node->nid, array('absolute' => TRUE));
-
-    // Check in the teaser and full view.
-    if (($teaser && !empty($location['teasers'])) || (!$teaser && !empty($location['content']))) {
-      drupal_add_css(drupal_get_path('module', 'facebookshare') . '/facebookshare.css');
-      $node->content['facebookshare'] = array(
-        '#value' => theme('facebookshare', $url),
-        '#weight' => -10,
-      );
-    }
-  }
-}
-
-/**
- * Implements hook_theme()
- */
-function facebookshare_theme($existing, $type, $theme, $path) {
-  return array(
-    'facebookshare' => array(
-      'arguments' => array(
-        'url' => NULL,
-      ),
-    ),
-    'facebookshare_button' => array(
-      'arguments' => array(
-        'url' => NULL,
-        'size' => NULL,
-        'text' => NULL,
-      ),
-    ),
-  );
-}
-
-/**
- * Themes facebook share button box
- */
-function theme_facebookshare($url) {
-  $output = '<div class="facebookshare-box">';
-  $output .= theme(
-    'facebookshare_button',
-    $url,
-    variable_get('facebookshare_size', ''),
-    variable_get('facebookshare_text', '')
-  );
-  $output .= '</div>';
-  
-  return $output;
-}
-
-/**
- * Themes facebook share button
- */
-function theme_facebookshare_button($url, $size, $text) {
-  $output = '<a name="fb_share" ' .
-   'type="' . $size . '" share_url="' . $url . '">' .
-   $text . '</a>' .
-   '<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" ' .
-   'type="text/javascript"></script>';
-  
-  return $output;
-}
\ No newline at end of file
+<?php
+
+/**
+ * @file
+ * Adds a button to a node to share on a user's Facebook stream
+ */
+
+/**
+ * Implements hook_help().
+ */
+function facebookshare_help($path, $arg) {
+  switch ($path) {
+    case 'admin/config/user-interface/facebookshare':
+    case 'admin/help#facebookshare':
+      return '<p>' . t('Provides a way for viewers to share a link to a node on' .
+        ' their Facebook stream.') . '</p>';
+  }
+}
+
+/**
+ * Implements hook_permission().
+ */
+function facebookshare_permission() {
+  return array(
+    'administer facebookshare' => array(
+      'title' => t('administer facebookshare'),
+    ),
+    'access facebookshare' => array(
+      'title' => t('access facebookshare'),
+    ),
+  );
+}
+
+/**
+ * Implements hook_menu().
+ */
+function facebookshare_menu() {
+  $item['admin/config/user-interface/facebookshare'] = array(
+    'title' => 'Facebook Share',
+    'description' => 'Provides the configuration options for how Facebook Share operates on the site.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('facebookshare_admin_settings'),
+    'access arguments' => array('administer facebookshare'),
+    'file' => 'facebookshare.admin.inc',
+  );
+
+  return $item;
+}
+
+/**
+ * Implements hook_init().
+ */
+function facebookshare_init() {
+  drupal_add_css(drupal_get_path('module', 'facebookshare') . '/facebookshare.css');
+}
+
+
+/**
+ * Implements hook_node_view().
+ */
+function facebookshare_node_view($node, $view_mode = 'full') {
+
+  // Make sure we're on the right content type.
+  if (!in_array($node->type, variable_get('facebookshare_types', array()), TRUE)) {
+    return NULL;
+  }
+
+  // We only render the button on full pages and on teasers
+  if (($view_mode != 'teaser') && ($view_mode != 'full')) {
+    return NULL;
+  }
+
+  // Make sure the user has access to use Facebook Share.
+  if (!user_access('access facebookshare')) {
+    return NULL;
+  }
+
+  // Retrieve the location where we should show it
+  $location = variable_get('facebookshare_location', array());
+
+  // Check if the current $view_mode has content to show
+  if (($view_mode == 'teaser' && !empty($location['teasers'])) || ($view_mode == 'full' && !empty($location['content']))) {
+
+    // Retrieve the weight and url of the button
+    $url = url('node/' . $node->nid, array('absolute' => TRUE));
+    $weight = variable_get('facebookshare_weight', -10);
+
+    // Add and theme the button
+    $node->content['facebookshare'] = array(
+      '#markup' => theme('facebookshare', array('url' => $url)),
+      '#weight' => is_numeric($weight) ? (int)$weight : -10,
+    );
+  }
+}
+
+/**
+ * Implements hook_theme().
+ */
+function facebookshare_theme($existing, $type, $theme, $path) {
+  return array(
+    'facebookshare' => array(
+      'variables' => array(
+        'url' => NULL,
+      ),
+    ),
+    'facebookshare_button' => array(
+      'variables' => array(
+        'url' => NULL,
+        'size' => NULL,
+        'text' => NULL,
+      ),
+    ),
+  );
+}
+
+/**
+ * Themes facebook share button box
+ */
+function theme_facebookshare($variables) {
+  $url = $variables['url'];
+  $output = '<div class="facebookshare-box">';
+  $output .= theme(
+    'facebookshare_button',
+    array(
+      'url' => $url,
+      'size' => variable_get('facebookshare_size', ''),
+      'text' => variable_get('facebookshare_text','')
+    )
+  );
+  $output .= '</div>';
+
+  return $output;
+}
+
+/**
+ * Themes facebook share button
+ */
+function theme_facebookshare_button($variables) {
+  $url = $variables['url'];
+  $size = $variables['size'];
+  $text = $variables['text'];
+  $output = '<a name="fb_share" ' .
+   'type="' . $size . '" share_url="' . $url . '">' .
+   $text . '</a>' .
+   '<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" ' .
+   'type="text/javascript"></script>';
+
+  return $output;
+}
Index: facebookshare.admin.css
===================================================================
RCS file: /cvs/drupal/contributions/modules/facebookshare/facebookshare.admin.css,v
retrieving revision 1.2
diff -u -r1.2 facebookshare.admin.css
--- facebookshare.admin.css	8 Apr 2010 15:54:37 -0000	1.2
+++ facebookshare.admin.css	21 Jul 2010 12:39:11 -0000
@@ -1,15 +1,13 @@
-/* $Id: facebookshare.admin.css,v 1.2 2010/04/08 15:54:37 willsteinmetz Exp $; */
-
-/**
- * @file
- * CSS styles for the admin settings of the Facebook Share module boxes
- */
-
-#facebookshare-admin-settings .form-radios .form-item {
-  width: 130px;
-  float: left;
-}
-
-#edit-facebookshare-text-wrapper {
-  clear: both;
-}
+/**
+ * @file
+ * CSS styles for the admin settings of the Facebook Share module boxes
+ */
+
+#facebookshare-admin-settings .form-radios .form-item {
+  width: 130px;
+  float: left;
+}
+
+#facebookshare-admin-settings .description {
+ clear: both;
+}
Index: README.txt
===================================================================
RCS file: /cvs/drupal/contributions/modules/facebookshare/README.txt,v
retrieving revision 1.2
diff -u -r1.2 README.txt
--- README.txt	8 Apr 2010 15:54:37 -0000	1.2
+++ README.txt	21 Jul 2010 12:39:11 -0000
@@ -1,16 +1,16 @@
-Created by: Ralivue.com
-Author: Will Steinmetz
-
-This module was created to help users easily share links to
-nodes with their friends on Facebook.
-
-This node was created independent of Facebook and we make no
-claim to be a member of Facebook or represent them in any way.
-
-TO INSTALL:
-Simply untar the Facebook Share module archive and drop the
-untarred folder in the appropriate place.
-EX: if you want the module to be available to all of your sites
-under a Drupal install, drop it in the sites/all/modules folder.
-To install the module for just specific sites under a Drupal
-install, drop it in the appropriate sites/*/modules folder(s).
\ No newline at end of file
+Created by: Ralivue.com
+Author: Will Steinmetz
+
+This module was created to help users easily share links to
+nodes with their friends on Facebook.
+
+This node was created independent of Facebook and we make no
+claim to be a member of Facebook or represent them in any way.
+
+TO INSTALL:
+Simply untar the Facebook Share module archive and drop the
+untarred folder in the appropriate place.
+EX: if you want the module to be available to all of your sites
+under a Drupal install, drop it in the sites/all/modules folder.
+To install the module for just specific sites under a Drupal
+install, drop it in the appropriate sites/*/modules folder(s).
Index: facebookshare.install
===================================================================
RCS file: /cvs/drupal/contributions/modules/facebookshare/facebookshare.install,v
retrieving revision 1.2
diff -u -r1.2 facebookshare.install
--- facebookshare.install	8 Apr 2010 15:54:37 -0000	1.2
+++ facebookshare.install	21 Jul 2010 12:39:11 -0000
@@ -1,24 +1,22 @@
-<?php
-// $Id: facebookshare.install,v 1.2 2010/04/08 15:54:37 willsteinmetz Exp $
-
-/**
- * @file
- * Install/uninstall file for Facebook Share module
- */
-
-/**
- * Implements hook_install()
- */
-function facebookshare_install() {
-	variable_set('facebookshare_size', 'box_count');
-}
-
-/**
- * Implements hook_uninstall()
- */
-function facebookshare_uninstall() {
-	variable_del('facebookshare_types', '');
-	variable_del('facebookshare_location', '');
-	variable_del('facebookshare_size', '');
-	variable_del('facebookshare_text');
-}
\ No newline at end of file
+<?php
+/**
+ * @file
+ * Install/uninstall file for Facebook Share module
+ */
+
+/**
+ * Implements hook_install().
+ */
+function facebookshare_install() {
+  variable_set('facebookshare_size', 'box_count');
+}
+
+/**
+ * Implements hook_uninstall().
+ */
+function facebookshare_uninstall() {
+  variable_del('facebookshare_types', '');
+  variable_del('facebookshare_location', '');
+  variable_del('facebookshare_size', '');
+  variable_del('facebookshare_text');
+}
Index: facebookshare.info
===================================================================
RCS file: /cvs/drupal/contributions/modules/facebookshare/facebookshare.info,v
retrieving revision 1.2
diff -u -r1.2 facebookshare.info
--- facebookshare.info	8 Apr 2010 15:54:37 -0000	1.2
+++ facebookshare.info	21 Jul 2010 12:39:11 -0000
@@ -1,5 +1,14 @@
-; $Id: facebookshare.info,v 1.2 2010/04/08 15:54:37 willsteinmetz Exp $
-name = "Facebook Share"
-description = "Adds a Facebook Share button so users can share a node in their Facebook stream"
-core = 6.x
-package = "Social Networking"
\ No newline at end of file
+name = "Facebook Share"
+description = "Adds a Facebook Share button so users can share a node in their Facebook stream"
+core = 7.x
+package = "Social Networking"
+
+; Information added by drupal.org packaging script on 2010-04-08
+version = "7.x-alpha"
+core = 7.x
+project = "facebookshare"
+datestamp = "1270742419"
+
+files[] = facebookshare.admin.inc
+files[] = facebookshare.install
+files[] = facebookshare.module
Index: facebookshare.css
===================================================================
RCS file: /cvs/drupal/contributions/modules/facebookshare/facebookshare.css,v
retrieving revision 1.2
diff -u -r1.2 facebookshare.css
--- facebookshare.css	8 Apr 2010 15:54:37 -0000	1.2
+++ facebookshare.css	21 Jul 2010 12:39:11 -0000
@@ -1,11 +1,9 @@
-/* $Id: facebookshare.css,v 1.2 2010/04/08 15:54:37 willsteinmetz Exp $; */
-
-/**
- * @file
- * CSS styles for the Facebook Share module boxes
- */
-
-.facebookshare-box {
-  float: right;
-  clear: right;
-}
+/**
+ * @file
+ * CSS styles for the Facebook Share module boxes
+ */
+
+.facebookshare-box {
+  float: right;
+  clear: right;
+}
Index: .project
===================================================================
RCS file: .project
diff -N .project
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ .project	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>facebookshare</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>
