diff --git a/CHANGES.md b/CHANGES.md index 2925deef074b2b9ec2e3080668425af38aced292..648e6007d7e4c64f65fc1ac4bb43e9bd145322af 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/lang/en/theme_boost_campus.php b/lang/en/theme_boost_campus.php index a58bd1fdd9c1ab0c9a4ee2a167f6976725645c99..524146142dd2fa217dc81f94e7fab4f5df2af2b4 100644 --- a/lang/en/theme_boost_campus.php +++ b/lang/en/theme_boost_campus.php @@ -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'; diff --git a/layout/columns2.php b/layout/columns2.php index 86aa04affc467d481526276512287b574557b6d4..b3e5322f8954ed46fad592e848a8ec825710302b 100644 --- a/layout/columns2.php +++ b/layout/columns2.php @@ -125,7 +125,9 @@ if ($perpibenable) { // Add the variables to the templatecontext array. $templatecontext['perpibcontent'] = $perpibcontent; - $templatecontext['perpibcss'] = $perpibcss; + 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; - $templatecontext['timedibcss'] = $timedibcss; + if ($timedibcss != 'none') { + $templatecontext['timedibcss'] = $timedibcss; + } $templatecontext['timedinfobannershowonselectedpage'] = $timedinfobannershowonselectedpage; } // MODIFICATION END. diff --git a/layout/login.php b/layout/login.php index 2c14fbbb47fb5fb189b8d328e62b3917d6a4ea83..672c992ecb28661fa495df5b173d1adf8fe34ab8 100644 --- a/layout/login.php +++ b/layout/login.php @@ -59,7 +59,9 @@ if ($perpibenable) { // Add the variables to the templatecontext array. $templatecontext['perpibcontent'] = $perpibcontent; - $templatecontext['perpibcss'] = $perpibcss; + 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')); - $timedibcss = get_config('theme_boost_campus', 'timedibcss'); + 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. diff --git a/settings.php b/settings.php index c41f1a22cc6ea83d2c4c780d7a9f6b7656e07ace..2f76d16b0c1f1745322385152da1d6ddee2f59b2 100644 --- a/settings.php +++ b/settings.php @@ -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); diff --git a/templates/columns2.mustache b/templates/columns2.mustache index cbbff71446325c78ef614ab24c14a2328f63dda9..03372367b2b45d25b7984103182e0267b8ef9ff9 100644 --- a/templates/columns2.mustache +++ b/templates/columns2.mustache @@ -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}}">