Skip to content

Commit

Permalink
Merge branch 'MDL-71315-master' of git://github.com/sarjona/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Apr 14, 2021
2 parents 88a29d6 + e281a5e commit dbda852
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions badges/renderer.php
Expand Up @@ -350,18 +350,15 @@ protected function render_issued_badge(\core_badges\output\issued_badge $ibadge)
if (!empty($CFG->badges_allowexternalbackpack) && ($expiration > $now)
&& $userbackpack = badges_get_user_backpack($USER->id)) {

$assertion = null;
if (badges_open_badges_backpack_api($userbackpack->id) == OPEN_BADGES_V2P1) {
$assertion = new moodle_url('/badges/backpack-export.php', array('hash' => $ibadge->hash));
} else {
$assertion = new moodle_url('/badges/backpack-add.php', array('hash' => $ibadge->hash));
}

if (!is_null(assertion)) {
$attributes = ['class' => 'btn btn-secondary m-1', 'role' => 'button'];
$tobackpack = html_writer::link($assertion, get_string('addtobackpack', 'badges'), $attributes);
$output .= $tobackpack;
}
$attributes = ['class' => 'btn btn-secondary m-1', 'role' => 'button'];
$tobackpack = html_writer::link($assertion, get_string('addtobackpack', 'badges'), $attributes);
$output .= $tobackpack;
}
}
$output .= html_writer::end_tag('div');
Expand Down

0 comments on commit dbda852

Please sign in to comment.