Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simplenews/README.txt,v
retrieving revision 1.6
diff -u -p -r1.6 README.txt
--- README.txt	4 May 2008 12:40:38 -0000	1.6
+++ README.txt	3 Jun 2008 13:33:59 -0000
@@ -61,6 +61,10 @@ INSTALLATION
     Configure Simplenews on the Simplenews admin pages:
       Administer > Content Management > Newsletters > Settings.
 
+    You can select the content type used by Simplenews for it's newsletters.
+    Select the taxonomy term Simplenews uses to determine different newsletter
+    series.
+
  6. CONFIGURE SIMPLENEWS BLOCK
 
     Configure the Simplenews block on the Block configuration page. You reach
Index: simplenews.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simplenews/simplenews.admin.inc,v
retrieving revision 1.13
diff -u -p -r1.13 simplenews.admin.inc
--- simplenews.admin.inc	11 May 2008 09:53:42 -0000	1.13
+++ simplenews.admin.inc	3 Jun 2008 13:34:01 -0000
@@ -653,9 +653,38 @@ function simplenews_subscription_list_fo
  * Menu callback: Admin newsletter settings.
  */
 function simplenews_admin_settings(&$form_state) {
+  $vid = variable_get('simplenews_vid', '');
   $address_default = variable_get('site_mail', ini_get('sendmail_from'));
   $form = array();
 
+  $form['simplenews_general_settings'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('General settings'),
+    '#collapsible' => TRUE,
+    '#collapsed' => FALSE,
+  );
+    $form['simplenews_general_settings']['simplenews_content_types'] = array(
+    '#type' => 'checkboxes',
+    '#title' => t('Newsletter content types'),
+    '#required' => TRUE,
+    '#options' => array_map('check_plain', node_get_types('names')),
+    '#default_value' => variable_get('simplenews_content_types', array('simplenews')),
+    '#description' => t('Select content type(s) to be used as newsletter.'),
+  );
+  $vocabulary_options = array();
+  if ($vocabularies = taxonomy_get_vocabularies()) {
+    foreach ($vocabularies as $key => $object) {
+      $vocabulary_options[$key] = $object->name;
+    }
+  }
+  $form['simplenews_general_settings']['simplenews_vid'] = array(
+    '#type' => 'select',
+    '#title' => t('Newsletter taxonomy'),
+    '#options' =>  $vocabulary_options,
+    '#required' => TRUE,
+    '#description' => t('Select the taxonomy used to identify newsletter series. Note that changing the newsletter taxonomy will affect existing newsletter issues.'),
+    '#default_value' => variable_get('simplenews_vid', ''),
+  );
   $form['simplenews_default_options'] = array(
     '#type' => 'fieldset',
     '#title' => t('Default newsletter options'),
@@ -778,7 +807,12 @@ function simplenews_admin_settings(&$for
     '#default_value' => variable_get('simplenews_sync_account', TRUE),
     '#description' => t('When checked subscriptions will be synchronized with site accounts. When accounts are deteted, subscriptions with the same email address will be removed. When site accounts are blocked/unblocked, subscriptions will be deactivated/activated. When not checked subscriptions will be unchanged when associated accounts are deleted or blocked.'),
   );
-  return system_settings_form($form);
+  
+  // Node type settings require pre-processing before calling system_settings_form_submit().
+  // Therefore the submit is handled by simplenews_admin_settings_submit()
+  $form = system_settings_form($form);
+  $form['#submit'][] = 'simplenews_admin_settings_submit';
+  return $form;
 }
 
 function simplenews_admin_settings_validate($form, &$form_state) {
@@ -787,6 +821,21 @@ function simplenews_admin_settings_valid
   }
 }
 
+function simplenews_admin_settings_submit($form, &$form_state) {
+  // Newsletter vocabulary is updated using node type settings.
+  $vocabulary = (array)taxonomy_vocabulary_load($form_state['values']['simplenews_vid']);
+  $form_state['values']['simplenews_content_types'] = array_filter($form_state['values']['simplenews_content_types']);
+  $vocabulary['nodes'] = array_merge($vocabulary['nodes'], $form_state['values']['simplenews_content_types']);
+
+  taxonomy_save_vocabulary($vocabulary);
+  drupal_set_message(t('Updated vocabulary %name.', array('%name' => $vocabulary['name'])));
+  watchdog('simplenews', 'Updated vocabulary %name.', array('%name' => $vocabulary['name']), WATCHDOG_NOTICE, l(t('edit'), 'admin/content/taxonomy/edit/vocabulary/'. $form_state['values']['vid']));
+
+  // After handling node type and taxonomy settings the remaining
+  // settings are passed on to system_settings_form_submit();
+  system_settings_form_submit($form, &$form_state);
+}
+
 /**
  * Callback function to activate the specified subscriptions.
  *
Index: simplenews.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simplenews/simplenews.install,v
retrieving revision 1.12
diff -u -p -r1.12 simplenews.install
--- simplenews.install	2 May 2008 13:40:53 -0000	1.12
+++ simplenews.install	3 Jun 2008 13:34:02 -0000
@@ -188,8 +188,8 @@ function simplenews_install() {
  */
 function simplenews_enable() {
   if ($vocabulary = taxonomy_vocabulary_load(variable_get('simplenews_vid', ''))) {
-    // Existing install. Add back newsletter node type, if the forums
-    // vocabulary still exists. Keep all other node types intact there.
+    // Existing install. Add back newsletter content type, if the simplenews
+    // vocabulary still exists. All other content type settings unchanged.
     $vocabulary = (array) $vocabulary;
     $vocabulary['nodes']['simplenews'] = 1;
     taxonomy_save_vocabulary($vocabulary);
Index: simplenews.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simplenews/simplenews.module,v
retrieving revision 1.104
diff -u -p -r1.104 simplenews.module
--- simplenews.module	27 May 2008 06:49:04 -0000	1.104
+++ simplenews.module	3 Jun 2008 13:34:04 -0000
@@ -254,18 +254,8 @@ function simplenews_menu() {
  * Implementation of hook_nodeapi().
  */
 function simplenews_nodeapi(&$node, $op, $teaser, $page) {
-  // We are going to return if $node->type is not one of the node
-  // types assigned to the newsletter vocabulary. If simplenews_vid
-  // is undefined or the vocabulary does not exist, it clearly cannot
-  // be assigned to $node->type, so return to avoid E_ALL warnings.
-  $vid = variable_get('simplenews_vid', '');
-  $vocabulary = taxonomy_vocabulary_load($vid);
-  if (empty($vocabulary)) {
-    return;
-  }
-
-  // Operate only on node types assigned to the newsletter vocabulary.
-  if (!in_array($node->type, $vocabulary->nodes)) {
+  // Operate only on node types set in 'simplenews_content_types' variable.
+  if (!in_array($node->type, variable_get('simplenews_content_types', array('simplenews')))) {
     return;
   }
 
@@ -414,25 +404,25 @@ function simplenews_form_alter(&$form, $
   // Newsletter vocabulary form
   if ($form_id == 'taxonomy_form_vocabulary' && isset($form['vid']) && $form['vid']['#value'] == $vid) {
     // Hide critical options from newsletter vocabulary.
-    $form['help_forum_vocab'] = array(
-      '#value' => t('This is the designated simplenews vocabulary. This vocabulary can not be deleted.'),
+    $form['help_simplenews_vocab'] = array(
+      '#value' => t('This is the designated simplenews vocabulary.'),
       '#weight' => -1,
     );
     $form['content_types']['nodes']['#required'] = TRUE;
     $form['content_types']['nodes']['#description'] = t('Select content type(s) to be used as newsletter');
-    $form['settings']['multiple'] = array('#type' => 'value', '#value' => FALSE);
-
-    // Prevent the vocabulary gets deleted
-    unset($form['delete']);
   }
 
   // Simplenews newsletter node form
   elseif (strpos($form_id, '_node_form')) {
-    $vocabulary = taxonomy_vocabulary_load($vid);
-    if (in_array('simplenews', $vocabulary->nodes)) {
+    if (in_array($form['type']['#value'], variable_get('simplenews_content_types', array('simplenews')))) {
       if (isset($form['#node']->simplenews)) {
         $simplenews_values = $form['#node']->simplenews;
       }
+      $vid = variable_get('simplenews_vid', '');
+      if (!isset($form['taxonomy'][$vid]) && !isset($form['taxonomy']['tag'][$vid])) {
+        $vocabulary = taxonomy_vocabulary_load($vid);
+        drupal_set_message(t('Content type %type requires to be assigned to vocabulary %name. Please change the vocabulary settings.', array('%type' => $form['type']['#value'], '%name' => $vocabulary->name)), 'error');
+      }
       $form['simplenews'] = array(
         '#type' => 'fieldset',
         '#title' => t('Newsletter sending options'),
