Index: yui_editor.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/yui_editor/Attic/yui_editor.install,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 yui_editor.install
--- yui_editor.install	25 Jul 2008 21:36:39 -0000	1.1.2.1
+++ yui_editor.install	31 Oct 2008 16:57:47 -0000
@@ -9,6 +9,8 @@ function yui_editor_install() {
 function yui_editor_update_6200() {
   $profiles = variable_get('yui_editor_profiles', array());
   if (sizeof($profiles) == 0) {
+    // Need to include the module file first
+    include_once dirname(__FILE__).'/yui_editor.module';
     // Get a default profile
     $profile = yui_editor_profile_default();
 
Index: yui_editor.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/yui_editor/yui_editor.module,v
retrieving revision 1.5.2.27
diff -u -p -r1.5.2.27 yui_editor.module
--- yui_editor.module	25 Jul 2008 22:24:20 -0000	1.5.2.27
+++ yui_editor.module	31 Oct 2008 19:53:44 -0000
@@ -73,6 +73,37 @@ function yui_editor_init() {
         }
       }
       if ((empty($profile['include']) or preg_match($regexp, $path)) and $role_pass) {
+        if (!empty($profile['type'])) {
+
+          // This profile specifies a list of content-types to match
+
+          $matches = array();
+          if (preg_match('/^(node\/add\/(.*)|node\/(\d*)\/edit)$/',$path,$matches)) {
+
+            // Only check against node/add/* and node/*/edit pages
+
+            if (!empty($matches[2])) {
+              //                       For node/add/* pages, the content-type is in the path
+              $type = $matches[2];
+            }
+            elseif (!empty($matches[3])) {
+              //                       For node/*/edit pages, the nid is in the path
+              $type = db_result(db_query('select type from {node} where nid=%d',$matches[3]));
+            }
+            else {
+              //                       Shouldn't get here...
+              watchdog('error','Something is wrong with the content-type patch to yui_editor_init()');
+              continue;
+            }
+            if (!in_array($type,preg_split('/[\r\n]+/',$profile['type']))) {
+              //                       If the type of the current page isn't in the list, try the next profile.
+              continue;
+            }
+          }
+        }
+	$regexp = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), array('|', '.*', '\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), preg_quote($profile['type'], '/')) .')$/';
+        unset($profile['include']);
+        unset($profile['type']);
         yui_render_editor($profile);
         break 2;
       }
@@ -134,6 +165,7 @@ function yui_editor_profile_default() {
     'weight' => 10,
     'roles' => array(2 => 2),
     'include' => '',
+    'type' => '',
     'ids' => '',
     'title' => '',
     'titlebar' => 0,
@@ -209,6 +241,13 @@ function yui_editor_profile() {
     '#description' => t('Define where should YUI replace the body textarea, each path on a new line. You can use wildcards (*). (Leave blank for every form)'),
     '#rows' => 5,
     '#cols' => 60);
+  $form['display']['type'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Content types'),
+    '#default_value' => $profile['type'],
+    '#description' => t('For node/add/* and node/*/edit paths, list the content-types where YUI should appear, each content-type on a new line. (Leave blank for all content-types)'),
+    '#rows' => 5,
+    '#cols' => 60);
   $form['display']['ids'] = array(
     '#type' => 'textarea',
     '#title' => t('IDs'),
