mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 11:46:19 +01:00
MDL-67974 core_badges: Badge expiry date when hover
Text displayed for expired badges when the user hovers over the warning (!) icon has been fixed in the "Issued badge information" page.
This commit is contained in:
parent
a93828a188
commit
5b4204a584
@ -322,7 +322,15 @@ class core_badges_renderer extends plugin_renderer_base {
|
||||
$badgeclass = $ibadge->badgeclass;
|
||||
$badge = new badge($ibadge->badgeid);
|
||||
$now = time();
|
||||
$expiration = isset($issued['expires']) ? $issued['expires'] : $now + 86400;
|
||||
if (isset($issued['expires'])) {
|
||||
if (!is_numeric($issued['expires'])) {
|
||||
$issued['expires'] = strtotime($issued['expires']);
|
||||
}
|
||||
$expiration = $issued['expires'];
|
||||
} else {
|
||||
$expiration = $now + 86400;
|
||||
}
|
||||
|
||||
$badgeimage = is_array($badgeclass['image']) ? $badgeclass['image']['id'] : $badgeclass['image'];
|
||||
$languages = get_string_manager()->get_list_of_languages();
|
||||
|
||||
@ -432,9 +440,6 @@ class core_badges_renderer extends plugin_renderer_base {
|
||||
}
|
||||
$dl[get_string('dateawarded', 'badges')] = userdate($issued['issuedOn']);
|
||||
if (isset($issued['expires'])) {
|
||||
if (!is_numeric($issued['expires'])) {
|
||||
$issued['expires'] = strtotime($issued['expires']);
|
||||
}
|
||||
if ($issued['expires'] < $now) {
|
||||
$dl[get_string('expirydate', 'badges')] = userdate($issued['expires']) . get_string('warnexpired', 'badges');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user