4include_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");
 
   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() . 
"_" .
 
  126            $tpl->addJavaScript(
"Services/Badge/js/ilBadgeRenderer.js");
 
  127            $tpl->addOnLoadCode(
'il.BadgeRenderer.init("' . 
$url . 
'");');
 
  132        return "#\" data-id=\"badge_" .
 
  134                ? $this->assignment->getUserId()
 
  136            $this->badge->getId() . 
"_" .
 
  144                ? $this->assignment->getUserId()
 
  146            $this->badge->getId());
 
  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();
 
An exception for terminatinating execution or to throw for unit testing.
__construct(ilBadgeAssignment $a_assignment=null, ilBadge $a_badge=null)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
@classDescription Date and time handling
static getInstance()
Get instance.
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
special template class to simplify handling of ITX/PEAR
if(!array_key_exists('StateId', $_REQUEST)) $id