? ckeditor-HEAD-hook_ckeditor_profile_alter-css.patch
Index: ckeditor.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ckeditor/ckeditor.module,v
retrieving revision 1.4
diff -u -B -r1.4 ckeditor.module
--- ckeditor.module	8 Dec 2009 08:06:21 -0000	1.4
+++ ckeditor.module	22 Jul 2010 19:34:19 -0000
@@ -359,6 +359,10 @@
     $result = db_query("SELECT * FROM {ckeditor_settings}");
     while (($data = db_fetch_object($result))) {
       $data->settings = unserialize($data->settings);
+      /* make css_path more accessible to the hook and other PHP */
+      if(!is_array($data->settings['css_path']))
+	$data->settings['css_path'] = explode(',', $data->settings['css_path']);
+
       $data->rids = array();
 
       $profiles[$data->name] = $data;
@@ -835,11 +839,11 @@
         break;
 
       case 'self':
-        $conf['css_path'] = str_replace("%h%t", "%t", $conf['css_path']);
         if (file_exists($module_drupal_path .'/ckeditor.css')) {
           $css_files[] = $module_full_path .'/ckeditor.css';
         }
-        $css_files[] = str_replace(array('%h', '%t'), array($host, $host . $themepath), $conf['css_path']);
+        $conf['css_path'] = str_replace("%h%t", "%t", $conf['css_path']);
+        $css_files = array_merge($css_files, str_replace(array('%h', '%t'), array($host, $host . $themepath), $conf['css_path']));
         break;
 
       case 'none':
Index: includes/ckeditor.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ckeditor/includes/ckeditor.admin.inc,v
retrieving revision 1.2
diff -u -B -r1.2 ckeditor.admin.inc
--- includes/ckeditor.admin.inc	4 Dec 2009 22:10:22 -0000	1.2
+++ includes/ckeditor.admin.inc	22 Jul 2010 19:34:19 -0000
@@ -610,7 +610,7 @@
   $form['css']['css_path'] = array(
     '#type' => 'textfield',
     '#title' => t('CSS path'),
-    '#default_value' => !empty($profile->settings['css_path']) ? $profile->settings['css_path'] : "",
+    '#default_value' => count($profile->settings['css_path']) ? implode(',', $profile->settings['css_path']) : "",
     '#size' => 40,
     '#maxlength' => 255,
     '#description' => t('Enter path to CSS file (Example: "css/editor.css") or a list of css files separated by a comma (Example: "/themes/garland/style.css,http://example.com/style.css"). Make sure to select "Define css" above.<br />Available placeholders:<br /><strong>%h</strong> - host name (!host).<br /><strong>%t</strong> - path to theme (!theme).', array('!host' => base_path(), '!theme' => base_path() . path_to_theme() .'/'))
@@ -868,6 +868,8 @@
 function ckeditor_admin_profile_form_submit($form, &$form_state) {
   $edit =& $form_state['values'];
 
+  $edit['css_path'] = explode(',', $edit['css_path']);
+
   if (isset($edit['_profile'])) {
     db_query("DELETE FROM {ckeditor_settings} WHERE name = '%s'", $edit['_profile']->name);
     db_query("DELETE FROM {ckeditor_role} WHERE name = '%s'", $edit['_profile']->name);
Index: includes/ckeditor.lib.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ckeditor/includes/ckeditor.lib.inc,v
retrieving revision 1.1
diff -u -B -r1.1 ckeditor.lib.inc
--- includes/ckeditor.lib.inc	4 Dec 2009 20:36:57 -0000	1.1
+++ includes/ckeditor.lib.inc	22 Jul 2010 19:34:19 -0000
@@ -321,6 +321,11 @@
         $enabled = ckeditor_is_enabled(empty($conf['excl_mode']) ? '0' : $conf['excl_mode'], empty($conf['excl_regex']) ? '' : $conf['excl_regex'], $element_id, $_GET['q']);
 
         if ($enabled) {
+	  if ($element_id != NULL) {
+	    /* prevent the hook's changes from being cached */
+	    $profile = clone $profile;
+	    module_invoke_all('ckeditor_profile_alter', $profile, $profile_name, $element_id, $_GET['q']);
+	  }
           return $profile;
         }
       }
