Index: wysiwyg.admin.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/wysiwyg/wysiwyg.admin.inc,v
retrieving revision 1.15.2.12
diff -u -r1.15.2.12 wysiwyg.admin.inc
--- wysiwyg.admin.inc	19 Dec 2010 21:00:25 -0000	1.15.2.12
+++ wysiwyg.admin.inc	3 Mar 2011 14:39:23 -0000
@@ -145,7 +145,7 @@
         );
       }
     }
-    else if (isset($meta['extensions']) && is_array($meta['extensions'])) {
+    elseif (isset($meta['extensions']) && is_array($meta['extensions'])) {
       foreach ($meta['extensions'] as $extension => $title) {
         $form['buttons'][$name][$extension] = array(
           '#type' => 'checkbox',
@@ -280,7 +280,7 @@
     '#default_value' => $profile->settings['css_path'],
     '#size' => 40,
     '#maxlength' => 255,
-    '#description' => t('If "Define CSS" was selected above, enter path to a CSS file or a list of CSS files separated by a comma.') . '<br />' . t('Available tokens: <code>%b</code> (base path, eg: <code>/</code>), <code>%t</code> (path to theme, eg: <code>themes/garland</code>)') . '<br />' . t('Example:') . ' css/editor.css,/themes/garland/style.css,%b%t/style.css,http://example.com/external.css',
+    '#description' => t('If "Define CSS" was selected above, enter path to a CSS file or a list of CSS files separated by a comma.') . '<br />' . t('Available tokens: <code>%b</code> (base path, eg: <code>/</code>), <code>%t</code> (path to theme, eg: <code>themes/garland</code>), <code>%f</code> (path to file system, eg: <code>sites/default/files') . '<br />' . t('Example:') . ' css/editor.css,/themes/garland/style.css,%b%t/style.css,http://example.com/external.css',
   );
 
   $form['css']['css_classes'] = array(
Index: editors/whizzywig.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/wysiwyg/editors/whizzywig.inc,v
retrieving revision 1.3.2.5
diff -u -r1.3.2.5 whizzywig.inc
--- editors/whizzywig.inc	13 Nov 2010 18:31:25 -0000	1.3.2.5
+++ editors/whizzywig.inc	3 Mar 2011 14:39:23 -0000
@@ -110,8 +110,26 @@
         $settings['externalCSS'] = base_path() . $css;
       }
     }
-    else if ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['externalCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+    elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
+      $csspath = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme(), '%f' => file_directory_path()));
+      if (preg_match('/.*\.css$/', $csspath)) {
+        $settings['externalCSS'] = $csspath;
+      }
+      else {
+        global $base_url;
+        $cssfiles = file_scan_directory($csspath, '.*\.css$');
+        if ($cssfiles) {
+          foreach ($cssfiles as $key) {
+            $filesarray[] = $base_url . '/' . $key->filename;
+          }
+        $settings['externalCSS'] = implode(',', $filesarray);
+        }
+        else {
+          if (user_access('administer filters')) {
+            drupal_set_message(t("The wyswiwyg css path is not configured properly. Check the !settings_url settings page!", array('!settings_url' => l(t('Wysiwyg profiles'), 'admin/settings/wysiwyg'))), 'error');
+          }
+        }
+      }
     }
   }
 
Index: editors/openwysiwyg.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/wysiwyg/editors/openwysiwyg.inc,v
retrieving revision 1.4.2.3
diff -u -r1.4.2.3 openwysiwyg.inc
--- editors/openwysiwyg.inc	13 Nov 2010 18:31:25 -0000	1.4.2.3
+++ editors/openwysiwyg.inc	3 Mar 2011 14:39:23 -0000
@@ -103,8 +103,26 @@
     if ($config['css_setting'] == 'theme') {
       $settings['CSSFile'] = reset(wysiwyg_get_css());
     }
-    else if ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['CSSFile'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+    elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
+      $csspath = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme(), '%f' => file_directory_path()));
+      if (preg_match('/.*\.css$/', $csspath)) {
+        $settings['CSSFile'] = $csspath;
+      }
+      else {
+        global $base_url;
+        $cssfiles = file_scan_directory($csspath, '.*\.css$');
+        if ($cssfiles) {
+          foreach ($cssfiles as $key) {
+            $filesarray[] = $base_url . '/' . $key->filename;
+          }
+        $settings['CSSFile'] = implode(',', $filesarray);
+        }
+        else {
+          if (user_access('administer filters')) {
+            drupal_set_message(t("The wyswiwyg css path is not configured properly. Check the !settings_url settings page!", array('!settings_url' => l(t('Wysiwyg profiles'), 'admin/settings/wysiwyg'))), 'error');
+          }
+        }
+      }
     }
   }
 
