mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #2614 from ryanwachtl/2613-themedcss-project-dir
Check for file in project() folder when calling Requirements::themedCSS(...
This commit is contained in:
commit
2fe703592c
@ -1128,17 +1128,20 @@ class Requirements_Backend {
|
||||
* @see Requirements::themedCSS()
|
||||
*/
|
||||
public function themedCSS($name, $module = null, $media = null) {
|
||||
$path = SSViewer::get_theme_folder();
|
||||
$abspath = BASE_PATH . DIRECTORY_SEPARATOR . $path;
|
||||
$theme = SSViewer::get_theme_folder();
|
||||
$project = project();
|
||||
$absbase = BASE_PATH . DIRECTORY_SEPARATOR;
|
||||
$abstheme = $absbase . $theme;
|
||||
$absproject = $absbase . $project;
|
||||
$css = "/css/$name.css";
|
||||
|
||||
if ($module && file_exists($abspath.'_'.$module.$css)) {
|
||||
$this->css($path.'_'.$module.$css, $media);
|
||||
}
|
||||
else if (file_exists($abspath.$css)) {
|
||||
$this->css($path.$css, $media);
|
||||
}
|
||||
else if ($module) {
|
||||
if(file_exists($absproject . $css)) {
|
||||
$this->css($project . $css, $media);
|
||||
} elseif($module && file_exists($abstheme . '_' . $module.$css)) {
|
||||
$this->css($theme . '_' . $module . $css, $media);
|
||||
} elseif(file_exists($abstheme . $css)) {
|
||||
$this->css($theme . $css, $media);
|
||||
} elseif($module) {
|
||||
$this->css($module . $css, $media);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user