Definition at line 14 of file class.ilBadgeRenderer.php.
◆ __construct()
Definition at line 36 of file class.ilBadgeRenderer.php.
References $DIC.
40 $this->tpl = $DIC[
"tpl"];
41 $this->ctrl = $DIC->ctrl();
42 $this->lng = $DIC->language();
44 $this->assignment = $a_assignment;
45 $this->badge =
new ilBadge($this->assignment->getBadgeId());
47 $this->badge = $a_badge;
◆ getBadgeHash()
ilBadgeRenderer::getBadgeHash |
( |
| ) |
|
|
protected |
◆ getHref()
ilBadgeRenderer::getHref |
( |
| ) |
|
◆ getHTML()
ilBadgeRenderer::getHTML |
( |
| ) |
|
Definition at line 76 of file class.ilBadgeRenderer.php.
References $ctrl, $ilCtrl, $tpl, $url, getBadgeHash(), and ilWACSignedPath\signFile().
92 $tpl->addJavaScript(
"Services/Badge/js/ilBadgeRenderer.js");
93 $tpl->addOnLoadCode(
'il.BadgeRenderer.init("' .
$url .
'");');
98 $btpl =
new ilTemplate(
"tpl.badge_renderer.html",
true,
true,
"Services/Badge");
100 $btpl->setVariable(
"BADGE_IMG", $image_path);
101 $btpl->setVariable(
"BADGE_TXT", $this->badge->getTitle());
102 $btpl->setVariable(
"BADGE_ID",
"badge_" .
104 ? $this->assignment->getUserId()
106 $this->badge->getId() .
"_" .
special template class to simplify handling of ITX/PEAR
static signFile($path_to_file)
◆ initFromId()
static ilBadgeRenderer::initFromId |
( |
|
$a_id | ) |
|
|
static |
◆ renderModal()
ilBadgeRenderer::renderModal |
( |
| ) |
|
Definition at line 150 of file class.ilBadgeRenderer.php.
References $lng, $tpl, ilDatePresentation\formatDate(), getBadgeHash(), ilModalGUI\getInstance(), IL_CAL_UNIX, and ilModalGUI\TYPE_SMALL.
154 include_once
"Services/UIComponent/Modal/classes/class.ilModalGUI.php";
162 $modal->setHeading($this->badge->getTitle());
164 $lng->loadLanguageModule(
"badge");
166 $tpl =
new ilTemplate(
"tpl.badge_modal.html",
true,
true,
"Services/Badge");
168 $tpl->setVariable(
"IMG_SRC", $this->badge->getImagePath());
169 $tpl->setVariable(
"IMG_TXT", $this->badge->getImage());
171 $tpl->setVariable(
"TXT_DESC",
$lng->txt(
"description"));
172 $tpl->setVariable(
"DESC", nl2br($this->badge->getDescription()));
174 $tpl->setVariable(
"TXT_CRITERIA",
$lng->txt(
"badge_criteria"));
175 $tpl->setVariable(
"CRITERIA", nl2br($this->badge->getCriteria()));
177 if ($this->assignment) {
178 $tpl->setVariable(
"TXT_TSTAMP",
$lng->txt(
"badge_issued_on"));
185 if ($this->badge->getParentId()) {
186 $parent = $this->badge->getParentMeta();
187 if ($parent[
"type"] !=
"bdga") {
188 $tpl->setVariable(
"TXT_PARENT",
$lng->txt(
"object"));
189 $tpl->setVariable(
"PARENT", $parent[
"title"]);
190 $tpl->setVariable(
"PARENT_TYPE",
$lng->txt(
"obj_" . $parent[
"type"]));
193 ilObject::_getIcon($parent[
"id"],
"big", $parent[
"type"])
198 if ($this->badge->getValid()) {
199 $tpl->setVariable(
"TXT_VALID",
$lng->txt(
"badge_valid"));
200 $tpl->setVariable(
"VALID", $this->badge->getValid());
203 $modal->setBody(
$tpl->get());
205 return $modal->getHTML();
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
special template class to simplify handling of ITX/PEAR
static getInstance()
Get instance.
◆ $assignment
ilBadgeRenderer::$assignment |
|
protected |
◆ $badge
◆ $ctrl
◆ $init
◆ $lng
◆ $tpl
The documentation for this class was generated from the following file: