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,18 +1128,21 @@ class Requirements_Backend {
* @see Requirements::themedCSS() * @see Requirements::themedCSS()
*/ */
public function themedCSS($name, $module = null, $media = null) { public function themedCSS($name, $module = null, $media = null) {
$path = SSViewer::get_theme_folder(); $theme = SSViewer::get_theme_folder();
$abspath = BASE_PATH . DIRECTORY_SEPARATOR . $path; $project = project();
$absbase = BASE_PATH . DIRECTORY_SEPARATOR;
$abstheme = $absbase . $theme;
$absproject = $absbase . $project;
$css = "/css/$name.css"; $css = "/css/$name.css";
if ($module && file_exists($abspath.'_'.$module.$css)) { if(file_exists($absproject . $css)) {
$this->css($path.'_'.$module.$css, $media); $this->css($project . $css, $media);
} } elseif($module && file_exists($abstheme . '_' . $module.$css)) {
else if (file_exists($abspath.$css)) { $this->css($theme . '_' . $module . $css, $media);
$this->css($path.$css, $media); } elseif(file_exists($abstheme . $css)) {
} $this->css($theme . $css, $media);
else if ($module) { } elseif($module) {
$this->css($module.$css, $media); $this->css($module . $css, $media);
} }
} }