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

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

parent 7c3f5863
Branches
Tags
No related merge requests found
......@@ -6,6 +6,7 @@ Changes
### 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.
### Release v3.10-r1
......
......@@ -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/>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).
$string['backtotop'] = 'Back to top';
$string['bootstrapprimarycolor'] = 'Primary color';
......@@ -295,6 +298,7 @@ $string['bootstrapwarningcolor'] = 'Warning color';
$string['bootstrapinfocolor'] = 'Info color';
$string['bootstraplightcolor'] = 'Light color';
$string['bootstrapdarkcolor'] = 'Dark color';
$string['bootstrapnone'] = 'No Bootstrap color';
$string['cachedef_imagearea'] = 'Cache for imagearea items';
$string['close'] = 'Close';
$string['confirmation'] = 'Confirmation';
......
......@@ -125,7 +125,9 @@ if ($perpibenable) {
// Add the variables to the templatecontext array.
$templatecontext['perpibcontent'] = $perpibcontent;
if ($perpibcss != 'none') {
$templatecontext['perpibcss'] = $perpibcss;
}
$templatecontext['perpibdismiss'] = $perpibdismiss;
$templatecontext['perpinfobannershowonselectedpage'] = $perpinfobannershowonselectedpage;
$templatecontext['perbibconfirmdialogue'] = $perbibconfirmdialogue;
......@@ -151,7 +153,9 @@ if ($timedibenable) {
// Add the variables to the templatecontext array.
$templatecontext['timedibcontent'] = $timedibcontent;
if ($timedibcss != 'none') {
$templatecontext['timedibcss'] = $timedibcss;
}
$templatecontext['timedinfobannershowonselectedpage'] = $timedinfobannershowonselectedpage;
}
// MODIFICATION END.
......
......@@ -59,7 +59,9 @@ if ($perpibenable) {
// Add the variables to the templatecontext array.
$templatecontext['perpibcontent'] = $perpibcontent;
if ($perpibcss != 'none') {
$templatecontext['perpibcss'] = $perpibcss;
}
$templatecontext['perpinfobannershowonselectedpage'] = $perpinfobannershowonselectedpage;
}
// MODIFICATION END.
......@@ -72,7 +74,9 @@ if ($timedibenable) {
$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.
$timedibshowonpages = explode(",", get_config('theme_boost_campus', 'timedibshowonpages'));
if ($perpibcss != 'none') {
$timedibcss = get_config('theme_boost_campus', 'timedibcss');
}
$timedibstartsetting = get_config('theme_boost_campus', 'timedibstart');
$timedibendsetting = get_config('theme_boost_campus', 'timedibend');
// Get the current server time.
......
......@@ -730,7 +730,9 @@ if ($ADMIN->fulltree) {
// Select the bootstrap class that should be used for the perpetual info banner.
$name = 'theme_boost_campus/perpibcss';
$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 = [
// Don't use string lazy loading (= false) because the string will be directly used and would produce a
// PHP warning otherwise.
......@@ -741,7 +743,8 @@ if ($ADMIN->fulltree) {
'warning' => get_string('bootstrapwarningcolor', 'theme_boost_campus', null, false),
'info' => get_string('bootstrapinfocolor', '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'],
$perpibcssoptions);
......@@ -824,7 +827,9 @@ if ($ADMIN->fulltree) {
// Select the bootstrap class that should be used for the perpetual info banner.
$name = 'theme_boost_campus/timedibcss';
$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 = [
// Don't use string lazy loading (= false) because the string will be directly used and would produce a
// PHP warning otherwise.
......@@ -835,7 +840,8 @@ if ($ADMIN->fulltree) {
'warning' => get_string('bootstrapwarningcolor', 'theme_boost_campus', null, false),
'info' => get_string('bootstrapinfocolor', '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'],
$timedibcssoptions);
......
......@@ -94,13 +94,13 @@
<div id="page" class="container-fluid d-print-block">
{{#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 }}}
</div>
{{/timedinfobannershowonselectedpage}}
{{#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 }}}
{{#perpibdismiss}}
<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