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:
Ingo Schommer 2013-12-19 08:31:04 -08:00
commit 2fe703592c

View File

@ -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);
}
}