Index: og.js
===================================================================
RCS file: /cvs/drupal/contributions/modules/og/og.js,v
retrieving revision 1.5
diff -u -r1.5 og.js
--- og.js	4 Sep 2007 03:22:48 -0000	1.5
+++ og.js	27 Dec 2007 22:28:55 -0000
@@ -1,15 +1,15 @@
 // $Id: og.js,v 1.5 2007/09/04 03:22:48 weitzman Exp $
 
 Drupal.ogAttach = function() {
-/*  Disable the public checkbox if no groups are selected in in Audience*/
+  // Disable the public checkbox if no groups are selected in Audience
   $('.og-audience').click(function() {
     // Audience can be select or checkboxes
 		var cnt;
     if ( $('.og-audience .form-checkbox').size() > 0) {
-      cnt = $('input.og-audience:checked').size();  
+      cnt = $('input.og-audience:checked').size();
     }
     else {
-      cnt = $('.og-audience option:selected').size();      
+      cnt = $('.og-audience option:selected').size();
     }
     if (cnt > 0) {
       $('#edit-og-public').removeAttr("disabled");
@@ -22,14 +22,44 @@
 	if ( $('.og-audience .form-checkbox').size() > 0 ) {
 	  if ( $('input.og-audience:checked').size() < 1) {
 	      $('#edit-og-public').attr("disabled", "disabled");
-	  }		
+	  }
 	}
 	else {
 	  if ( $('.og-audience option:selected').size() < 1) {
 	      $('#edit-og-public').attr("disabled", "disabled");
-	  }				
+	  }
 	}
-};
+
+  /**
+   * DELETING A GROUP page -- form field UI stuff
+   * 
+   * Find out if the 'move all posts to another group' radio button is checked, and if so,
+   * show and re-enable the og_node_delete_group_form's $form['target'] dropdown list.
+   */
+  $('#og-move-posts-to-group-selector').hide();
+  //$('#og-delete-group-posts-description').hide();
+  $('#og-delete-group-dropdown').attr("disabled", "disabled");
+  
+  var i = 1;
+  if ($('#og-move-posts-to-group-selector')) {
+    $('.form-radios').children().each(function(){
+      if (i == 3) {
+        $(this).click(function(){
+          $('#og-delete-group-posts-description').slideDown('fast');
+          $('#og-delete-group-dropdown').removeAttr("disabled");
+          $('#og-move-posts-to-group-selector').slideDown('normal');
+        });
+      } else {
+        $(this).click(function(){
+          $('#og-delete-group-posts-description').hide();
+          $('#og-delete-group-dropdown').attr("disabled", "disabled");
+          $('#og-move-posts-to-group-selector').hide();
+        });
+      }
+      i++; 
+    });
+  }
+}
 
 if (Drupal.jsEnabled) {
   $(document).ready(Drupal.ogAttach);
Index: og.css
===================================================================
RCS file: /cvs/drupal/contributions/modules/og/og.css,v
retrieving revision 1.5
diff -u -r1.5 og.css
--- og.css	22 Feb 2007 15:06:43 -0000	1.5
+++ og.css	27 Dec 2007 22:28:55 -0000
@@ -30,4 +30,11 @@
   font-style: italic;
 }
 
-
+div#og-move-posts-to-group-selector {
+  padding: .4em 0 .4em 0;
+  color: #000;
+  background: #edd;
+}
+div#og-move-posts-to-group-selector div.form-item label {
+  display: inline;
+}
Index: og.module
===================================================================
RCS file: /cvs/drupal/contributions/modules/og/og.module,v
retrieving revision 1.412
diff -u -r1.412 og.module
--- og.module	19 Dec 2007 04:26:22 -0000	1.412
+++ og.module	27 Dec 2007 22:28:55 -0000
@@ -1456,21 +1456,79 @@
 
 }
 
