Skip to content

Commit

Permalink
Merge branch 'MDL-67974-310' of git://github.com/sarjona/moodle into …
Browse files Browse the repository at this point in the history
…MOODLE_310_STABLE
  • Loading branch information
stronk7 committed Mar 1, 2021
2 parents ded345c + 07685e8 commit c228509
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
13 changes: 9 additions & 4 deletions badges/renderer.php
Expand Up @@ -322,7 +322,15 @@ protected function render_issued_badge(\core_badges\output\issued_badge $ibadge)
$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();

Expand Down Expand Up @@ -432,9 +440,6 @@ protected function render_issued_badge(\core_badges\output\issued_badge $ibadge)
}
$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');

Expand Down
8 changes: 7 additions & 1 deletion theme/boost/scss/moodle/core.scss
Expand Up @@ -1870,10 +1870,13 @@ ul.badges {
}

.badges li .expireimage {
background-image: url([[pix:i/expired]]);
background-repeat: no-repeat;
background-size: 100px 100px;
width: 100px;
height: 100px;
left: 25px;
top: 0;
top: 15px;
position: absolute;
z-index: 10;
opacity: 0.85;
Expand All @@ -1891,6 +1894,9 @@ ul.badges {
margin-bottom: 20px;

.expireimage {
background-image: url([[pix:i/expired]]);
background-repeat: no-repeat;
background-size: 100px 100px;
width: 100px;
height: 100px;
left: 0;
Expand Down
8 changes: 7 additions & 1 deletion theme/boost/style/moodle.css
Expand Up @@ -11173,10 +11173,13 @@ ul.badges {
position: relative; }

.badges li .expireimage {
background-image: url([[pix:i/expired]]);
background-repeat: no-repeat;
background-size: 100px 100px;
width: 100px;
height: 100px;
left: 25px;
top: 0;
top: 15px;
position: absolute;
z-index: 10;
opacity: 0.85; }
Expand All @@ -11192,6 +11195,9 @@ ul.badges {
margin-top: 17px;
margin-bottom: 20px; }
#badge-image .expireimage {
background-image: url([[pix:i/expired]]);
background-repeat: no-repeat;
background-size: 100px 100px;
width: 100px;
height: 100px;
left: 0;
Expand Down
8 changes: 7 additions & 1 deletion theme/classic/style/moodle.css
Expand Up @@ -11383,10 +11383,13 @@ ul.badges {
position: relative; }

.badges li .expireimage {
background-image: url([[pix:i/expired]]);
background-repeat: no-repeat;
background-size: 100px 100px;
width: 100px;
height: 100px;
left: 25px;
top: 0;
top: 15px;
position: absolute;
z-index: 10;
opacity: 0.85; }
Expand All @@ -11402,6 +11405,9 @@ ul.badges {
margin-top: 17px;
margin-bottom: 20px; }
#badge-image .expireimage {
background-image: url([[pix:i/expired]]);
background-repeat: no-repeat;
background-size: 100px 100px;
width: 100px;
height: 100px;
left: 0;
Expand Down

0 comments on commit c228509

Please sign in to comment.