--- quicktags.module	2008-01-28 15:33:32.000000000 -0600
+++ quicktags_mod.module	2008-01-28 15:33:29.000000000 -0600
@@ -1,5 +1,5 @@
 <?php
-// $Id: quicktags.module,v 1.21 2007/02/03 10:59:25 ber Exp $
+// $Id: quicktags.module,v 1.22 2008/01/08 22:02:45 tcblack Exp $
 
 /**
  * Implementation of hook_help().
@@ -34,7 +34,20 @@ function quicktags_settings() {
     '#options' => array(0 => t('Everywhere'), 1 => t('Only nodes'), 2 => t('Nodes and comments')),
     '#description' => t('Where to show the quicktags toolbar.'),
   );
-
+  
+  $types = node_get_types();
+  foreach ($types as $type) {
+    $options[$type->type] = $type->name;
+  }
+  
+  $form['quicktags_options']['quicktags_content_types'] = array(
+    '#type' => 'checkboxes',
+    '#title' => t('Content Types'),
+    '#default_value' => variable_get('quicktags_content_types', array()),
+    '#options' => $options,
+    '#description' => t('Content types where to show the quicktags toolbar.'),
+  );
+  
   return system_settings_form($form);
 }
 
@@ -88,27 +101,37 @@ function quicktags_elements() {
  */
 function quicktags_show_quicktags() {
   if (user_access('use quicktags')) {
-    switch (variable_get('quicktags_show', 0)) {
-      case 0:
-        return TRUE;
-        break;
-      case 1:
-        if (arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit')) {
-          return TRUE;
-        }
-        break;
-      case 2:
-        if (arg(0) == 'node' || arg(0) == 'comment') {
+    if (arg(1) == 'add') {
+      $type = node_get_types('type', arg(2));
+    }
+    else if (arg(2) == 'edit') {
+      $node = node_load(arg(1));
+      $type = node_get_types('type', $node);
+    }
+    
+    $allowed_types = variable_get('quicktags_content_types', array());
+
+    if ($allowed_types[$type->type] === $type->type) {
+      switch (variable_get('quicktags_show', 0)) {
+        case 0:
           return TRUE;
-        }
-        break;
-      default:
-        return FALSE;
+          break;
+        case 1:
+          if (arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit')) {
+            return TRUE;
+          }
+          break;
+        case 2:
+          if (arg(0) == 'node' || arg(0) == 'comment') {
+            return TRUE;
+          }
+          break;
+        default:
+          return FALSE;
+      }
     }
   }
-  else {
-    return FALSE;
-  }
+  return FALSE;
 }
 
 /**