@@ -127,7 +145,7 @@
     }
   }
 
-  // @todo 
+  // @todo
 //  if (isset($config['block_formats'])) {
 //    $settings['DropDowns']['headings']['elements'] = explode(',', $config['block_formats']);
 //  }
Index: editors/nicedit.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/wysiwyg/editors/nicedit.inc,v
retrieving revision 1.6.2.2
diff -u -r1.6.2.2 nicedit.inc
--- editors/nicedit.inc	13 Nov 2010 18:31:25 -0000	1.6.2.2
+++ editors/nicedit.inc	3 Mar 2011 14:39:23 -0000
@@ -83,8 +83,26 @@
         $settings['externalCSS'] = base_path() . $css;
       }
     }
-    else if ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['externalCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+    elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
+      $csspath = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme(), '%f' => file_directory_path()));
+      if (preg_match('/.*\.css$/', $csspath)) {
+        $settings['externalCSS'] = $csspath;
+      }
+      else {
+        global $base_url;
+        $cssfiles = file_scan_directory($csspath, '.*\.css$');
+        if ($cssfiles) {
+          foreach ($cssfiles as $key) {
+            $filesarray[] = $base_url . '/' . $key->filename;
+          }
+        $settings['externalCSS'] = implode(',', $filesarray);
+        }
+        else {
+          if (user_access('administer filters')) {
+            drupal_set_message(t("The wyswiwyg css path is not configured properly. Check the !settings_url settings page!", array('!settings_url' => l(t('Wysiwyg profiles'), 'admin/settings/wysiwyg'))), 'error');
+          }
+        }
+      }
     }
   }
 
Index: editors/wymeditor.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/wysiwyg/editors/wymeditor.inc,v
retrieving revision 1.4.2.5
diff -u -r1.4.2.5 wymeditor.inc
--- editors/wymeditor.inc	13 Nov 2010 18:31:25 -0000	1.4.2.5
+++ editors/wymeditor.inc	3 Mar 2011 14:39:23 -0000
@@ -175,8 +175,8 @@
       // WYMeditor only supports one CSS file currently.
       $settings['stylesheet'] = reset(wysiwyg_get_css());
     }
-    else if ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['stylesheet'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+    elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
+      $settings['stylesheet'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme(), '%f' => file_directory_path()));
     }
   }
 
@@ -213,22 +213,22 @@
  */
 function _wysiwyg_wymeditor_button_info() {
   return array(
-    'Bold' => array('title'=> 'Strong', 'css'=> 'wym_tools_strong'),
-    'Italic' => array('title'=> 'Emphasis', 'css'=> 'wym_tools_emphasis'),
-    'Superscript' => array('title'=> 'Superscript', 'css'=> 'wym_tools_superscript'),
-    'Subscript' => array('title'=> 'Subscript', 'css'=> 'wym_tools_subscript'),
-    'InsertOrderedList' => array('title'=> 'Ordered_List', 'css'=> 'wym_tools_ordered_list'),
-    'InsertUnorderedList' => array('title'=> 'Unordered_List', 'css'=> 'wym_tools_unordered_list'),
-    'Indent' => array('title'=> 'Indent', 'css'=> 'wym_tools_indent'),
-    'Outdent' => array('title'=> 'Outdent', 'css'=> 'wym_tools_outdent'),
-    'Undo' => array('title'=> 'Undo', 'css'=> 'wym_tools_undo'),
-    'Redo' => array('title'=> 'Redo', 'css'=> 'wym_tools_redo'),
-    'CreateLink' => array('title'=> 'Link', 'css'=> 'wym_tools_link'),
-    'Unlink' => array('title'=> 'Unlink', 'css'=> 'wym_tools_unlink'),
-    'InsertImage' => array('title'=> 'Image', 'css'=> 'wym_tools_image'),
-    'InsertTable' => array('title'=> 'Table', 'css'=> 'wym_tools_table'),
-    'Paste' => array('title'=> 'Paste_From_Word', 'css'=> 'wym_tools_paste'),
-    'ToggleHtml' => array('title'=> 'HTML', 'css'=> 'wym_tools_html'),
-    'Preview' => array('title'=> 'Preview', 'css'=> 'wym_tools_preview'),
+    'Bold'  => array('title' => 'Strong', 'css' => 'wym_tools_strong'),
+    'Italic'  => array('title' => 'Emphasis', 'css' => 'wym_tools_emphasis'),
+    'Superscript'  => array('title' => 'Superscript', 'css' => 'wym_tools_superscript'),
+    'Subscript'  => array('title' => 'Subscript', 'css' => 'wym_tools_subscript'),
+    'InsertOrderedList'  => array('title' => 'Ordered_List', 'css' => 'wym_tools_ordered_list'),
+    'InsertUnorderedList'  => array('title' => 'Unordered_List', 'css' => 'wym_tools_unordered_list'),
+    'Indent'  => array('title' => 'Indent', 'css' => 'wym_tools_indent'),
+    'Outdent'  => array('title' => 'Outdent', 'css' => 'wym_tools_outdent'),
+    'Undo'  => array('title' => 'Undo', 'css' => 'wym_tools_undo'),
+    'Redo'  => array('title' => 'Redo', 'css' => 'wym_tools_redo'),
+    'CreateLink'  => array('title' => 'Link', 'css' => 'wym_tools_link'),
+    'Unlink'  => array('title' => 'Unlink', 'css' => 'wym_tools_unlink'),
+    'InsertImage'  => array('title' => 'Image', 'css' => 'wym_tools_image'),
+    'InsertTable'  => array('title' => 'Table', 'css' => 'wym_tools_table'),
+    'Paste'  => array('title' => 'Paste_From_Word', 'css' => 'wym_tools_paste'),
+    'ToggleHtml'  => array('title' => 'HTML', 'css' => 'wym_tools_html'),
+    'Preview'  => array('title' => 'Preview', 'css' => 'wym_tools_preview'),
   );
 }
