From b260e5e29ce1ceb641123059a2ca80ee645e118e Mon Sep 17 00:00:00 2001 From: Ryan Wachtl Date: Fri, 25 Oct 2013 16:42:01 -0500 Subject: [PATCH] FIX Check for file in project() folder when calling Requirements::themedCSS() #2613 Allows overriding of theme and module css files by looking in project() folder first. Consistent with documented behavior. --- view/Requirements.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/view/Requirements.php b/view/Requirements.php index 34f7fc066..9bd514dfc 100644 --- a/view/Requirements.php +++ b/view/Requirements.php @@ -1128,18 +1128,21 @@ 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) { - $this->css($module.$css, $media); + + 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); } }