Skip to content
Snippets Groups Projects
Commit 2e6bd441 authored by Kathrin Osswald's avatar Kathrin Osswald
Browse files

Added newly introduced Boost core setting to upload a background image.

parent 5d204672
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ Changes
### Unreleased
* 2018-02-08 - Added newly introduced Boost core setting to upload a background image.
* 2018-02-08 - Removed design improvements for calendar block popups as this is fixed in core.
* 2018-02-08 - Setting to be able to hide the link to reset the user tour in the footer.
* 2018-02-08 - Improved activity navigation design.
......
......@@ -52,6 +52,11 @@ This setting is already available in the Moodle core theme Boost. For more infor
This setting is already available in the Moodle core theme Boost. For more information how to use it, please have a look at the official Moodle documentation: http://docs.moodle.org/en/Boost_theme
#### Background image
This setting is already available in the Moodle core theme Boost. For more information how to use it, please have a look at the official Moodle documentation: http://docs.moodle.org/en/Boost_theme
Please note: This will not override the setting "theme_boost_campus | loginbackgroundimage" which means that the pictures uploaded to the login page background will be displayed anyway.
#### Brand colors
##### Brand color
......
......@@ -33,6 +33,8 @@ $string['configtitle'] = 'Boost Campus settings';
// General settings.
$string['presetheadingsetting'] = 'Theme presets';
// ...Background image.
$string['backgroundimage_desc_note'] = '<br/> Please note: This will not override the setting "theme_boost_campus | loginbackgroundimage" which means that the pictures uploaded to the login page background will be displayed anyway.';
// ...Brand colors.
$string['brandcolorheadingsetting'] = 'Brand colors';
$string['brandsuccesscolorsetting'] = 'Brand success color';
......
......@@ -140,8 +140,15 @@ function theme_boost_campus_get_pre_scss($theme) {
function theme_boost_campus_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) {
if ($context->contextlevel == CONTEXT_SYSTEM) {
$theme = theme_config::load('boost_campus');
// By default, theme files must be cache-able by both browsers and proxies.
// TODO: For new file areas: Check if the cacheability needs to be restricted.
if (!array_key_exists('cacheability', $options)) {
$options['cacheability'] = 'public';
}
if ($filearea === 'favicon') {
return $theme->setting_file_serve('favicon', $args, $forcedownload, $options);
} else if (s($filearea === 'logo' || $filearea === 'backgroundimage')) {
return $theme->setting_file_serve($filearea, $args, $forcedownload, $options);
} else if ($filearea === 'loginbackgroundimage') {
return $theme->setting_file_serve('loginbackgroundimage', $args, $forcedownload, $options);
} else if ($filearea === 'fontfiles') {
......
......@@ -74,6 +74,21 @@ if ($ADMIN->fulltree) {
array('maxfiles' => 20, 'accepted_types' => array('.scss')));
$page->add($setting);
// Settings title to group core background image related settings together with a common heading. We don't want a description here.
$name = 'theme_boost_campus/backgroundimageheading';
$title = get_string('backgroundimage', 'theme_boost', null, true);
$setting = new admin_setting_heading($name, $title, null);
$page->add($setting);
// Background image setting.
$name = 'theme_boost_campus/backgroundimage';
$title = get_string('backgroundimage', 'theme_boost', null, true);
$description = get_string('backgroundimage_desc', 'theme_boost', null, true);
$description .= get_string('backgroundimage_desc_note', 'theme_boost_campus', null, true);
$setting = new admin_setting_configstoredfile($name, $title, $description, 'backgroundimage');
$setting->set_updatedcallback('theme_reset_all_caches');
$page->add($setting);
// Settings title to group brand color related settings together with a common heading. We don't want a description here.
$name = 'theme_boost_campus/brandcolorheading';
$title = get_string('brandcolorheadingsetting', 'theme_boost_campus', null, true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment