Index: sites/all/modules/webform/webform.install
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sites/all/modules/webform/webform.install	(revision da0fd4395117fea74da9ab60df802c053b6175a1)
+++ sites/all/modules/webform/webform.install	(revision )
@@ -602,6 +602,8 @@
     if (variable_get('webform_install_add_body_field', FALSE)) {
       node_add_body_field($webform_type);
     }
+    // Enable webform components by default on Webform nodes.
+    variable_set('webform_node_webform', TRUE);
     // Disable comments by default on Webform nodes.
     variable_set('comment_webform', '0');
   }
@@ -612,7 +614,6 @@
  */
 function webform_uninstall() {
   // Unset webform variables.
-  variable_del('webform_node_types');
   variable_del('webform_node_types_primary');
   variable_del('webform_disabled_components');
   variable_del('webform_tracking_mode');
@@ -636,6 +637,10 @@
   variable_del('webform_progressbar_label_confirmation');
   variable_del('webform_excel_legacy_exporter');
 
+  foreach (node_type_get_names() as $type => $name) {
+    variable_del('webform_node_' . $type);
+  }
+
   $component_list = array();
   $path = drupal_get_path('module', 'webform') . '/components';
   $files = file_scan_directory($path, '/^.*\.inc$/');
@@ -1595,4 +1600,15 @@
     // Indicate our current progress to the batch update system.
     $sandbox['#finished'] = $sandbox['progress'] / $sandbox['max'];
   }
+}
+
+/**
+ * Split webform_node_types as content type specific.
+ */
+function webform_update_7412() {
+  $types = variable_get('webform_node_types', array('webform'));
+  foreach ($types as $type) {
+    variable_set('webform_node_' . $type, TRUE);
+  }
+  variable_del('webform_node_types');
 }
