Skip to content

Commit

Permalink
Upgrade: Update Bootstrap classes for Moodle 4.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
abias committed Aug 22, 2024
1 parent 18050e2 commit 6b5f575
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Changes

### Unreleased

* 2024-08-20 - Upgrade: Update Bootstrap classes for Moodle 4.4.
* 2024-08-20 - Prepare compatibility for Moodle 4.4.

### v4.3-r2
Expand Down
28 changes: 16 additions & 12 deletions settings_pagelist.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,20 @@
$statusbadgevariant = strtr(
$pageurlstandardavailable,
[
STATICPAGE_CHECKAVAILABILITY_RESPONSE_SUCCESS => 'badge-success',
STATICPAGE_CHECKAVAILABILITY_RESPONSE_FAIL => 'badge-danger',
STATICPAGE_CHECKAVAILABILITY_RESPONSE_ERROR => 'badge-danger',
STATICPAGE_CHECKAVAILABILITY_RESPONSE_DISABLED => 'badge-info',
STATICPAGE_CHECKAVAILABILITY_RESPONSE_SUCCESS => 'bg-success text-light',
STATICPAGE_CHECKAVAILABILITY_RESPONSE_FAIL => 'bg-danger text-light',
STATICPAGE_CHECKAVAILABILITY_RESPONSE_ERROR => 'bg-danger text-light',
STATICPAGE_CHECKAVAILABILITY_RESPONSE_DISABLED => 'bg-info text-dark',
]
);
$html .= html_writer::tag('p',
get_string('settingspagelistentrystandard'.$pageurlstandardavailable, 'local_staticpage',
html_writer::link($pageurlstandard,
html_writer::tag('span',
get_string('checkavailabilityresponse'.$pageurlstandardavailable, 'local_staticpage'),
['class' => 'badge '.$statusbadgevariant]).' '.$pageurlstandard)));
['class' => 'badge mr-2 '.$statusbadgevariant]).
html_writer::link($pageurlstandard, $pageurlstandard)
)
);
}

// Print rewritten static page URL.
Expand All @@ -134,18 +136,20 @@
$statusbadgevariant = strtr(
$pageurlrewriteavailable,
[
STATICPAGE_CHECKAVAILABILITY_RESPONSE_SUCCESS => 'badge-success',
STATICPAGE_CHECKAVAILABILITY_RESPONSE_FAIL => 'badge-warning',
STATICPAGE_CHECKAVAILABILITY_RESPONSE_ERROR => 'badge-warning',
STATICPAGE_CHECKAVAILABILITY_RESPONSE_DISABLED => 'badge-info',
STATICPAGE_CHECKAVAILABILITY_RESPONSE_SUCCESS => 'bg-success text-light',
STATICPAGE_CHECKAVAILABILITY_RESPONSE_FAIL => 'bg-warning text-dark',
STATICPAGE_CHECKAVAILABILITY_RESPONSE_ERROR => 'bg-warning text-dark',
STATICPAGE_CHECKAVAILABILITY_RESPONSE_DISABLED => 'bg-info text-dark',
]
);
$html .= html_writer::tag('p',
get_string('settingspagelistentryrewrite'.$pageurlrewriteavailable, 'local_staticpage',
html_writer::link($pageurlrewrite,
html_writer::tag('span',
get_string('checkavailabilityresponse'.$pageurlrewriteavailable, 'local_staticpage'),
['class' => 'badge '.$statusbadgevariant]).' '.$pageurlrewrite)));
['class' => 'badge mr-2 '.$statusbadgevariant]).
html_writer::link($pageurlrewrite, $pageurlrewrite)
)
);

// Finish page list entry.
$html .= html_writer::end_tag('li');
Expand Down

0 comments on commit 6b5f575

Please sign in to comment.