From f8bb9666c301b7f4cac3421cc070e36857b40214 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Thu, 18 Feb 2010 08:47:47 +0000 Subject: [PATCH] theme MDL-21648 Added support for styles_themename.css files for plugins --- lib/outputlib.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/outputlib.php b/lib/outputlib.php index 38f2d8583ed..885d064baf1 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -695,9 +695,20 @@ class theme_config { and in_array($plugin, $excludes[$type])) { continue; } + + $plugincontent = ''; $sheetfile = "$fulldir/styles.css"; if (is_readable($sheetfile)) { - $css['plugins'][$type.'_'.$plugin] = $this->post_process("/*** Standard plugin $type/$plugin ***/\n\n" . file_get_contents($sheetfile)); + $plugincontent .= "/*** Standard plugin $type/$plugin ***/\n\n"; + $plugincontent .= file_get_contents($sheetfile); + } + $sheetthemefile = "$fulldir/styles_{$this->name}.css"; + if (is_readable($sheetthemefile)) { + $plugincontent .= "\n/*** Standard plugin $type/$plugin for the {$this->name} theme ***/\n\n"; + $plugincontent .= file_get_contents($sheetthemefile); + } + if (!empty($plugincontent)) { + $css['plugins'][$type.'_'.$plugin] = $this->post_process($plugincontent); } } }