4 include_once
"Services/Badge/classes/class.ilBadge.php";
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;
54 if (
sizeof(
$id) == 3) {
60 include_once
"Services/Badge/classes/class.ilBadgeAssignment.php";
66 include_once
"Services/Badge/classes/class.ilBadge.php";
68 $obj =
new self(null,
$badge);
70 if ($hash == $obj->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");
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() .
"_" .
127 $tpl->addJavaScript(
"Services/Badge/js/ilBadgeRenderer.js");
128 $tpl->addOnLoadCode(
'il.BadgeRenderer.init("' .
$url .
'");');
133 return "#\" data-id=\"badge_" .
135 ? $this->assignment->getUserId()
137 $this->badge->getId() .
"_" .
145 ? $this->assignment->getUserId()
147 $this->badge->getId());
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();
if(!array_key_exists('StateId', $_REQUEST)) $id
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 signFile($path_to_file)
static getInstance()
Get instance.
__construct(ilBadgeAssignment $a_assignment=null, ilBadge $a_badge=null)