? yui_editor_exclude_path.patch
Index: yui_editor.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/yui_editor/yui_editor.module,v
retrieving revision 1.1.2.18
diff -u -p -r1.1.2.18 yui_editor.module
--- yui_editor.module	8 Jul 2008 17:54:06 -0000	1.1.2.18
+++ yui_editor.module	15 May 2009 12:51:58 -0000
@@ -52,6 +52,13 @@ function yui_editor_settings_form() {
     '#default_value' => variable_get('yui_editor_include', ''),
     '#rows' => 5,
     '#cols' => 60);
+  $form['yui_editor_exclude'] = array(
+    '#type' => 'textarea',
+    '#title' => t('Paths for excluding YUI editor'),
+    '#description' => t('Define where should not YUI replace the body textarea, each path on a new line. You can use wildcards (*).'),
+    '#default_value' => variable_get('yui_editor_exclude', ''),
+    '#rows' => 5,
+    '#cols' => 60);
   $form['yui_editor_ids'] = array(
     '#type' => 'textarea',
     '#title' => t('IDs'),
@@ -156,6 +163,11 @@ function yui_editor_form_alter($form_id,
     return;
   }
 
+  $regexp_for_exclude = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\<front\\\\>($|\|)/'), array('|', '.*', '\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), preg_quote(variable_get("yui_editor_exclude", ''), '/')) .')$/';
+  if(preg_match($regexp_for_exclude, $path)) {
+    $enabled = FALSE;
+  }
+
   $yui_source = variable_get('yui_source','http://yui.yahooapis.com/2.5.1');
   yui_add_css('editor', $yui_source, '/build/menu/assets/skins/sam/menu.css');
   yui_add_css('editor', $yui_source, '/build/button/assets/skins/sam/button.css');
