Skip to content

Commit

Permalink
Put the theme CSS at the end of the module CSS so that the theme has
Browse files Browse the repository at this point in the history
the final say.  Fixes ticket #1315.
  • Loading branch information
bharat committed Aug 30, 2010
1 parent 2c717b1 commit ab598b2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/gallery/libraries/Theme_View.php
Expand Up @@ -236,6 +236,13 @@ public function __call($function, $args) {
case "thumb_bottom":
case "thumb_info":
case "thumb_top":
if ($function == "head") {
// Stash any CSS we have already; that came from the theme and we want theme CSS to
// override module CSs
$save_css = $this->css;
$this->css = array();
}

$blocks = array();
if (method_exists("gallery_theme", $function)) {
switch (count($args)) {
Expand Down Expand Up @@ -275,6 +282,8 @@ public function __call($function, $args) {
}

if ($function == "head") {
// Merge the theme CSS/JS at the end
$this->css = array_merge($this->css, $save_css);
array_unshift($blocks, $this->combine_files($this->css, "css"));
array_unshift($blocks, $this->combine_files($this->scripts, "javascript"));
}
Expand Down

0 comments on commit ab598b2

Please sign in to comment.