mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #562 from silverstripe-rebelalliance/bugfix/themedcss
Make themedCSS use {theme}_{module}/css/{name}.css files if they exist
This commit is contained in:
commit
5e47159a52
@ -1074,16 +1074,18 @@ class Requirements_Backend {
|
||||
* @see Requirements::themedCSS()
|
||||
*/
|
||||
public function themedCSS($name, $module = null, $media = null) {
|
||||
$theme = SSViewer::current_theme();
|
||||
$path = SSViewer::get_theme_folder() . "/css/$name.css";
|
||||
$path = SSViewer::get_theme_folder();
|
||||
$abspath = BASE_PATH . DIRECTORY_SEPARATOR . $path;
|
||||
$css = "/css/$name.css";
|
||||
|
||||
if (file_exists(BASE_PATH . '/' . $path)) {
|
||||
$this->css($path, $media);
|
||||
return;
|
||||
if ($module && file_exists($abspath.'_'.$module.$css)) {
|
||||
$this->css($path.'_'.$module.$css, $media);
|
||||
}
|
||||
|
||||
if ($module) {
|
||||
$this->css("$module/css/$name.css");
|
||||
else if (file_exists($abspath.$css)) {
|
||||
$this->css($path.$css, $media);
|
||||
}
|
||||
else if ($module) {
|
||||
$this->css($module.$css);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user