Index: editors/yui.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/wysiwyg/editors/yui.inc,v
retrieving revision 1.6.2.5
diff -u -r1.6.2.5 yui.inc
--- editors/yui.inc	13 Nov 2010 18:31:25 -0000	1.6.2.5
+++ editors/yui.inc	3 Mar 2011 14:39:23 -0000
@@ -178,7 +178,7 @@
             }
           }
         }
-        else if ($button == 'fontname') {
+        elseif ($button == 'fontname') {
           $extra = array('menu' => array(
             array('text' => 'Arial', 'checked' => TRUE),
             array('text' => 'Arial Black'),
@@ -203,9 +203,26 @@
     if ($config['css_setting'] == 'theme') {
       $settings['extracss'] = wysiwyg_get_css();
     }
-    else if ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['extracss'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
-      $settings['extracss'] = explode(',', $settings['extracss']);
+    elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
+      $csspath = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme(), '%f' => file_directory_path()));
+      if (preg_match('/.*\.css$/', $csspath)) {
+        $settings['extracss'] = explode(',', $csspath);
+      }
+      else {
+        global $base_url;
+        $cssfiles = file_scan_directory($csspath, '.*\.css$');
+        if ($cssfiles) {
+          foreach ($cssfiles as $key) {
+            $filesarray[] = $base_url . '/' . $key->filename;
+          }
+        $settings['extra_css'] = $filesarray;
+        }
+        else {
+          if (user_access('administer filters')) {
+            drupal_set_message(t("The wyswiwyg css path is not configured properly. Check the !settings_url settings page!", array('!settings_url' => l(t('Wysiwyg profiles'), 'admin/settings/wysiwyg'))), 'error');
+          }
+        }
+      }
     }
     // YUI only supports inline CSS, so we need to use @import directives.
     // Syntax: '@import "/base/path/to/theme/style.css"; '
Index: editors/fckeditor.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/wysiwyg/editors/fckeditor.inc,v
retrieving revision 1.17.2.5
diff -u -r1.17.2.5 fckeditor.inc
--- editors/fckeditor.inc	19 Dec 2010 23:27:09 -0000	1.17.2.5
+++ editors/fckeditor.inc	3 Mar 2011 14:39:23 -0000
@@ -132,8 +132,26 @@
     if ($config['css_setting'] == 'theme') {
       $settings['EditorAreaCSS'] = implode(',', wysiwyg_get_css());
     }
-    else if ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['EditorAreaCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+    elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
+      $csspath = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme(), '%f' => file_directory_path()));
+      if (preg_match('/.*\.css$/', $csspath)) {
+        $settings['EditorAreaCSS'] = $csspath;
+      }
+      else {
+        global $base_url;
+        $cssfiles = file_scan_directory($csspath, '.*\.css$');
+        if ($cssfiles) {
+          foreach ($cssfiles as $key) {
+            $filesarray[] = $base_url . '/' . $key->filename;
+          }
+        $settings['EditorAreaCSS'] = implode(',', $filesarray);
+        }
+        else {
+          if (user_access('administer filters')) {
+            drupal_set_message(t("The wyswiwyg css path is not configured properly. Check the !settings_url settings page!", array('!settings_url' => l(t('Wysiwyg profiles'), 'admin/settings/wysiwyg'))), 'error');
+          }
+        }
+      }
     }
   }
 
