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

Implemented get_extra_scss function.

parent 14ef25fa
Branches
Tags
No related merge requests found
......@@ -3,6 +3,9 @@ moodle-theme_boost_campus
Changes
-------
### Unreleased
* 2018-02-21 - Implemented get_extra_scss function.
### Release v3.4-r1
......
......@@ -145,6 +145,7 @@ $THEME->layouts = [
];
$THEME->enable_dock = false;
$THEME->extrascsscallback = 'theme_boost_campus_get_extra_scss';
$THEME->prescsscallback = 'theme_boost_campus_get_pre_scss';
$THEME->yuicssmodules = array();
$THEME->rendererfactory = 'theme_overridden_renderer_factory';
......
......@@ -127,6 +127,29 @@ function theme_boost_campus_get_pre_scss($theme) {
return $scss;
}
/**
* Inject additional SCSS.
* We implemented this function as a duplicate of theme_boost, because we need this
* for the child theme boost_campus_child.
*
* @param theme_config $theme The theme config object.
* @return string
*/
function theme_boost_campus_get_extra_scss($theme) {
$content = '';
$imageurl = $theme->setting_file_url('backgroundimage', 'backgroundimage');
// Sets the background image, and its settings.
if (!empty($imageurl)) {
$content .= 'body { ';
$content .= "background-image: url('$imageurl');";
$content .= ' }';
}
// Always return the background image with the scss when we have it.
return !empty($theme->settings->scss) ? $theme->settings->scss . ' ' . $content : $content;
}
/**
* Implement pluginfile function to deliver files which are uploaded in theme settings
*
......
......@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = 'theme_boost_campus';
$plugin->version = 2018021900;
$plugin->version = 2018022100;
$plugin->release = 'v3.4-r1';
$plugin->requires = 2017111300;
$plugin->maturity = MATURITY_STABLE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment