Skip to content

Commit

Permalink
Adopt Boost Union class name changes from Boost Union 4.5, raise the …
Browse files Browse the repository at this point in the history
…dependency to Boost Union 4.5 likewise.
  • Loading branch information
abias committed Oct 22, 2024
1 parent f72fd38 commit ac9e980
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changes

### Rolling release

* 2024-10-22 - Adopt Boost Union class name changes from Boost Union 4.5, raise the dependency to Boost Union 4.5 likewise.
* 2024-10-22 - Change Moodle-Plugin-CI to run on Moodle Core 4.5
* 2024-08-11 - Updated Moodle Plugin CI to latest upstream recommendations
* 2024-07-25 - Development: Rename master branch to main, please update your clones.
Expand Down
14 changes: 7 additions & 7 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/**
* Returns the main SCSS content.
*
* @param theme_config $theme The theme config object.
* @param \core\output\theme_config $theme The theme config object.
* @return string
*/
function theme_boost_union_child_get_main_scss_content($theme) {
Expand All @@ -40,7 +40,7 @@ function theme_boost_union_child_get_main_scss_content($theme) {

// As a start, get the compiled main SCSS from Boost Union.
// This way, Boost Union Child will ship the same SCSS code as Boost Union itself.
$scss = theme_boost_union_get_main_scss_content(theme_config::load('boost_union'));
$scss = theme_boost_union_get_main_scss_content(\core\output\theme_config::load('boost_union'));

// And add Boost Union Child's main SCSS file to the stack.
$scss .= file_get_contents($CFG->dirroot . '/theme/boost_union_child/scss/post.scss');
Expand All @@ -51,7 +51,7 @@ function theme_boost_union_child_get_main_scss_content($theme) {
/**
* Get SCSS to prepend.
*
* @param theme_config $theme The theme config object.
* @param \core\output\theme_config $theme The theme config object.
* @return string
*/
function theme_boost_union_child_get_pre_scss($theme) {
Expand All @@ -71,7 +71,7 @@ function theme_boost_union_child_get_pre_scss($theme) {
// This way, we will add the pre SCSS code with the explicit use of the Boost Union configuration to the stack.
$inheritanceconfig = get_config('theme_boost_union_child', 'prescssinheritance');
if ($inheritanceconfig == THEME_BOOST_UNION_CHILD_SETTING_INHERITANCE_DUPLICATE) {
$scss .= theme_boost_union_get_pre_scss(theme_config::load('boost_union'));
$scss .= theme_boost_union_get_pre_scss(\core\output\theme_config::load('boost_union'));
}

// And add Boost Union Child's pre SCSS file to the stack.
Expand All @@ -89,7 +89,7 @@ function theme_boost_union_child_get_pre_scss($theme) {
/**
* Inject additional SCSS.
*
* @param theme_config $theme The theme config object.
* @param \core\output\theme_config $theme The theme config object.
* @return string
*/
function theme_boost_union_child_get_extra_scss($theme) {
Expand All @@ -109,7 +109,7 @@ function theme_boost_union_child_get_extra_scss($theme) {
// This way, we will add the extra SCSS code with the explicit use of the Boost Union configuration to the stack.
$inheritanceconfig = get_config('theme_boost_union_child', 'extrascssinheritance');
if ($inheritanceconfig == THEME_BOOST_UNION_CHILD_SETTING_INHERITANCE_DUPLICATE) {
$scss .= theme_boost_union_get_extra_scss(theme_config::load('boost_union'));
$scss .= theme_boost_union_get_extra_scss(\core\output\theme_config::load('boost_union'));
}

/**********************************************************
Expand All @@ -133,7 +133,7 @@ function theme_boost_union_child_extend_busettingsoverview() {
'label' => get_string('pluginname', 'theme_boost_union_child'),
'desc' => get_string('settingsoverview_buc_desc', 'theme_boost_union_child'),
'btn' => 'primary',
'url' => new \moodle_url('/admin/settings.php', ['section' => 'theme_boost_union_child']),
'url' => new \core\url('/admin/settings.php', ['section' => 'theme_boost_union_child']),
];

return $cards;
Expand Down
4 changes: 2 additions & 2 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
// settings and which is automatically linked from the theme selector page.
// To avoid that there appears a broken "Boost Union Child" settings page, we redirect the user to a settings
// overview page if he opens this page.
$mainsettingspageurl = new moodle_url('/admin/settings.php', ['section' => 'themesettingboost_union_child']);
$mainsettingspageurl = new \core\url('/admin/settings.php', ['section' => 'themesettingboost_union_child']);
if ($ADMIN->fulltree && $PAGE->has_set_url() && $PAGE->url->compare($mainsettingspageurl)) {
redirect(new moodle_url('/admin/settings.php', ['section' => 'theme_boost_union_child']));
redirect(new \core\url('/admin/settings.php', ['section' => 'theme_boost_union_child']));
}

// Create empty settings page structure to make the site administration work on non-admin pages.
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
$plugin->component = 'theme_boost_union_child';
$plugin->version = 2024010100;
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = ['theme_boost_union' => 2023010548];
$plugin->dependencies = ['theme_boost_union' => 2024100700];

0 comments on commit ac9e980

Please sign in to comment.