From 39be9ad5bfdd477eda1b1831424fc4ed97ee057a Mon Sep 17 00:00:00 2001 From: Alexander Bias Date: Sat, 24 Aug 2024 09:33:29 +0200 Subject: [PATCH] Upgrade: Update Bootstrap classes for Moodle 4.4. --- CHANGES.md | 1 + classes/table/flavours_overview.php | 4 ++-- classes/table/smartmenus_items.php | 10 +++++----- classes/table/smartmenus_menus.php | 4 ++-- templates/localloginform.mustache | 6 +++--- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6a16f98184d..5a1f56a06df 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes ### Unreleased +* 2024-08-24 - Upgrade: Update Bootstrap classes for Moodle 4.4. * 2024-08-11 - Updated Moodle Plugin CI to latest upstream recommendations * 2024-07-24 - Test: Fix broken Behat scenario 'Suppress 'Chat to course participants' link', resolves #696 * 2024-07-23 - Bugfix: Fix unparsable example JSON in Mustache template diff --git a/classes/table/flavours_overview.php b/classes/table/flavours_overview.php index cd7367dfe9f..8c1e701fb97 100644 --- a/classes/table/flavours_overview.php +++ b/classes/table/flavours_overview.php @@ -152,14 +152,14 @@ public function col_appliesto($data) { if ($data->applytocategories == true) { $badges[] = \html_writer::tag('span', get_string('categories'), - ['class' => 'badge badge-primary']); + ['class' => 'badge bg-primary text-light']); } // If apply-to-cohorts is enabled, add a badge. if ($data->applytocohorts == true) { $badges[] = \html_writer::tag('span', get_string('cohorts', 'cohort'), - ['class' => 'badge badge-primary']); + ['class' => 'badge bg-primary text-light']); } // Implode and return the badges. diff --git a/classes/table/smartmenus_items.php b/classes/table/smartmenus_items.php index e862f95041a..d538431b94d 100644 --- a/classes/table/smartmenus_items.php +++ b/classes/table/smartmenus_items.php @@ -116,7 +116,7 @@ public function col_type($data) { $type = \theme_boost_union\smartmenu_item::get_types($data->type); // Return the type as badge. - return \html_writer::tag('span', $type, ['class' => 'badge badge-primary']); + return \html_writer::tag('span', $type, ['class' => 'badge bg-primary text-light']); } /** @@ -138,7 +138,7 @@ public function col_restrictions($data) { $rolelist = $DB->get_records_list('role', 'id', $roles); $rolenames = role_fix_names($rolelist); array_walk($rolenames, function(&$value) { - $value = \html_writer::tag('span', $value->localname, ['class' => 'badge badge-primary']); + $value = \html_writer::tag('span', $value->localname, ['class' => 'badge bg-primary text-light']); }); // Amend rule list. @@ -154,7 +154,7 @@ public function col_restrictions($data) { $cohorts = json_decode($data->cohorts); $cohortlist = $DB->get_records_list('cohort', 'id', $cohorts); array_walk($cohortlist, function(&$value) { - $value = \html_writer::tag('span', $value->name, ['class' => 'badge badge-primary']); + $value = \html_writer::tag('span', $value->name, ['class' => 'badge bg-primary text-light']); }); // Amend rule list. @@ -172,7 +172,7 @@ public function col_restrictions($data) { $languagelist = []; foreach ($languages as $lang) { if (isset($options[$lang])) { - $languagelist[] = \html_writer::tag('span', $options[$lang], ['class' => 'badge badge-primary']); + $languagelist[] = \html_writer::tag('span', $options[$lang], ['class' => 'badge bg-primary text-light']); } } @@ -198,7 +198,7 @@ public function col_restrictions($data) { } array_walk($datelist, function(&$value) { - $value = \html_writer::tag('span', $value, ['class' => 'badge badge-primary']); + $value = \html_writer::tag('span', $value, ['class' => 'badge bg-primary text-light']); }); // Amend rule list. diff --git a/classes/table/smartmenus_menus.php b/classes/table/smartmenus_menus.php index d804952ec73..c6ad38e923e 100644 --- a/classes/table/smartmenus_menus.php +++ b/classes/table/smartmenus_menus.php @@ -122,7 +122,7 @@ public function col_location($data) { // Implode all given locations and show a badge for each of them. return (!empty($locations)) ? implode(' ', array_map(function($value) { $location = \theme_boost_union\smartmenu::get_location($value); - return \html_writer::tag('span', $location, ['class' => 'badge badge-primary']); + return \html_writer::tag('span', $location, ['class' => 'badge bg-primary text-light']); }, $locations)) : ""; } @@ -137,7 +137,7 @@ public function col_type($data) { $type = \theme_boost_union\smartmenu::get_type($data->type); // Return the type as badge. - return \html_writer::tag('span', $type, ['class' => 'badge badge-primary']); + return \html_writer::tag('span', $type, ['class' => 'badge bg-primary text-light']); } /** diff --git a/templates/localloginform.mustache b/templates/localloginform.mustache index 9adc75702d7..c1385f33f72 100644 --- a/templates/localloginform.mustache +++ b/templates/localloginform.mustache @@ -35,15 +35,15 @@

{{#str}}loginlocalloginformhead, theme_boost_union{{/str}}

-