diff --git editors/ckeditor.inc editors/ckeditor.inc index c52ebbf..409a0cf 100644 --- editors/ckeditor.inc +++ editors/ckeditor.inc @@ -161,13 +161,14 @@ function wysiwyg_ckeditor_settings($editor, $config, $theme) { } if (isset($config['css_setting'])) { + global $theme_key; // Versions below 3.0.1 could only handle one stylesheet. if (version_compare($editor['installed version'], '3.0.1.4391', '<')) { if ($config['css_setting'] == 'theme') { $settings['contentsCss'] = reset(wysiwyg_get_css()); } elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) { - $settings['contentsCss'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme())); + $settings['contentsCss'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme_key))); } } else { @@ -175,7 +176,7 @@ function wysiwyg_ckeditor_settings($editor, $config, $theme) { $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()))); + $settings['contentsCss'] = explode(',', strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme_key)))); } } } diff --git editors/fckeditor.inc editors/fckeditor.inc index ba1d7f2..1c4f5e6 100644 --- editors/fckeditor.inc +++ editors/fckeditor.inc @@ -133,7 +133,8 @@ function wysiwyg_fckeditor_settings($editor, $config, $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())); + global $theme_key; + $settings['EditorAreaCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme_key))); } } diff --git editors/nicedit.inc editors/nicedit.inc index 90dd973..d8250d2 100644 --- editors/nicedit.inc +++ editors/nicedit.inc @@ -77,14 +77,15 @@ function wysiwyg_nicedit_settings($editor, $config, $theme) { // Add editor content stylesheet. if (isset($config['css_setting'])) { + global $theme_key; if ($config['css_setting'] == 'theme') { - $css = path_to_theme() . '/style.css'; + $css = drupal_get_path('theme', $theme_key) . '/style.css'; if (file_exists($css)) { $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())); + $settings['externalCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme_key))); } } diff --git editors/openwysiwyg.inc editors/openwysiwyg.inc index 889afac..bab12cc 100644 --- editors/openwysiwyg.inc +++ editors/openwysiwyg.inc @@ -104,7 +104,8 @@ function wysiwyg_openwysiwyg_settings($editor, $config, $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())); + global $theme_key; + $settings['CSSFile'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme_key))); } } diff --git editors/tinymce.inc editors/tinymce.inc index 2c74f11..d11d763 100644 --- editors/tinymce.inc +++ editors/tinymce.inc @@ -192,7 +192,8 @@ function wysiwyg_tinymce_settings($editor, $config, $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())); + global $theme_key; + $settings['content_css'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme_key))); } } diff --git editors/whizzywig.inc editors/whizzywig.inc index bc8c4ad..20dfe31 100644 --- editors/whizzywig.inc +++ editors/whizzywig.inc @@ -104,14 +104,15 @@ function wysiwyg_whizzywig_settings($editor, $config, $theme) { // Add editor content stylesheet. if (isset($config['css_setting'])) { + global $theme_key; if ($config['css_setting'] == 'theme') { - $css = path_to_theme() . '/style.css'; + $css = drupal_get_path('theme', $theme_key) . '/style.css'; if (file_exists($css)) { $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())); + $settings['externalCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme_key))); } } diff --git editors/wymeditor.inc editors/wymeditor.inc index d0bf759..82a9adf 100644 --- editors/wymeditor.inc +++ editors/wymeditor.inc @@ -176,7 +176,8 @@ function wysiwyg_wymeditor_settings($editor, $config, $theme) { $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())); + global $theme_key; + $settings['stylesheet'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme_key))); } } diff --git editors/yui.inc editors/yui.inc index a18be2e..c6c791a 100644 --- editors/yui.inc +++ editors/yui.inc @@ -204,7 +204,8 @@ function wysiwyg_yui_settings($editor, $config, $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())); + global $theme_key; + $settings['extracss'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', $theme_key))); $settings['extracss'] = explode(',', $settings['extracss']); } // YUI only supports inline CSS, so we need to use @import directives.