From 258cf2551d1d3ccc2dba968d659f9dc7e7c6abf7 Mon Sep 17 00:00:00 2001
From: jameselliott <jameselliott@720608.no-reply.drupal.org>
Date: Mon, 17 Sep 2012 01:12:44 +0200
Subject: [PATCH] - #835682 by james.elliott, TwoD, Paul Lomax, JacobSingh:
 Fixed %t (path_to_theme()) returns wrong theme path.

---
 editors/ckeditor.inc    | 4 ++--
 editors/fckeditor.inc   | 2 +-
 editors/nicedit.inc     | 4 ++--
 editors/openwysiwyg.inc | 2 +-
 editors/tinymce.inc     | 2 +-
 editors/whizzywig.inc   | 4 ++--
 editors/wymeditor.inc   | 2 +-
 editors/yui.inc         | 2 +-
 8 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/editors/ckeditor.inc b/editors/ckeditor.inc
index 9d92a78..e3c6027 100644
--- a/editors/ckeditor.inc
+++ b/editors/ckeditor.inc
@@ -211,7 +211,7 @@ function wysiwyg_ckeditor_settings($editor, $config, $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', variable_get('theme_default', NULL))));
       }
     }
     else {
@@ -219,7 +219,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', variable_get('theme_default', NULL)))));
       }
     }
   }
diff --git a/editors/fckeditor.inc b/editors/fckeditor.inc
index fba81f6..27bcb7b 100644
--- a/editors/fckeditor.inc
+++ b/editors/fckeditor.inc
@@ -132,7 +132,7 @@ function wysiwyg_fckeditor_settings($editor, $config, $theme) {
       $settings['EditorAreaCSS'] = implode(',', wysiwyg_get_css());
     }
     elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['EditorAreaCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+      $settings['EditorAreaCSS'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', variable_get('theme_default', NULL))));
     }
   }
 
diff --git a/editors/nicedit.inc b/editors/nicedit.inc
index 55404b8..6acc800 100644
--- a/editors/nicedit.inc
+++ b/editors/nicedit.inc
@@ -77,13 +77,13 @@ function wysiwyg_nicedit_settings($editor, $config, $theme) {
   // Add editor content stylesheet.
   if (isset($config['css_setting'])) {
     if ($config['css_setting'] == 'theme') {
-      $css = path_to_theme() . '/style.css';
+      $css = drupal_get_path('theme', variable_get('theme_default', NULL)) . '/style.css';
       if (file_exists($css)) {
         $settings['externalCSS'] = base_path() . $css;
       }
     }
     elseif ($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', variable_get('theme_default', NULL))));
     }
   }
 
diff --git a/editors/openwysiwyg.inc b/editors/openwysiwyg.inc
index 3a4b66c..b3ad84d 100644
--- a/editors/openwysiwyg.inc
+++ b/editors/openwysiwyg.inc
@@ -103,7 +103,7 @@ function wysiwyg_openwysiwyg_settings($editor, $config, $theme) {
       $settings['CSSFile'] = reset(wysiwyg_get_css());
     }
     elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['CSSFile'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+      $settings['CSSFile'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', variable_get('theme_default', NULL))));
     }
   }
 
diff --git a/editors/tinymce.inc b/editors/tinymce.inc
index 11f81aa..bf0cd11 100644
--- a/editors/tinymce.inc
+++ b/editors/tinymce.inc
@@ -191,7 +191,7 @@ function wysiwyg_tinymce_settings($editor, $config, $theme) {
       $settings['content_css'] = implode(',', wysiwyg_get_css());
     }
     elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['content_css'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+      $settings['content_css'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', variable_get('theme_default', NULL))));
     }
   }
 
diff --git a/editors/whizzywig.inc b/editors/whizzywig.inc
index 96c9ead..acfc7de 100644
--- a/editors/whizzywig.inc
+++ b/editors/whizzywig.inc
@@ -104,13 +104,13 @@ function wysiwyg_whizzywig_settings($editor, $config, $theme) {
   // Add editor content stylesheet.
   if (isset($config['css_setting'])) {
     if ($config['css_setting'] == 'theme') {
-      $css = path_to_theme() . '/style.css';
+      $css = drupal_get_path('theme', variable_get('theme_default', NULL)) . '/style.css';
       if (file_exists($css)) {
         $settings['externalCSS'] = base_path() . $css;
       }
     }
     elseif ($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', variable_get('theme_default', NULL))));
     }
   }
 
diff --git a/editors/wymeditor.inc b/editors/wymeditor.inc
index 0094c2d..5f44d64 100644
--- a/editors/wymeditor.inc
+++ b/editors/wymeditor.inc
@@ -176,7 +176,7 @@ function wysiwyg_wymeditor_settings($editor, $config, $theme) {
       $settings['stylesheet'] = reset($css);
     }
     elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['stylesheet'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+      $settings['stylesheet'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', variable_get('theme_default', NULL))));
     }
   }
 
diff --git a/editors/yui.inc b/editors/yui.inc
index cd722c3..36d0a59 100644
--- a/editors/yui.inc
+++ b/editors/yui.inc
@@ -211,7 +211,7 @@ function wysiwyg_yui_settings($editor, $config, $theme) {
       $settings['extracss'] = wysiwyg_get_css();
     }
     elseif ($config['css_setting'] == 'self' && isset($config['css_path'])) {
-      $settings['extracss'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => path_to_theme()));
+      $settings['extracss'] = strtr($config['css_path'], array('%b' => base_path(), '%t' => drupal_get_path('theme', variable_get('theme_default', NULL))));
       $settings['extracss'] = explode(',', $settings['extracss']);
     }
     // YUI only supports inline CSS, so we need to use @import directives.
-- 
1.7.11.msysgit.1