-// form_alter() the node_delete form for a group
+// Form_alter() the node_delete form (for removing groups).
 function og_node_delete_group_form(&$form) {
-  $options[] = t('Do nothing.');
-  $options[] = t('Delete all group posts which don\'t also belong to another group.');
-  if (user_access('administer nodes')) {
-    $options[] = t('Move all group posts to the group listed below.');
+  drupal_add_js(drupal_get_path('module', 'og'). '/og.js');
+  // Make a list of all the available groups.
+  $dropdown_choices = og_all_groups_options();
+  // Remove the group that's being deleted from the list of groups.
+  unset($dropdown_choices[$form['nid']['#value']]);
+  // Find out if there's more than one group available for selection before
+  // presenting the user with a Target Group dropdown.
+  if (count($dropdown_choices) > 0) {
+    $multiple_groups_exist = TRUE;
   }
-  $form['verb'] = array('#type' => 'radios', '#title' => t('Group posts'), '#options' => $options, '#weight' => 0, '#description' => t('In addition to deleting this group, you may choose how to disposition the posts within it.'));
-  if (user_access('administer nodes')) {
-    $options = og_all_groups_options();
-    unset($options[$form['nid']['#value']]);
-    $form['target'] = array('#type' => 'select', '#title' => t('Target group'), '#default_value' => 0, '#options' => $options, '#weight' => 0, '#description' => t('If you chose <b>Move all group posts</b> above, specify a destination group.'));
-    // register a submit handler
+
+  // Create some options for the radio buttons.
+  $choices[] = t('Do nothing.');
+  if ($multiple_groups_exist) {
+    $choices[] = t('Delete all group posts which don\'t also belong to another group.');
+  }
+  else {
+    $choices[] = t('Delete all of this group\'s posts.');
+  }
+  if (user_access('administer nodes') && $multiple_groups_exist) {
+    $choices[] = t('Move all posts to another group.');
+  }
+  // Only show the descriptive text if there's more than one group to delete.
+  /*
+  if ($multiple_groups_exist) {
+    $description = '<span id="og-delete-group-posts-description">In addition to deleting this group, you may choose how to disposition the posts within it.</span>';
+  }
+  else {
+    $description = 'When you delete this group, what should happen to it\'s posts?';
+  }
+  */
+
+  $form['verb'] = array(
+    '#type' => 'radios',
+    '#title' => t('This group\'s posts'),
+    '#description' => t('When you delete this group, what should happen to it\'s posts?'),
+    '#options' => $choices,
+    '#default_value' => 0,
+    '#weight' => -3,
+  );
+  // Make a CSS ID for the above-mentioned radio buttons.
+  $form['verb']['#attributes'] = array('id' => 'og-delete-group-radios');
+  
+  if (user_access('administer nodes') && $multiple_groups_exist) {
+    $form['target'] = array(
+      '#prefix' => '<div id="og-move-posts-to-group-selector">',
+      '#type' => 'select',
+      '#title' => t('Target group'),
+      '#description' => t('Which group should receive the deleted group\'s posts?'),
+      '#options' => $dropdown_choices,
+      '#default_value' => 0,
+      '#weight' => -2,
+    );
+    // make a css id for the above-mentioned dropdown menu.
+    $form['target']['#attributes'] = array('id' => 'og-delete-group-dropdown');
+    $form['target']['type']['#attributes'] = array('display' => 'inline');
+    $form['target']['title']['#attributes'] = array('display' => 'inline');
+    
+    $form['subscribers'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Move user subscriptions also?'),
+      '#description' => t('If you want to, you can re-allocate all the users who were subscribed to this group. Be careful that you don\'t move users from a dormant group into an active group without their permission, as they might unexpectedly start to receive email notifications about every new posting in their newly acquired group.'),
+      '#default_value' => 1,
+      '#weight' => -1,
+      '#suffix' => '</div>',
+    );
+
+    // Register a submit handler
     $form['#submit']['og_node_delete_confirm_submit'] = array();
   }
+  
   $form['actions']['submit']['#value'] = t('Delete group');
 }
 
@@ -1504,7 +1562,7 @@
     $node = node_load($child_nid);
     unset($node->og_groups[$deleted_group_nid]);
     if ($move_children) {
-      // there is an array_unique() in og_save_ancestry which giards against duplicates so don't worry here.
+      // there is an array_unique() in og_save_ancestry which guards against duplicates so don't worry here.
       $node->og_groups[] = $target_group_nid;
     }
     if ($delete_orphans && count($node->og_groups) == 0) {
