From c24458a9f047ba68f0ef8ff4307562df6c4f3611 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 2 Sep 2010 14:11:52 -0700 Subject: Ticket #2638: allow themes to specify a base theme to load with 'include' setting in a theme.ini file --- lib/action.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib/action.php') diff --git a/lib/action.php b/lib/action.php index 2b3b707c5..3614c04e9 100644 --- a/lib/action.php +++ b/lib/action.php @@ -200,7 +200,7 @@ class Action extends HTMLOutputter // lawsuit if (Event::handle('StartShowStatusNetStyles', array($this)) && Event::handle('StartShowLaconicaStyles', array($this))) { - $this->cssLink('css/display.css',null, 'screen, projection, tv, print'); + $this->primaryCssLink(null, 'screen, projection, tv, print'); Event::handle('EndShowStatusNetStyles', array($this)); Event::handle('EndShowLaconicaStyles', array($this)); } @@ -248,6 +248,18 @@ class Action extends HTMLOutputter // lawsuit } } + function primaryCssLink($mainTheme=null, $media=null) + { + // If the currently-selected theme has dependencies on other themes, + // we'll need to load their display.css files as well in order. + $theme = new Theme($mainTheme); + $baseThemes = $theme->getDeps(); + foreach ($baseThemes as $baseTheme) { + $this->cssLink('css/display.css', $baseTheme, $media); + } + $this->cssLink('css/display.css', $mainTheme, $media); + } + /** * Show javascript headers * -- cgit v1.2.3-54-g00ecf