Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#249 - draft: don't force settings duplication, but allow it #250

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ moodle-theme_boost_union
Changes
-------

* 2023-03-17 - Improvement: Do not force child themes to copy theme settings, but allow it.

### v4.1-r4

* 2023-03-06 - Bugfix: Align the search bar with the dark navbar look, solves #234.
Expand Down
17 changes: 17 additions & 0 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1313,3 +1313,20 @@ function theme_boost_union_set_mobilecss_url() {
set_config('mobilecssurl', '');
}
}

/**
* Checks if the current theme (Boost Union or a child theme of it) has the requested setting.
* If it does, returns that setting's value.
* If it doesn't, returns the value of Boost Union's setting.
* @param string $setting - Name of the setting
* @return mixed
*/
function theme_boost_union_get_setting(string $setting) {
global $PAGE;
if ($PAGE->theme->settings->{$setting}) {
$value = $PAGE->theme->settings->{$setting};
} else {
$value = get_config('theme_boost_union', $setting);
}
return $value;
}