# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: moodle/lib/outputlib.php
--- moodle/lib/outputlib.php Base (1.149)
+++ moodle/lib/outputlib.php Locally Modified (Based On 1.149)
@@ -558,17 +558,17 @@
      * Returns the content of the CSS to be used in editor content
      * @return string
      */
-    public function editor_css_content() {
+    public function editor_css_files() {
         global $CFG;
 
-        $css = '';
+        $files = array();
 
         // first editor plugins
         $plugins = get_plugin_list('editor');
         foreach ($plugins as $plugin=>$fulldir) {
             $sheetfile = "$fulldir/editor_styles.css";
             if (is_readable($sheetfile)) {
-                $css .= "/*** Editor $plugin content CSS ***/\n\n" . file_get_contents($sheetfile) . "\n\n";
+                $files['plugin_'.$plugin] = $sheetfile;
             }
         }
         // then parent themes
@@ -579,21 +579,21 @@
             foreach ($parent_config->editor_sheets as $sheet) {
                 $sheetfile = "$parent_config->dir/$sheet.css";
                 if (is_readable($sheetfile)) {
-                    $css .= "/*** Parent theme {$parent_config->name}/$sheet ***/\n\n" . file_get_contents($sheetfile) . "\n\n";
+                    $files['parent_'.$parent_config->name.'_'.$sheet] = $sheetfile;
                 }
             }
         }
         // finally this theme
         if (!empty($this->editor_sheets)) {
             foreach ($this->editor_sheets as $sheet) {
-                $sheetfile = "$this->dir/$sheet.css";
+                $sheetfile = "$this->dir/style/$sheet.css";
                 if (is_readable($sheetfile)) {
-                    $css .= "/*** Theme $sheet ***/\n\n" . file_get_contents($sheetfile) . "\n\n";
+                    $files['theme_'.$sheet] = $sheetfile;
                 }
             }
         }
 
-        return $this->post_process($css);
+        return $files;
     }
 
     /**
@@ -648,12 +648,12 @@
 
             if (check_browser_version('MSIE', 5)) {
                 // lalala, IE does not allow more than 31 linked CSS files from main document
-                $urls[] = new moodle_url($CFG->httpswwwroot.'/theme/styles_debug.php', array('theme'=>$this->name, 'type'=>'ie', 'subtype'=>'plugins'));
+                $urls[] = new moodle_url($baseurl, array('theme'=>$this->name, 'type'=>'ie', 'subtype'=>'plugins'));
                 foreach ($css['parents'] as $parent=>$sheets) {
                     // We need to serve parents individually otherwise we may easily exceed the style limit IE imposes (4096)
-                    $urls[] = new moodle_url($CFG->httpswwwroot.'/theme/styles_debug.php', array('theme'=>$this->name,'type'=>'ie', 'subtype'=>'parents', 'sheet'=>$parent));
+                    $urls[] = new moodle_url($baseurl, array('theme'=>$this->name,'type'=>'ie', 'subtype'=>'parents', 'sheet'=>$parent));
                 }
-                $urls[] = new moodle_url($CFG->httpswwwroot.'/theme/styles_debug.php', array('theme'=>$this->name, 'type'=>'ie', 'subtype'=>'theme'));
+                $urls[] = new moodle_url($baseurl, array('theme'=>$this->name, 'type'=>'ie', 'subtype'=>'theme'));
 
             } else {
                 foreach ($css['plugins'] as $plugin=>$unused) {
@@ -746,7 +746,8 @@
      * @return string
      */
     public function css_content() {
-        $css = $this->css_files_get_contents($this->css_files(), array());
+        $files = array_merge($this->css_files(), array('editor'=>$this->editor_css_files()));
+        $css = $this->css_files_get_contents($files, array());
         return $css;
     }
 
Index: moodle/theme/anomaly/config.php
--- moodle/theme/anomaly/config.php Base (1.14)
+++ moodle/theme/anomaly/config.php Locally Modified (Based On 1.14)
@@ -37,8 +37,6 @@
  'waitForPlay=yes';
 /// ...And this controls the small embedded player
 
-$THEME->editor_sheets = array('styles_tinymce');
-
\ No newline at end of file
 $THEME->layouts = array(
     // Most pages - if we encounter an unknown or a missing page type, this one is used.
     'base' => array(
Index: moodle/theme/formal_white/config.php
--- moodle/theme/formal_white/config.php Base (1.22)
+++ moodle/theme/formal_white/config.php Locally Modified (Based On 1.22)
@@ -72,8 +72,6 @@
  'waitForPlay=yes';
 /// ...And this controls the small embedded player
 
-$THEME->editor_sheets = array('styles_tinymce');
-
\ No newline at end of file
 $THEME->layouts = array(
     // Most pages - if we encounter an unknown or a missing page type, this one is used.
     'base' => array(
Index: moodle/theme/magazine/config.php
--- moodle/theme/magazine/config.php Base (1.2)
+++ moodle/theme/magazine/config.php Locally Modified (Based On 1.2)
@@ -35,9 +35,6 @@
 // Do you want to use the new navigation dock?
 ////////////////////////////////////////////////////
 
-
-$THEME->editor_sheets = array('editor');
-
\ No newline at end of file
 ////////////////////////////////////////////////////
 // An array of stylesheets to include within the
 // body of the editor.
Index: moodle/theme/styles.php
--- moodle/theme/styles.php Base (1.14)
+++ moodle/theme/styles.php Locally Modified (Based On 1.14)
@@ -77,8 +77,8 @@
 $theme = theme_config::load($themename);
 
 if ($type === 'editor') {
-    $css = $theme->editor_css_content();
-    store_css($theme, $candidatesheet, $css);
+    $files = $theme->editor_css_files();
+    store_css($theme, $candidatesheet, $files);
 } else {
     $css = $theme->css_files();
     $allfiles = array();
Index: moodle/theme/styles_debug.php
--- moodle/theme/styles_debug.php Base (1.10)
+++ moodle/theme/styles_debug.php Locally Modified (Based On 1.10)
@@ -58,7 +58,11 @@
 
 $css = unserialize($css);
 
-if ($type === 'ie') {
+if ($type === 'editor') {
+    if (isset($css['editor'])) {
+        send_uncached_css(implode("\n\n", $css['editor']));
+    }
+} else if ($type === 'ie') {
     // IE is a sloppy browser with weird limits, sorry
     if ($subtype === 'plugins') {
         $sendcss = implode("\n\n", $css['plugins']);
@@ -100,7 +104,7 @@
 
 } else if ($type === 'parent') {
     if (isset($css['parents'][$subtype][$sheet])) {
-        send_uncached_css($css['parents'][$subtype][$sheet], 30); // parent sheets are not supposed to change much, right?
+        send_uncached_css($css['parents'][$subtype][$sheet]);
     }
 
 } else if ($type === 'theme') {
