mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 00:42:54 +02:00
Merge branch 'MDL-73153-master' of https://github.com/sarjona/moodle
This commit is contained in:
commit
80bdd33b6b
@ -124,6 +124,17 @@ class external_badge implements renderable {
|
||||
$this->issued->image = $this->issued->imageUrl;
|
||||
}
|
||||
$data->badgeimage = $this->issued->image;
|
||||
if (is_object($data->badgeimage)) {
|
||||
if (!empty($data->badgeimage->author)) {
|
||||
$data->hasotherfields = true;
|
||||
$data->imageauthorname = $data->badgeimage->author;
|
||||
}
|
||||
if (!empty($data->badgeimage->caption)) {
|
||||
$data->hasotherfields = true;
|
||||
$data->imagecaption = $data->badgeimage->caption;
|
||||
}
|
||||
$data->badgeimage = $data->badgeimage->id;
|
||||
}
|
||||
|
||||
// Field: Expiration date.
|
||||
if (isset($this->issued->assertion->expires)) {
|
||||
|
@ -24,6 +24,8 @@
|
||||
* @author Yuliya Bozhko <yuliya.bozhko@totaralms.com>
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
require_once($CFG->libdir . '/badgeslib.php');
|
||||
require_once($CFG->libdir . '/tablelib.php');
|
||||
|
||||
@ -47,7 +49,14 @@ class core_badges_renderer extends plugin_renderer_base {
|
||||
$bname = s($badge->name);
|
||||
}
|
||||
if (!empty($badge->image)) {
|
||||
$imageurl = $badge->image;
|
||||
if (is_object($badge->image)) {
|
||||
if (!empty($badge->image->caption)) {
|
||||
$badge->imagecaption = $badge->image->caption;
|
||||
}
|
||||
$imageurl = $badge->image->id;
|
||||
} else {
|
||||
$imageurl = $badge->image;
|
||||
}
|
||||
}
|
||||
if (isset($badge->assertion->badge->name)) {
|
||||
$bname = s($badge->assertion->badge->name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user