36 $this->
lng = $DIC->language();
37 $this->factory = $DIC->ui()->factory();
38 $this->renderer = $DIC->ui()->renderer();
40 $this->assignment = $a_assignment;
41 $this->badge =
new ilBadge($this->assignment->getBadgeId());
43 $this->badge = $a_badge;
49 $components = array();
51 $modal = $this->factory->modal()->roundtrip(
52 $this->badge->getTitle(),
54 )->withCancelButtonLabel(
"ok");
55 $components[] = $modal;
58 $image = $this->factory->image()->responsive($image_path, $this->badge->getTitle())
59 ->withAction($modal->getShowSignal());
60 $components[] = $image;
62 return $this->renderer->render($components);
70 $modal_content = array();
72 $image = $this->factory->image()->responsive(
ilWACSignedPath::signFile($this->badge->getImagePath()), $this->badge->getImage());
73 $modal_content[] = $image;
75 $badge_information = [
76 $lng->
txt(
"description") => $this->badge->getDescription(),
77 $lng->
txt(
"badge_criteria") => $this->badge->getCriteria(),
80 if ($this->assignment) {
86 if ($this->badge->getParentId()) {
87 $parent = $this->badge->getParentMeta();
88 if ($parent[
"type"] !==
"bdga") {
89 $parent_icon = $this->factory->symbol()->icon()->custom(
91 $lng->
txt(
"obj_" . $parent[
"type"])
92 )->withSize(
"medium");
94 $label = $parent[
'title'];
97 $label = $this->factory->link()->standard($label,
ilLink::_getLink($ref, $parent[
'type']));
98 $label = $this->renderer->render($label);
100 $badge_information[$lng->
txt(
'object')] = $this->renderer->render($parent_icon) . $label;
104 if ($this->badge->getValid()) {
105 $badge_information[$lng->
txt(
"badge_valid")] = $this->badge->getValid();
108 $list = $this->factory->listing()->descriptive($badge_information);
109 $modal_content[] = $list;
111 return $this->renderer->render($modal_content);
ilBadgeAssignment $assignment
ILIAS UI Renderer $renderer
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getAllReferences(int $id)
get all reference ids for object ID
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
loadLanguageModule(string $a_module)
Load language module.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getLink(?int $a_ref_id, string $a_type='', array $a_params=array(), string $append="")
ILIAS UI Factory $factory
static signFile(string $path_to_file)
__construct(ilBadgeAssignment $a_assignment=null, ilBadge $a_badge=null)