--- watcher.module	2008-05-27 16:07:38.000000000 +1000
+++ watcher.module.patched	2008-05-27 16:42:00.000000000 +1000
@@ -175,6 +175,44 @@ function theme_watcher_node_toggle_watch
 }
 
 /**
+ * Return a toggle watching post link array to be displayed in the node links section
+ * 
+ * Please note that the JavaScript that handles the AJAX request looks for the class
+ * attribute so do not change it, rather override it with your own CSS rules if you
+ * want to change the appearance of this element.
+ * 
+ * @param $uid
+ *    The user we'd like to toggle watching for
+ * @param $nid
+ *    The node id we're toggling watching for for this user
+ * @param $dest
+ *    The URL of the current page, used for redirection afterwards
+ * @param $user_is_watching
+ *    A boolean denoting whether uid is watching nid
+ * @param $t
+ *    An associative array of localized strings
+ * 
+ * @return
+ *    A themed widget for toggling watching of the given nid
+ *    
+ */
+function theme_watcher_node_links_toggle_watching_link($uid, $nid, $dest, $user_is_watching, $t = array()) {
+  
+  // Set up classes
+  $class_watch_status_link = ( $user_is_watching ? ' watcher_node_toggle_watching_link_watched' : '');
+  $class_watch_status_container = ( $user_is_watching ? ' watcher_node_watched' : '');
+  
+  return array( 'href' => "user/$uid/watcher/toggle/$nid",
+                'title' => ( $user_is_watching ? $t['watch_toggle_enabled'] : $t['watch_toggle_disabled'] ), 
+                'attributes' => array( 'class' => "watcher_node_toggle_watching_link$class_watch_status_link", 
+                                       'title' => ( $user_is_watching ? $t['watch_toggle_enabled_title'] : $t['watch_toggle_disabled_title'] ),
+                                     ),
+                'query' => $dest,
+              );
+
+}
+
+/**
  * Return the help page
  * 
  * @param $content
@@ -239,6 +277,16 @@ function watcher_help($section) {
 }
 
 /**
+ * Implementation of hook_link().
+ */
+function watcher_link($type, $node = NULL, $teaser = FALSE) {
+  global $user;
+  if ($user->uid && user_access('use watcher') && _watcher_node_type_enabled($node)) {
+    return _watcher_node_watch_link($node, $teaser, null);
+  }
+}
+
+/**
  * Implementation of hook_menu().
  */
 function watcher_menu($may_cache) {
@@ -521,13 +569,41 @@ function _watcher_admin_settings() {
     '#type' => 'fieldset',
     '#title' => t('Watch Toggle Link'),
     '#collapsible' => true,
-    '#collapsed' => true,
+    '#collapsed' => false,
   );
 
+    $form['togglelink']['watcher_toggle_link_disabled_text'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Link text when node is not being watched'),
+      '#default_value' => variable_get('watcher_toggle_link_disabled_text', t('You are not watching this post, click to start watching')),
+      '#size' => 50,
+      '#maxlength' => 100,
+    );
+    
+    $form['togglelink']['watcher_toggle_link_enabled_text'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Link text when node is being watched'),
+      '#description' => t('If your site uses many languages, both these strings can be translated to languages other than the default by using the locale module.'),
+      '#default_value' => variable_get('watcher_toggle_link_enabled_text', t('You are watching this post, click to stop watching')),
+      '#size' => 50,
+      '#maxlength' => 100,
+    );
+    
+    $form['togglelink']['watcher_toggle_link_position'] = array(
+      '#type' => 'radios',
+      '#title' => t('Where should "watch this post" toggle links be inserted on each node?'),
+      '#description' => t('This setting applies for both full page view and teasers (if the "display in teasers" option is checked).'),
+      '#options' => array(
+        'body' => t('At the bottom of the node body'), 
+        'links' => t('In the node links section'),
+      ),
+      '#default_value' => variable_get('watcher_toggle_link_position', 'body'),
+    );
+    
     $form['togglelink']['watcher_toggle_link_in_teaser'] = array(
       '#type' => 'checkbox',
       '#title' => t('Display "watch this post" toggle link in teasers.'),
-      '#description' => t('Determines whether or not to show the "watch this post" toggle link in node teasers (used on front page and content listings). Teasers are the shortened down version of a node, often shown on a site\'s frontpage or on pages that summarize content. If disabled, link will only be shown when nodes are shown as pages (full view).'),
+      '#description' => t('Determines whether or not to show the "watch this post" toggle link in node teasers. If disabled, link will only be shown when nodes are shown as pages (full view).'),
       '#default_value' => variable_get('watcher_toggle_link_in_teaser', false),
     );
 
@@ -893,7 +969,7 @@ function _watcher_admin_test() {
   //////////////// Intro text ////////////////
   
   $form[] = array(
-    '#value' => t("If you're experiencing problems with the module such as messages not being delivered et c, you can use the diagnostic tools on this page to send test notifications. The <a href=\"!statpage\">statistics page</a> also contains valuable information for troubleshooting.", array('!statpage' => url('admin/settings/watcher/stats')))
+    '#value' => t("If you're experiencing problems with the module such as messages not being delivered etc, you can use the diagnostic tools on this page to send test notifications. The <a href=\"!statpage\">statistics page</a> also contains valuable information for troubleshooting.", array('!statpage' => url('admin/settings/watcher/stats')))
   );
   
   //////////////// Create Test Notifications ////////////////
@@ -1701,9 +1777,9 @@ function _watcher_node_watch_link(&$node
 
   // Make localized strings
   $tstrings = array();
-  $tstrings['watch_toggle_enabled'] = t('You are watching this post, click to stop watching');
+  $tstrings['watch_toggle_enabled'] = variable_get('watcher_toggle_link_enabled_text', t('You are watching this post, click to stop watching'));
   $tstrings['watch_toggle_enabled_title'] = t('This post is being watched. You can track and change email notification setting for this post in your watched posts list (see your user profile)');
-  $tstrings['watch_toggle_disabled'] = t('You are not watching this post, click to start watching');
+  $tstrings['watch_toggle_disabled'] = variable_get('watcher_toggle_link_disabled_text', t('You are not watching this post, click to start watching'));
   $tstrings['watch_toggle_disabled_title'] = t('Watch posts to be notified when other users comment on them or the posts are changed');
  
   // Build link to the user's list of watched posts
@@ -1724,11 +1800,19 @@ function _watcher_node_watch_link(&$node
   // Add CSS
   drupal_add_css(drupal_get_path('module', 'watcher') .'/css/watcher.css');
 
-  //Add element to node
-  $node->content['watcher'] = array(
-    '#value' => theme('watcher_node_toggle_watching_link', $user->uid, $node->nid, $dest, $watching, $tstrings),
-    '#weight' => 30,
-  );  
+  $position = variable_get('watcher_toggle_link_position', 'body');
+  if ($position == 'links') {
+    // Add toggle element to links array
+    return array( 'watcher' => theme('watcher_node_links_toggle_watching_link', $user->uid, $node->nid, $dest, $watching, $tstrings) );
+  }
+  else {
+    //Add element to node
+    $node->content['watcher'] = array(
+      '#value' => theme('watcher_node_toggle_watching_link', $user->uid, $node->nid, $dest, $watching, $tstrings),
+      '#weight' => 30,
+    );
+  }
+  
 }
 
 /**
