Merge branch 'MDL-41604-master-5' of git://github.com/mouneyrac/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2013-10-11 01:33:21 +02:00
commit 3ed255dc1a

View File

@ -451,11 +451,6 @@ class theme_config {
include_once($renderersfile);
}
$this->parent_configs[$parent] = $parent_config;
$rendererfile = $parent_config->dir.'/renderers.php';
if (is_readable($rendererfile)) {
// may contain core and plugin renderers and renderer factory
include_once($rendererfile);
}
}
$libfile = $this->dir.'/lib.php';
if (is_readable($libfile)) {
@ -1420,9 +1415,10 @@ class theme_config {
*
* @param string $themename
* @param stdClass $settings from config_plugins table
* @param boolean $parentscheck true to also check the parents. .
* @return stdClass The theme configuration
*/
private static function find_theme_config($themename, $settings) {
private static function find_theme_config($themename, $settings, $parentscheck = true) {
// We have to use the variable name $THEME (upper case) because that
// is what is used in theme config.php files.
@ -1442,6 +1438,17 @@ class theme_config {
if (!is_array($THEME->parents)) {
// parents option is mandatory now
return null;
} else {
// We use $parentscheck to only check the direct parents (avoid infinite loop).
if ($parentscheck) {
// Find all parent theme configs.
foreach ($THEME->parents as $parent) {
$parentconfig = theme_config::find_theme_config($parent, $settings, false);
if (empty($parentconfig)) {
return null;
}
}
}
}
return $THEME;