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, and getBadgeHash().
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");
99 $btpl->setVariable(
"BADGE_IMG", $this->badge->getImagePath());
100 $btpl->setVariable(
"BADGE_TXT", $this->badge->getTitle());
101 $btpl->setVariable(
"BADGE_ID",
"badge_" .
103 ? $this->assignment->getUserId()
105 $this->badge->getId() .
"_" .
special template class to simplify handling of ITX/PEAR
◆ initFromId()
static ilBadgeRenderer::initFromId |
( |
|
$a_id | ) |
|
|
static |
◆ renderModal()
ilBadgeRenderer::renderModal |
( |
| ) |
|
Definition at line 149 of file class.ilBadgeRenderer.php.
References $lng, $tpl, ilObject\_getIcon(), ilDatePresentation\formatDate(), getBadgeHash(), ilModalGUI\getInstance(), IL_CAL_UNIX, and ilModalGUI\TYPE_SMALL.
153 include_once
"Services/UIComponent/Modal/classes/class.ilModalGUI.php";
161 $modal->setHeading($this->badge->getTitle());
163 $lng->loadLanguageModule(
"badge");
165 $tpl =
new ilTemplate(
"tpl.badge_modal.html",
true,
true,
"Services/Badge");
167 $tpl->setVariable(
"IMG_SRC", $this->badge->getImagePath());
168 $tpl->setVariable(
"IMG_TXT", $this->badge->getImage());
170 $tpl->setVariable(
"TXT_DESC",
$lng->txt(
"description"));
171 $tpl->setVariable(
"DESC", nl2br($this->badge->getDescription()));
173 $tpl->setVariable(
"TXT_CRITERIA",
$lng->txt(
"badge_criteria"));
174 $tpl->setVariable(
"CRITERIA", nl2br($this->badge->getCriteria()));
176 if ($this->assignment) {
177 $tpl->setVariable(
"TXT_TSTAMP",
$lng->txt(
"badge_issued_on"));
184 if ($this->badge->getParentId()) {
185 $parent = $this->badge->getParentMeta();
186 if ($parent[
"type"] !=
"bdga") {
187 $tpl->setVariable(
"TXT_PARENT",
$lng->txt(
"object"));
188 $tpl->setVariable(
"PARENT", $parent[
"title"]);
189 $tpl->setVariable(
"PARENT_TYPE",
$lng->txt(
"obj_" . $parent[
"type"]));
197 if ($this->badge->getValid()) {
198 $tpl->setVariable(
"TXT_VALID",
$lng->txt(
"badge_valid"));
199 $tpl->setVariable(
"VALID", $this->badge->getValid());
202 $modal->setBody(
$tpl->get());
204 return $modal->getHTML();
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=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: