151 {
153
154 include_once "Services/UIComponent/Modal/classes/class.ilModalGUI.php";
155
156
157
158
162 $modal->setHeading($this->badge->getTitle());
163
164 $lng->loadLanguageModule(
"badge");
165
166 $tpl =
new ilTemplate(
"tpl.badge_modal.html",
true,
true,
"Services/Badge");
167
168 $tpl->setVariable(
"IMG_SRC", $this->badge->getImagePath());
169 $tpl->setVariable(
"IMG_TXT", $this->badge->getImage());
170
171 $tpl->setVariable(
"TXT_DESC",
$lng->txt(
"description"));
172 $tpl->setVariable(
"DESC", nl2br($this->badge->getDescription()));
173
174 $tpl->setVariable(
"TXT_CRITERIA",
$lng->txt(
"badge_criteria"));
175 $tpl->setVariable(
"CRITERIA", nl2br($this->badge->getCriteria()));
176
177 if ($this->assignment) {
178 $tpl->setVariable(
"TXT_TSTAMP",
$lng->txt(
"badge_issued_on"));
180 "TSTAMP",
182 );
183 }
184
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"]));
192 "PARENT_ICON",
193 ilObject::_getIcon($parent["id"], "big", $parent["type"])
194 );
195 }
196 }
197
198 if ($this->badge->getValid()) {
199 $tpl->setVariable(
"TXT_VALID",
$lng->txt(
"badge_valid"));
200 $tpl->setVariable(
"VALID", $this->badge->getValid());
201 }
202
203 $modal->setBody(
$tpl->get());
204
205 return $modal->getHTML();
206 }
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
static getInstance()
Get instance.