Index: sites/all/modules/webform/webform.api.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sites/all/modules/webform/webform.api.php	(revision da0fd4395117fea74da9ab60df802c053b6175a1)
+++ sites/all/modules/webform/webform.api.php	(revision )
@@ -363,7 +363,7 @@
  * Alter a Webform submission's header when exported.
  */
 function hook_webform_csv_header_alter(&$header, $component) {
-  // Use the machine name for component headers, but only for the webform 
+  // Use the machine name for component headers, but only for the webform
   // with node 5 and components that are text fields.
   if ($component['nid'] == 5 && $component['type'] == 'textfield') {
     $header[2] = $component['form_key'];
Index: sites/all/modules/webform/views/webform_handler_filter_submission_data.inc
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sites/all/modules/webform/views/webform_handler_filter_submission_data.inc	(revision da0fd4395117fea74da9ab60df802c053b6175a1)
+++ sites/all/modules/webform/views/webform_handler_filter_submission_data.inc	(revision )
@@ -46,7 +46,7 @@
     if ($which === 'title') {
       $nid = $this->view->relationship[$this->options['relationship']]->options['webform_nid'];
       $cid = $this->view->relationship[$this->options['relationship']]->options['webform_cid'];
-  
+
       if ($nid && $node = $node = node_load($nid)) {
         $component = $node->webform['components'][$cid];
         if (webform_component_feature($component['type'], 'views_range')) {
Index: sites/all/modules/webform/tests/webform.test
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sites/all/modules/webform/tests/webform.test	(revision da0fd4395117fea74da9ab60df802c053b6175a1)
+++ sites/all/modules/webform/tests/webform.test	(revision )
@@ -1029,7 +1029,8 @@
    */
   function testWebformCreateNewType() {
     // Enable webforms on the page content type.
-    variable_set('webform_node_types', array('webform', 'page'));
+    variable_set('webform_node_webform', TRUE);
+    variable_set('webform_node_page', TRUE);
 
     $settings = array(
       'title' => 'Test webform-enabled page',
Index: sites/all/modules/webform/views/webform_handler_field_submission_count.inc
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sites/all/modules/webform/views/webform_handler_field_submission_count.inc	(revision da0fd4395117fea74da9ab60df802c053b6175a1)
+++ sites/all/modules/webform/views/webform_handler_field_submission_count.inc	(revision )
@@ -37,7 +37,7 @@
     global $user;
 
     $output = NULL;
-    if ($this->count_type == 'node' && in_array($values->{$this->aliases['type']}, webform_variable_get('webform_node_types'))) {
+    if ($this->count_type == 'node' && variable_get('webform_node_' . $values->{$this->aliases['type']}, FALSE)) {
       module_load_include('inc', 'webform', 'includes/webform.submissions');
       $node = node_load($values->{$this->aliases['nid']});
       if (webform_results_access($node, $user)) {
Index: sites/all/modules/webform/includes/webform.admin.inc
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sites/all/modules/webform/includes/webform.admin.inc	(revision da0fd4395117fea74da9ab60df802c053b6175a1)
+++ sites/all/modules/webform/includes/webform.admin.inc	(revision )
@@ -11,15 +11,6 @@
 function webform_admin_settings() {
   module_load_include('inc', 'webform', 'includes/webform.export');
 
-  $node_types = node_type_get_names();
-  $form['node_types'] = array(
-    '#type' => 'checkboxes',
-    '#title' => t('Webform-enabled content types'),
-    '#description' => t('Webform allows you to enable the webform components for any content type.  Choose the types on which you would like to associate webform components.'),
-    '#options' => $node_types,
-    '#default_value' => webform_variable_get('webform_node_types'),
-  );
-
   $form['components'] = array(
     '#type' => 'fieldset',
     '#title' => t('Available components'),
@@ -198,7 +189,7 @@
     '#default_value' => variable_get('webform_submission_access_control', 1),
     '#description' => t('By default, the configuration form for each webform allows the administrator to choose which roles may submit the form. You may want to allow users to always submit the form if you are using a separate node access module to control access to webform nodes themselves.'),
   );
- 
+
   $form['advanced']['webform_email_select_max'] = array(
     '#type' => 'textfield',
     '#title' => t("Select email mapping limit"),
@@ -227,10 +218,6 @@
   $form_state['values']['webform_disabled_components'] = $disabled_components;
   unset($form_state['values']['components']);
 
-  // Change the name of the node type variable and clean it up.
-  $form_state['values']['webform_node_types'] = array_keys(array_filter($form_state['values']['node_types']));
-  unset($form_state['values']['node_types']);
-
   // Trim out empty options in the progress bar options.
   $form_state['values']['webform_progressbar_style'] = array_keys(array_filter($form_state['values']['webform_progressbar_style']));
 }
@@ -278,7 +265,7 @@
  * Create a comma-separate list of content types that are webform enabled.
  */
 function webform_admin_type_list() {
-  $webform_types = webform_variable_get('webform_node_types');
+  $webform_types = webform_node_types();
   $webform_type_list = '';
   $webform_type_count = count($webform_types);
   foreach ($webform_types as $n => $type) {
@@ -320,7 +307,7 @@
   }
 
   if (empty($rows)) {
-    $webform_types = webform_variable_get('webform_node_types');
+    $webform_types = webform_node_types();
     if (empty($webform_types)) {
       $message = t('Webform is currently not enabled on any content types.') . ' ' . t('Visit the <a href="!url">Webform settings</a> page and enable Webform on at least one content type.', array('!url' => url('admin/config/content/webform')));
     }
Index: sites/all/modules/webform/js/node-type-form.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sites/all/modules/webform/js/node-type-form.js	(revision )
+++ sites/all/modules/webform/js/node-type-form.js	(revision )
@@ -0,0 +1,19 @@
+(function ($) {
+  Drupal.behaviors.webformContentTypes = {
+    attach: function (context) {
+      // Provide the vertical tab summaries.
+      $('fieldset#edit-webform', context).drupalSetSummary(function(context) {
+        var vals = [];
+        $('input[type=checkbox]', context).each(function() {
+          if (this.checked && this.attributes['data-enabled-description']) {
+            vals.push(this.attributes['data-enabled-description'].value);
+          }
+          else if (!this.checked && this.attributes['data-disabled-description']) {
+            vals.push(this.attributes['data-disabled-description'].value);
+          }
+        });
+        return vals.join(', ');
+      });
+    }
+  };
+})(jQuery);
Index: sites/all/modules/webform/includes/webform.emails.inc
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sites/all/modules/webform/includes/webform.emails.inc	(revision da0fd4395117fea74da9ab60df802c053b6175a1)
+++ sites/all/modules/webform/includes/webform.emails.inc	(revision )
@@ -530,7 +530,7 @@
       $email[$field] = $form_state['values'][$field . '_' . $option];
 
       // Merge the email mapping(s) into single value(s)
-      $cid = $form_state['values'][$field . '_' . $option]; 
+      $cid = $form_state['values'][$field . '_' . $option];
       if (is_numeric($cid) && isset($form_state['values'][$field . '_mapping'][$cid])) {
         $email['extra'][$field .'_mapping'] = $form_state['values'][$field . '_mapping'][$cid];
       }
@@ -672,7 +672,7 @@
   }
 
   $email['excluded_components'] = implode(',', $email['excluded_components']);
-  $email['extra'] = empty($email['extra']) ? '' : serialize($email['extra']); 
+  $email['extra'] = empty($email['extra']) ? '' : serialize($email['extra']);
   $success = drupal_write_record('webform_emails', $email);
 
   return $success ? $email['eid'] : FALSE;
@@ -687,7 +687,7 @@
  */
 function webform_email_update($email) {
   $email['excluded_components'] = implode(',', $email['excluded_components']);
-  $email['extra'] = empty($email['extra']) ? '' : serialize($email['extra']); 
+  $email['extra'] = empty($email['extra']) ? '' : serialize($email['extra']);
   return drupal_write_record('webform_emails', $email, array('nid', 'eid'));
 }
 
Index: sites/all/modules/webform/webform.module
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sites/all/modules/webform/webform.module	(revision da0fd4395117fea74da9ab60df802c053b6175a1)
+++ sites/all/modules/webform/webform.module	(revision )
@@ -31,7 +31,7 @@
         $output .= ' ' . t('To add one, create a !types piece of content.', array('!types' => $type_list));
       }
       else {
-        $output .= ' <strong>' . t('Webform is currently not enabled on any content types.') . '</strong> ' . t('To use Webform, please enable it on at least one content type on this page.');
+        $output .= ' <strong>' . t('Webform is currently not enabled on any content types.') . '</strong> ' . t('To use Webform, please enable it on at least one <a href="!url">content type</a>.', array('!url' => url('admin/structure/types')));
       }
       $output = '<p>' . $output . '</p>';
       break;
@@ -431,7 +431,7 @@
     return FALSE;
   }
   $node = node_load($nid);
-  if (!isset($node->type) || !in_array($node->type, webform_variable_get('webform_node_types'))) {
+  if (!isset($node->type) || !variable_get('webform_node_' . $node->type, FALSE)) {
     return FALSE;
   }
   return $node;
@@ -1271,44 +1271,33 @@
 }
 
 /**
- * Implements hook_node_type().
+ * Return all content type enabled with webform.
  *
- * Not a real hook in Drupal 7. Re-used for consistency with the D6 version.
+ * @return array
+ *   An array of node type names.
  */
-function webform_node_type($op, $info) {
-  $webform_types = webform_variable_get('webform_node_types');
-  $affected_type = isset($info->old_type) ? $info->old_type : $info->type;
-  $key = array_search($affected_type, $webform_types);
-  if ($key !== FALSE) {
-    if ($op == 'update') {
-      $webform_types[$key] = $info->type;
+function webform_node_types() {
+  $types = array();
+  foreach (node_type_get_names() as $type => $name) {
+    if (variable_get('webform_node_' . $type, FALSE)) {
+      $types[] = $type;
     }
-    if ($op == 'delete') {
-      unset($webform_types[$key]);
-    }
+  }
-    variable_set('webform_node_types', $webform_types);
+  return $types;
-  }
+}
-}
 
 /**
- * Implements hook_node_type_update().
- */
-function webform_node_type_update($info) {
-  webform_node_type('update', $info);
-}
-
-/**
  * Implements hook_node_type_delete().
  */
 function webform_node_type_delete($info) {
-  webform_node_type('delete', $info);
+  variable_del('webform_node_' . $info->type);
 }
 
 /**
  * Implements hook_node_insert().
  */
 function webform_node_insert($node) {
-  if (!in_array($node->type, webform_variable_get('webform_node_types'))) {
+  if (!variable_get('webform_node_' . $node->type, FALSE)) {
     return;
   }
 
@@ -1370,7 +1359,7 @@
  * Implements hook_node_update().
  */
 function webform_node_update($node) {
-  if (!in_array($node->type, webform_variable_get('webform_node_types'))) {
+  if (!variable_get('webform_node_' . $node->type, FALSE)) {
     return;
   }
 
@@ -1477,7 +1466,7 @@
  * Implements hook_delete().
  */
 function webform_node_delete($node) {
-  if (!in_array($node->type, webform_variable_get('webform_node_types'))) {
+  if (!variable_get('webform_node_' . $node->type, FALSE)) {
     return;
   }
 
@@ -1539,8 +1528,7 @@
  * Implements hook_node_prepare().
  */
 function webform_node_prepare($node) {
-  $webform_types = webform_variable_get('webform_node_types');
-  if (in_array($node->type, $webform_types) && !isset($node->webform)) {
+  if (variable_get('webform_node_' . $node->type, FALSE) && !isset($node->webform)) {
     $node->webform = webform_node_defaults();
   }
 }
@@ -1551,7 +1539,7 @@
  */
 function webform_node_load($nodes, $types) {
   // Quick check to see if we need to do anything at all for these nodes.
-  $webform_types = webform_variable_get('webform_node_types');
+  $webform_types = webform_node_types();
   if (count(array_intersect($types, $webform_types)) == 0) {
     return;
   }
@@ -1655,7 +1643,7 @@
  */
 function webform_form_alter(&$form, $form_state, $form_id) {
   $matches = array();
-  if (isset($form['#node']->type) && $form_id == $form['#node']->type . '_node_form' && in_array($form['#node']->type, webform_variable_get('webform_node_types'))) {
+  if (isset($form['#node']->type) && $form_id == $form['#node']->type . '_node_form' && variable_get('webform_node_' . $form['#node']->type, FALSE)) {
     $node = $form['#node'];
     // Preserve all Webform options currently set on the node.
     $form['webform'] = array(
@@ -1671,6 +1659,36 @@
 }
 
 /**
+ * Implements hook_form_BASE_FORM_ID_alter().
+ */
+function webform_form_node_type_form_alter(&$form, $form_state) {
+  if (isset($form['type'])) {
+    $form['webform'] = array(
+      '#title' => t('Webform'),
+      '#type' => 'fieldset',
+      '#collapsible' => TRUE,
+      '#collapsed' => TRUE,
+      '#group' => 'additional_settings',
+      '#weight' => 10,
+      '#attached' => array(
+        'js' => array(drupal_get_path('module', 'webform') . '/js/node-type-form.js'),
+      ),
+    );
+    $form['webform']['webform_node'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Enable webform functionality'),
+      '#description' => t('Allows a form to be attached to content. This will add tabs for "Webform" and "Results" on all content of this type.'),
+      '#weight' => 0,
+      '#default_value' => variable_get('webform_node_' . $form['#node_type']->type, FALSE),
+      '#attributes' => array(
+        'data-enabled-description' => t('Enabled'),
+        'data-disabled-description' => t('Disabled'),
+      ),
+    );
+  }
+}
+
+/**
  * Submit handler for the webform node form.
  *
  * Redirect the user to the components form on new node inserts. Note that this
@@ -1687,7 +1705,7 @@
 function webform_node_view($node, $view_mode) {
   global $user;
 
-  if (!in_array($node->type, webform_variable_get('webform_node_types'))) {
+  if (!variable_get('webform_node_' . $node->type, FALSE)) {
     return;
   }
 
@@ -1943,7 +1961,7 @@
  */
 function webform_block_info() {
   $blocks = array();
-  $webform_node_types = webform_variable_get('webform_node_types');
+  $webform_node_types = webform_node_types();
   if (!empty($webform_node_types)) {
     $query = db_select('webform', 'w')->fields('w')->fields('n', array('title'));
     $query->leftJoin('node', 'n', 'w.nid = n.nid');
@@ -3571,9 +3589,6 @@
     case 'webform_default_subject':
       $result = variable_get('webform_default_subject', t('Form submission from: [node:title]'));
       break;
-    case 'webform_node_types':
-      $result = variable_get('webform_node_types', array('webform'));
-      break;
     case 'webform_node_types_primary':
       $result = variable_get('webform_node_types_primary', array('webform'));
       break;
@@ -4200,7 +4215,7 @@
  */
 function webform_field_extra_fields() {
   $extra = array();
-  foreach (webform_variable_get('webform_node_types') as $type) {
+  foreach (webform_node_types() as $type) {
     $extra['node'][$type]['display']['webform'] = array(
       'label' => t('Webform'),
       'description' => t('Webform client form.'),
@@ -4215,7 +4230,7 @@
  */
 function webform_mollom_form_list() {
   $forms = array();
-  $webform_types = webform_variable_get('webform_node_types');
+  $webform_types = webform_node_types();
   if (empty($webform_types)) {
     return $forms;
   }
Index: sites/all/modules/webform/THEMING.txt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sites/all/modules/webform/THEMING.txt	(revision da0fd4395117fea74da9ab60df802c053b6175a1)
+++ sites/all/modules/webform/THEMING.txt	(revision )
@@ -66,7 +66,7 @@
     <li><a href="<?php print url('node/'. $node->nid . '/submission/'. $sid)?>">View your submission</a></li>
     <li><a href="<?php print url('node/'. $node->nid . '/submission/'. $sid .'/edit')?>">Edit your submission</a></li>
   </ul>
-  
+
   <?php /* End sample webform confirmation page */ ?>
 
 - You may edit the webform-confirmation.tpl.php file in your theme directory,
Index: sites/all/modules/webform/README.txt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- sites/all/modules/webform/README.txt	(revision da0fd4395117fea74da9ab60df802c053b6175a1)
+++ sites/all/modules/webform/README.txt	(revision )
@@ -1,9 +1,9 @@
 Description
 -----------
 This module adds a webform content type to your Drupal site.
-A webform can be a questionnaire, contact or request form. These can be used 
+A webform can be a questionnaire, contact or request form. These can be used
 by visitor to make contact or to enable a more complex survey than polls
-provide. Submissions from a webform are saved in a database table and 
+provide. Submissions from a webform are saved in a database table and
 can optionally be mailed to e-mail addresses upon submission.
 
 Requirements
