Merge branch 'MDL-41767-26' of git://github.com/FMCorz/moodle into MOODLE_26_STABLE

This commit is contained in:
Damyon Wiese 2014-02-24 10:41:25 +08:00
commit 41a10883b6

View file

@ -774,22 +774,33 @@ class theme_config {
$plugins = core_component::get_plugin_list($type); $plugins = core_component::get_plugin_list($type);
foreach ($plugins as $plugin=>$fulldir) { foreach ($plugins as $plugin=>$fulldir) {
if (!empty($excludes[$type]) and is_array($excludes[$type]) if (!empty($excludes[$type]) and is_array($excludes[$type])
and in_array($plugin, $excludes[$type])) { and in_array($plugin, $excludes[$type])) {
continue; continue;
} }
$plugincontent = ''; // Add main stylesheet.
$sheetfile = "$fulldir/styles.css"; $sheetfile = "$fulldir/styles.css";
if (is_readable($sheetfile)) { if (is_readable($sheetfile)) {
$cssfiles['plugins'][$type.'_'.$plugin] = $sheetfile; $cssfiles['plugins'][$type.'_'.$plugin] = $sheetfile;
} }
$sheetthemefile = "$fulldir/styles_{$this->name}.css";
if (is_readable($sheetthemefile)) { // Create a list of candidate sheets from parents (direct parent last) and current theme.
$cssfiles['plugins'][$type.'_'.$plugin.'_'.$this->name] = $sheetthemefile; $candidates = array();
foreach (array_reverse($this->parent_configs) as $parent_config) {
$candidates[] = $parent_config->name;
} }
$candidates[] = $this->name;
// Add the sheets found.
foreach ($candidates as $candidate) {
$sheetthemefile = "$fulldir/styles_{$candidate}.css";
if (is_readable($sheetthemefile)) {
$cssfiles['plugins'][$type.'_'.$plugin.'_'.$candidate] = $sheetthemefile;
}
} }
} }
} }
}
// find out wanted parent sheets // find out wanted parent sheets
$excludes = $this->resolve_excludes('parents_exclude_sheets'); $excludes = $this->resolve_excludes('parents_exclude_sheets');