4include_once 
"Services/Badge/classes/class.ilBadge.php";
 
   25                        $this->assignment = $a_assignment;                                      
 
   26                        $this->badge = 
new ilBadge($this->assignment->getBadgeId());
 
   30                        $this->badge = $a_badge;
 
   36                $id = explode(
"_", 
$_GET[
"id"]);
 
   45                                include_once 
"Services/Badge/classes/class.ilBadgeAssignment.php";
 
   54                                include_once 
"Services/Badge/classes/class.ilBadge.php";
 
   56                                $obj = 
new self(
null, 
$badge);
 
   58                        if($hash == $obj->getBadgeHash())
 
   73                        $url = 
$ilCtrl->getLinkTargetByClass(
"ilBadgeHandlerGUI", 
 
   74                                "render", 
"", 
true, 
false);
 
   76                        $tpl->addJavaScript(
"Services/Badge/js/ilBadgeRenderer.js");
 
   77                        $tpl->addOnLoadCode(
'il.BadgeRenderer.init("'.
$url.
'");');
 
   82                $btpl = 
new ilTemplate(
"tpl.badge_renderer.html", 
true, 
true, 
"Services/Badge");                
 
   83                $btpl->setVariable(
"BADGE_IMG", $this->badge->getImagePath());
 
   84                $btpl->setVariable(
"BADGE_TXT", $this->badge->getTitle());
 
   85                $btpl->setVariable(
"BADGE_ID", 
"badge_".
 
   87                                ? $this->assignment->getUserId()
 
   89                        $this->badge->getId().
"_".
 
  102                        $url = 
$ilCtrl->getLinkTargetByClass(
"ilBadgeHandlerGUI", 
 
  103                                "render", 
"", 
true, 
false);
 
  105                        $tpl->addJavaScript(
"Services/Badge/js/ilBadgeRenderer.js");
 
  106                        $tpl->addOnLoadCode(
'il.BadgeRenderer.init("'.
$url.
'");');
 
  111                return "#\" data-id=\"badge_".
 
  113                                ? $this->assignment->getUserId()
 
  115                        $this->badge->getId().
"_".
 
  123                                ? $this->assignment->getUserId()
 
  125                        $this->badge->getId());
 
  132                include_once 
"Services/UIComponent/Modal/classes/class.ilModalGUI.php";
 
  140                $modal->setHeading($this->badge->getTitle());
 
  142                $lng->loadLanguageModule(
"badge");
 
  144                $tpl = 
new ilTemplate(
"tpl.badge_modal.html", 
true, 
true, 
"Services/Badge");
 
  146                $tpl->setVariable(
"IMG_SRC", $this->badge->getImagePath());
 
  147                $tpl->setVariable(
"IMG_TXT", $this->badge->getImage());
 
  149                $tpl->setVariable(
"TXT_DESC", 
$lng->txt(
"description"));        
 
  150                $tpl->setVariable(
"DESC", nl2br($this->badge->getDescription()));
 
  152                $tpl->setVariable(
"TXT_CRITERIA", 
$lng->txt(
"badge_criteria")); 
 
  153                $tpl->setVariable(
"CRITERIA", nl2br($this->badge->getCriteria()));
 
  155                if($this->assignment)
 
  157                        $tpl->setVariable(
"TXT_TSTAMP", 
$lng->txt(
"badge_issued_on"));  
 
  158                        $tpl->setVariable(
"TSTAMP", 
 
  162                if($this->badge->getParentId())
 
  164                        $parent = $this->badge->getParentMeta();        
 
  165                        if($parent[
"type"] != 
"bdga")
 
  167                                $tpl->setVariable(
"TXT_PARENT", 
$lng->txt(
"object"));                   
 
  168                                $tpl->setVariable(
"PARENT", $parent[
"title"]);
 
  169                                $tpl->setVariable(
"PARENT_TYPE", 
$lng->txt(
"obj_".$parent[
"type"]));
 
  170                                $tpl->setVariable(
"PARENT_ICON", 
 
  175                if($this->badge->getValid())
 
  177                        $tpl->setVariable(
"TXT_VALID", 
$lng->txt(
"badge_valid"));               
 
  178                        $tpl->setVariable(
"VALID", $this->badge->getValid());           
 
  181                $modal->setBody(
$tpl->get());
 
  183                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)
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