Index: editors/ckeditor.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/wysiwyg/editors/ckeditor.inc,v
retrieving revision 1.2.6.12
diff -u -r1.2.6.12 ckeditor.inc
--- editors/ckeditor.inc	14 Jan 2011 15:43:03 -0000	1.2.6.12
+++ editors/ckeditor.inc	3 Mar 2011 14:39:23 -0000
@@ -176,7 +176,25 @@
         $settings['contentsCss'] = wysiwyg_get_css();
       }
       elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-        $settings['contentsCss'] = explode(',', strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())));
+        $csspath = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme(), '%f' => file_directory_path()));
+        if (preg_match('/.*\.css$/', $csspath)) {
+          $settings['contentsCss'] = $csspath;
+        }
+        else {
+          global $base_url;
+          $cssfiles = file_scan_directory($csspath, '.*\.css$');
+          if ($cssfiles) {
+            foreach ($cssfiles as $key) {
+              $filesarray[] = $base_url . '/' . $key->filename;
+            }
+          $settings['contentsCss'] = implode(',', $filesarray);
+          }
+          else {
+            if (user_access('administer filters')) {
+              drupal_set_message(t("The wyswiwyg css path is not configured properly. Check the !settings_url settings page!", array('!settings_url' => l(t('Wysiwyg profiles'), 'admin/settings/wysiwyg'))), 'error');
+            }
+          }
+        }
       }
     }
   }
Index: editors/tinymce.inc
===================================================================
RCS file: /cvs/drupal/contributions/modules/wysiwyg/editors/tinymce.inc,v
retrieving revision 1.35.2.13
diff -u -r1.35.2.13 tinymce.inc
--- editors/tinymce.inc	3 Feb 2011 11:48:52 -0000	1.35.2.13
+++ editors/tinymce.inc	3 Mar 2011 14:39:23 -0000
@@ -190,8 +190,26 @@
     if ($config['css_setting'] == 'theme') {
       $settings['content_css'] = implode(',', wysiwyg_get_css());
     }
-    else if ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['content_css'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+    elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
+      $csspath = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme(), '%f' => file_directory_path()));
+      if (preg_match('/.*\.css$/', $csspath)) {
+        $settings['content_css'] = $csspath;
+      }
+      else {
+        global $base_url;
+        $cssfiles = file_scan_directory($csspath, '.*\.css$');
+        if ($cssfiles) {
+          foreach ($cssfiles as $key) {
+            $filesarray[] = $base_url . '/' . $key->filename;
+          }
+        $settings['content_css'] = implode(',', $filesarray);
+        }
+        else {
+          if (user_access('administer filters')) {
+            drupal_set_message(t("The wyswiwyg css path is not configured properly. Check the !settings_url settings page!", array('!settings_url' => l(t('Wysiwyg profiles'), 'admin/settings/wysiwyg'))), 'error');
+          }
+        }
+      }
     }
   }
 
@@ -230,15 +248,15 @@
             $settings['extensions'][_wysiwyg_tinymce_plugin_name('add', $button)] = 1;
           }
           // Add external plugins to the list of extensions.
-          else if ($type == 'buttons' && empty($plugins[$plugin]['internal'])) {
+          elseif ($type == 'buttons' && empty($plugins[$plugin]['internal'])) {
             $settings['extensions'][_wysiwyg_tinymce_plugin_name('add', $plugin)] = 1;
           }
           // Add internal buttons that also need to be loaded as extension.
-          else if ($type == 'buttons' && !empty($plugins[$plugin]['load'])) {
+          elseif ($type == 'buttons' && !empty($plugins[$plugin]['load'])) {
             $settings['extensions'][$plugin] = 1;
           }
           // Add plain extensions.
-          else if ($type == 'extensions' && !empty($plugins[$plugin]['load'])) {
+          elseif ($type == 'extensions' && !empty($plugins[$plugin]['load'])) {
             $settings['extensions'][$plugin] = 1;
           }
           // Allow plugins to add valid HTML elements.
@@ -369,7 +387,7 @@
     }
     return $name;
   }
-  else if ($op == 'remove') {
+  elseif ($op == 'remove') {
     if (strpos($name, '-') === 0) {
       return substr($name, 1);
     }
Index: .project
===================================================================
RCS file: .project
diff -N .project
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ .project	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>wysiwyg</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>
