Open danowar2k opened 2 days ago
Proposed solution:
function theme_boost_union_get_extra_scss($theme) {
global $CFG;
// Require the necessary libraries.
require_once($CFG->dirroot . '/course/lib.php');
// Initialize extra SCSS.
$content = '';
// Fetch Boost's extra SCSS if the current theme is not Union itself (can only be a child theme then)
if ($theme->name !== 'boost_union') {
$union_config = theme_config::load('boost_union');
$content .= theme_boost_get_extra_scss($union_config);
}
// You might think that this extra SCSS function is only called for the activated theme.
Hmmm, maybe this issue will be resolved by my proposed change, too? https://github.com/moodle-an-hochschulen/moodle-theme_boost_union_child/issues/5
Is your feature request related to a problem? Please describe. In our child theme we currently need to do this:
Basically, Moodle runs each theme's extra SCSS function in the ancestry with the $theme object of the current theme. When your theme doesn't replicate Boost's settings backgroundimage, loginbackgroundimage and scss, that extra SCSS generated by Boost's function is incomplete. Boost Union replicates those settings, so we run Boost's extra SCSS function again with Union's config to get the correct SCSS. But then we have to run Union's extra SCSS function again to have a correct order for the SCSS rules.
Describe the solution you'd like Union could already run Boost's extra SCSS function at the start of its own extra SCSS function with the Union config as the parameter to generate the correct SCSS. This way we wouldn't even need our own extra SCSS function anymore.
Of course, this should only be necessary if Union isn't the current theme.
Describe alternatives you've considered Reproducing the settings still doesn't make sense to me...