Skip to content
Snippets Groups Projects
Commit 61638e25 authored by Alexander Bias's avatar Alexander Bias
Browse files

Improvement: Add option to output the information banner without any particular Bootstrap color.

parent efc16fbe
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ Changes ...@@ -7,6 +7,7 @@ Changes
### Unreleased ### Unreleased
* 2021-01-14 - Improvement: Add option to output the information banner without any particular Bootstrap color.
* 2021-01-14 - Bugfix: The infobanner should not clean the entered HTML code too strictly. * 2021-01-14 - Bugfix: The infobanner should not clean the entered HTML code too strictly.
### Release v3.9-r4 ### Release v3.9-r4
......
...@@ -285,6 +285,9 @@ $string['timedibendsetting_desc'] = 'With this setting you can define when the t ...@@ -285,6 +285,9 @@ $string['timedibendsetting_desc'] = 'With this setting you can define when the t
<br/>Please enter a valid date in this format: YYYY-MM-DD HH:MM:SS. For example: "2020-01-07 08:00:00. The time zone will be the time zone you have defined in the setting "Default timezone". <br/>Please enter a valid date in this format: YYYY-MM-DD HH:MM:SS. For example: "2020-01-07 08:00:00. The time zone will be the time zone you have defined in the setting "Default timezone".
<br/>If you leave this setting empty but entered a date in the for the start, the banner won\'t hide after the starting time has been reached.'; <br/>If you leave this setting empty but entered a date in the for the start, the banner won\'t hide after the starting time has been reached.';
// ...General information banner.
$string['ibcsssetting_nobootstrap'] = 'If you choose the \'{$a->bootstrapnone}\' option, the information banner will be output without any particular Bootstrap color.';
// ADDITIONAL STRINGS (IN ALPHABETICAL ORDER). // ADDITIONAL STRINGS (IN ALPHABETICAL ORDER).
$string['backtotop'] = 'Back to top'; $string['backtotop'] = 'Back to top';
$string['bootstrapprimarycolor'] = 'Primary color'; $string['bootstrapprimarycolor'] = 'Primary color';
...@@ -295,6 +298,7 @@ $string['bootstrapwarningcolor'] = 'Warning color'; ...@@ -295,6 +298,7 @@ $string['bootstrapwarningcolor'] = 'Warning color';
$string['bootstrapinfocolor'] = 'Info color'; $string['bootstrapinfocolor'] = 'Info color';
$string['bootstraplightcolor'] = 'Light color'; $string['bootstraplightcolor'] = 'Light color';
$string['bootstrapdarkcolor'] = 'Dark color'; $string['bootstrapdarkcolor'] = 'Dark color';
$string['bootstrapnone'] = 'No Bootstrap color';
$string['cachedef_imagearea'] = 'Cache for imagearea items'; $string['cachedef_imagearea'] = 'Cache for imagearea items';
$string['close'] = 'Close'; $string['close'] = 'Close';
$string['confirmation'] = 'Confirmation'; $string['confirmation'] = 'Confirmation';
......
...@@ -125,7 +125,9 @@ if ($perpibenable) { ...@@ -125,7 +125,9 @@ if ($perpibenable) {
// Add the variables to the templatecontext array. // Add the variables to the templatecontext array.
$templatecontext['perpibcontent'] = $perpibcontent; $templatecontext['perpibcontent'] = $perpibcontent;
if ($perpibcss != 'none') {
$templatecontext['perpibcss'] = $perpibcss; $templatecontext['perpibcss'] = $perpibcss;
}
$templatecontext['perpibdismiss'] = $perpibdismiss; $templatecontext['perpibdismiss'] = $perpibdismiss;
$templatecontext['perpinfobannershowonselectedpage'] = $perpinfobannershowonselectedpage; $templatecontext['perpinfobannershowonselectedpage'] = $perpinfobannershowonselectedpage;
$templatecontext['perbibconfirmdialogue'] = $perbibconfirmdialogue; $templatecontext['perbibconfirmdialogue'] = $perbibconfirmdialogue;
...@@ -151,7 +153,9 @@ if ($timedibenable) { ...@@ -151,7 +153,9 @@ if ($timedibenable) {
// Add the variables to the templatecontext array. // Add the variables to the templatecontext array.
$templatecontext['timedibcontent'] = $timedibcontent; $templatecontext['timedibcontent'] = $timedibcontent;
if ($timedibcss != 'none') {
$templatecontext['timedibcss'] = $timedibcss; $templatecontext['timedibcss'] = $timedibcss;
}
$templatecontext['timedinfobannershowonselectedpage'] = $timedinfobannershowonselectedpage; $templatecontext['timedinfobannershowonselectedpage'] = $timedinfobannershowonselectedpage;
} }
// MODIFICATION END. // MODIFICATION END.
......
...@@ -59,7 +59,9 @@ if ($perpibenable) { ...@@ -59,7 +59,9 @@ if ($perpibenable) {
// Add the variables to the templatecontext array. // Add the variables to the templatecontext array.
$templatecontext['perpibcontent'] = $perpibcontent; $templatecontext['perpibcontent'] = $perpibcontent;
if ($perpibcss != 'none') {
$templatecontext['perpibcss'] = $perpibcss; $templatecontext['perpibcss'] = $perpibcss;
}
$templatecontext['perpinfobannershowonselectedpage'] = $perpinfobannershowonselectedpage; $templatecontext['perpinfobannershowonselectedpage'] = $perpinfobannershowonselectedpage;
} }
// MODIFICATION END. // MODIFICATION END.
...@@ -72,7 +74,9 @@ if ($timedibenable) { ...@@ -72,7 +74,9 @@ if ($timedibenable) {
$timedibcontent = format_text(get_config('theme_boost_campus', 'timedibcontent'), FORMAT_HTML, $formatoptions); $timedibcontent = format_text(get_config('theme_boost_campus', 'timedibcontent'), FORMAT_HTML, $formatoptions);
// Result of multiselect is a string divided by a comma, so exploding into an array. // Result of multiselect is a string divided by a comma, so exploding into an array.
$timedibshowonpages = explode(",", get_config('theme_boost_campus', 'timedibshowonpages')); $timedibshowonpages = explode(",", get_config('theme_boost_campus', 'timedibshowonpages'));
if ($perpibcss != 'none') {
$timedibcss = get_config('theme_boost_campus', 'timedibcss'); $timedibcss = get_config('theme_boost_campus', 'timedibcss');
}
$timedibstartsetting = get_config('theme_boost_campus', 'timedibstart'); $timedibstartsetting = get_config('theme_boost_campus', 'timedibstart');
$timedibendsetting = get_config('theme_boost_campus', 'timedibend'); $timedibendsetting = get_config('theme_boost_campus', 'timedibend');
// Get the current server time. // Get the current server time.
......
...@@ -730,7 +730,9 @@ if ($ADMIN->fulltree) { ...@@ -730,7 +730,9 @@ if ($ADMIN->fulltree) {
// Select the bootstrap class that should be used for the perpetual info banner. // Select the bootstrap class that should be used for the perpetual info banner.
$name = 'theme_boost_campus/perpibcss'; $name = 'theme_boost_campus/perpibcss';
$title = get_string('perpibcsssetting', 'theme_boost_campus', null, true); $title = get_string('perpibcsssetting', 'theme_boost_campus', null, true);
$description = get_string('perpibcsssetting_desc', 'theme_boost_campus', null, true); $description = get_string('perpibcsssetting_desc', 'theme_boost_campus', null, true).'<br />'.
get_string('ibcsssetting_nobootstrap', 'theme_boost_campus',
array('bootstrapnone' => get_string('bootstrapnone', 'theme_boost_campus')));
$perpibcssoptions = [ $perpibcssoptions = [
// Don't use string lazy loading (= false) because the string will be directly used and would produce a // Don't use string lazy loading (= false) because the string will be directly used and would produce a
// PHP warning otherwise. // PHP warning otherwise.
...@@ -741,7 +743,8 @@ if ($ADMIN->fulltree) { ...@@ -741,7 +743,8 @@ if ($ADMIN->fulltree) {
'warning' => get_string('bootstrapwarningcolor', 'theme_boost_campus', null, false), 'warning' => get_string('bootstrapwarningcolor', 'theme_boost_campus', null, false),
'info' => get_string('bootstrapinfocolor', 'theme_boost_campus', null, false), 'info' => get_string('bootstrapinfocolor', 'theme_boost_campus', null, false),
'light' => get_string('bootstraplightcolor', 'theme_boost_campus', null, false), 'light' => get_string('bootstraplightcolor', 'theme_boost_campus', null, false),
'dark' => get_string('bootstrapdarkcolor', 'theme_boost_campus', null, false) 'dark' => get_string('bootstrapdarkcolor', 'theme_boost_campus', null, false),
'none' => get_string('bootstrapnone', 'theme_boost_campus', null, false)
]; ];
$setting = new admin_setting_configselect($name, $title, $description, $perpibcssoptions['primary'], $setting = new admin_setting_configselect($name, $title, $description, $perpibcssoptions['primary'],
$perpibcssoptions); $perpibcssoptions);
...@@ -824,7 +827,9 @@ if ($ADMIN->fulltree) { ...@@ -824,7 +827,9 @@ if ($ADMIN->fulltree) {
// Select the bootstrap class that should be used for the perpetual info banner. // Select the bootstrap class that should be used for the perpetual info banner.
$name = 'theme_boost_campus/timedibcss'; $name = 'theme_boost_campus/timedibcss';
$title = get_string('timedibcsssetting', 'theme_boost_campus', null, true); $title = get_string('timedibcsssetting', 'theme_boost_campus', null, true);
$description = get_string('timedibcsssetting_desc', 'theme_boost_campus', null, true); $description = get_string('timedibcsssetting_desc', 'theme_boost_campus', null, true).'<br />'.
get_string('ibcsssetting_nobootstrap', 'theme_boost_campus',
array('bootstrapnone' => get_string('bootstrapnone', 'theme_boost_campus')));
$timedibcssoptions = [ $timedibcssoptions = [
// Don't use string lazy loading (= false) because the string will be directly used and would produce a // Don't use string lazy loading (= false) because the string will be directly used and would produce a
// PHP warning otherwise. // PHP warning otherwise.
...@@ -835,7 +840,8 @@ if ($ADMIN->fulltree) { ...@@ -835,7 +840,8 @@ if ($ADMIN->fulltree) {
'warning' => get_string('bootstrapwarningcolor', 'theme_boost_campus', null, false), 'warning' => get_string('bootstrapwarningcolor', 'theme_boost_campus', null, false),
'info' => get_string('bootstrapinfocolor', 'theme_boost_campus', null, false), 'info' => get_string('bootstrapinfocolor', 'theme_boost_campus', null, false),
'light' => get_string('bootstraplightcolor', 'theme_boost_campus', null, false), 'light' => get_string('bootstraplightcolor', 'theme_boost_campus', null, false),
'dark' => get_string('bootstrapdarkcolor', 'theme_boost_campus', null, false) 'dark' => get_string('bootstrapdarkcolor', 'theme_boost_campus', null, false),
'none' => get_string('bootstrapnone', 'theme_boost_campus', null, false)
]; ];
$setting = new admin_setting_configselect($name, $title, $description, $timedibcssoptions['primary'], $setting = new admin_setting_configselect($name, $title, $description, $timedibcssoptions['primary'],
$timedibcssoptions); $timedibcssoptions);
......
...@@ -94,13 +94,13 @@ ...@@ -94,13 +94,13 @@
<div id="page" class="container-fluid d-print-block"> <div id="page" class="container-fluid d-print-block">
{{#timedinfobannershowonselectedpage}} {{#timedinfobannershowonselectedpage}}
<div id="themeboostcampusitimedinfobanner" class="alert alert-{{{ timedibcss }}} mt-3" role="alert"> <div id="themeboostcampusitimedinfobanner" class="alert {{#timedibcss}}alert-{{{ timedibcss }}}{{/timedibcss}} mt-3" role="alert">
{{{ timedibcontent }}} {{{ timedibcontent }}}
</div> </div>
{{/timedinfobannershowonselectedpage}} {{/timedinfobannershowonselectedpage}}
{{#perpinfobannershowonselectedpage}} {{#perpinfobannershowonselectedpage}}
<div id="themeboostcampusperpinfobanner" class="alert alert-{{{ perpibcss }}} {{#perpibdismiss}}alert-dismissible fade show{{/perpibdismiss}} mt-3" role="alert"> <div id="themeboostcampusperpinfobanner" class="alert {{#perpibcss}}alert-{{{ perpibcss }}}{{/perpibcss}} {{#perpibdismiss}}alert-dismissible fade show{{/perpibdismiss}} mt-3" role="alert">
{{{ perpibcontent }}} {{{ perpibcontent }}}
{{#perpibdismiss}} {{#perpibdismiss}}
<button type="button" id="themeboostcampusperpinfobannerclosebutton" class="close" data-dismiss="alert" aria-label="{{#str}}close, theme_boost_campus{{/str}}"> <button type="button" id="themeboostcampusperpinfobannerclosebutton" class="close" data-dismiss="alert" aria-label="{{#str}}close, theme_boost_campus{{/str}}">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment