Index: modules/subscriptions/subscriptions.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/subscriptions/subscriptions.module,v
retrieving revision 1.32
diff -u -r1.32 subscriptions.module
--- modules/subscriptions/subscriptions.module	12 Dec 2005 03:47:31 -0000	1.32
+++ modules/subscriptions/subscriptions.module	14 Feb 2006 00:21:21 -0000
@@ -39,7 +39,15 @@
   $mailevent .= "Alternativly, if you have the mailqueue module installed, you can send the messages ";
   $mailevent .= "to that module for handling.";
   if ( module_exist( 'mailqueue' ) ) {
-    $output = form_radios( t( "Mailer Event" ), "subscriptions_event", variable_get( "subscriptions_event", "insert" ), array( "insert" => t( "On Comment Insert/Update" ), "queue" => t( "Send to mail queue" ) ) , t( $mailevent ) );
+    $form_options = array( 'insert' => t( 'On Comment Insert/Update' ));
+    $form['subscription_settings']['subscriptions_event'] = array(
+      '#type'          => 'radios',
+      '#title'         => t('Mailer event'),
+      '#default_value' => variable_get( 'subscriptions_event', 'insert' ),
+      '#options'       => $form_options,
+      '#description'   => t( $mailevent )
+    );
+    $output = $form;
   }
   else {
     $output = "Subscription notifications will be sent upon insert/update.  This should be ";
@@ -57,8 +65,20 @@
   switch ($type) {
     case 'form':
       if (user_access('maintain subscriptions') && $category == 'account') {
-        return array(array('title' => t('Subscription settings'), 'data' => form_checkbox(t('Automatically subscribe to threads in which you post.'), 'subscriptions_auto', 1, isset($edit->subscriptions_auto) ? $edit->subscriptions_auto : $user->subscriptions_auto, t('Checking this box allows you to be automatically subscribe to any thread you create or post a comment to.'))));
-      }
+        $form['subscriptions'] = array(
+          '#type'        => 'fieldset', 
+          '#title'       => t('Subscription settings'), 
+          '#weight'      => 5, 
+          '#collapsible' => TRUE
+        );
+        $form['subscriptions']['subscriptions_auto'] = array(
+          '#type'          => 'checkbox',
+          '#title'         => t('Autosubscribe'),
+          '#default_value' => isset($edit['subscriptions_auto']) ? $edit['subscriptions_auto'] : $user->subscriptions_auto,
+          '#description'   => t('Checking this box allows you to be automatically subscribe to any thread you create or post a comment to.')
+        );
+      return $form;
+    }
   }
 }
 
@@ -71,8 +91,15 @@
   foreach ($vocabularies as $vocabulary) {
     $select[$vocabulary->vid] = $vocabulary->name;
   }
-  $output = form_select(t('Omitted vocabularies'), 'subscriptions_omitted_taxa', variable_get('subscriptions_omitted_taxa', array()), $select, t('Select vocabularies which should be <strong>omitted</strong> from subscription listings.'), '', 1);
-  return $output;
+  $form['sub_settings']['subscriptions_omitted_taxa'] = array(
+    '#type'          => 'select',
+    '#title'         => t('Omitted vocabularies'),
+    '#default_value' => variable_get('subscriptions_omitted_taxa', array()),
+    '#options'       => $select,
+    '#description'   => t('Select vocabularies which should be <strong>omitted</strong> from subscription listings.'),
+    '#multiple'      => TRUE
+  );
+  return $form;
 }
 
 /**
@@ -269,7 +296,7 @@
 /**
  * Implementation of hook_comment().
  */
-function subscriptions_comment($op, $comment) {
+function subscriptions_comment($comment, $op) {
   global $user;
   $strsent = '!';
   // TODO: it appears the comment status is not provided by this hook... we'll have to look into that later
@@ -308,13 +335,32 @@
         user_save($user, array('subscriptions_subscribe' => $node->subscriptions_subscribe));
       }
       break;
-    case 'form post':
-      if (!$user->subscriptions_auto) {
-        $allsubs = subscriptions_get_user();
-        $val = isset($node->subscriptions_subscribe) ? $node->subscriptions_subscribe : $allsubs['node'][$node->nid] ? 1 : $user->subscriptions_subscribe;
-        return form_item(t('Subscribe'), form_checkbox(t('Receive notification of replies to this %name.', array('%name' => node_invoke($node, 'node_name'))), 'subscriptions_subscribe', 1, $val));
-      }
-      break;
+  }
+}
+
+/**
+ * Implementation of hook_form_alter().
+ */
+function subscriptions_form_alter($form_id, &$form) {
+  $allsubs = subscriptions_get_user();
+  $val = isset($node->subscriptions_subscribe) ? $node->subscriptions_subscribe : $allsubs['node'][$node->nid] ? 1 : $user->subscriptions_subscribe;
+ 
+  if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) {
+    $node = $form['#node'];
+    $form['subscriptions'] = array(
+      '#type'        => 'fieldset',
+      '#title'       => t('Subscriptions'),
+      '#collapsible' => TRUE,
+      '#weight'      => 0,
+      '#tree'        => TRUE,
+    );
+    $form['subscriptions']['subscriptions_subscribe'] = array(
+      '#type'          => 'checkbox', 
+      '#title'         => t('Receive notification of replies.'),
+      '#return_value'  => 1,
+      '#default_value' => $val, 
+      '#collapsible'   => FALSE
+    );
   }
 }
 
@@ -464,7 +510,12 @@
       // omit undesired vocabularies from listing
       $vocabularies = taxonomy_get_vocabularies();
       $omits = variable_get('subscriptions_omitted_taxa', array());
-      foreach ($omits as $omit) {
+      if (is_array ($omits)) {
+        foreach ($omits as $omit) {
+          unset($vocabularies[$omit]);
+        } 
+      }
+      else {
         unset($vocabularies[$omit]);
       }
       foreach ($vocabularies as $vocab) {
@@ -504,8 +555,13 @@
       // omit undesired vocabularies from listing
       $vocabularies = taxonomy_get_vocabularies();
       $omits = variable_get('subscriptions_omitted_taxa', array());
-      foreach ($omits as $omit) {
-        unset($vocabularies[$omit]);
+      if (is_array ($omits)) {
+        foreach ($omits as $omit) {
+          unset($vocabularies[$omit]);
+        } 
+      }
+      else {
+        unset($vocabularies[$omits]);
       }
       foreach ($vocabularies as $vocab) {
         $tree = taxonomy_get_tree($vocab->vid);
