19 declare(strict_types=1);
42 $this->main_tpl = $main_tpl ?? $DIC->ui()->mainTemplate();
43 $this->
lng = $lng ?? $DIC->language();
44 $this->
lng->loadLanguageModule(
'badge');
46 $this->irss = $DIC->resourceStorage();
52 'tpl.usr_public_profile_badges.html',
55 'components/ILIAS/Badge' 58 $this->main_tpl->addJavaScript(
'assets/js/PublicProfileBadges.js');
59 $this->main_tpl->addOnLoadCode(
'new BadgeToggle("ilbdgprcont", "ilbdgprfhdm", "ilbdgprfhdl", "ilNoDisplay");');
62 $has_public_badge =
false;
69 foreach ($user_badges as $ass) {
70 $badge =
new ilBadge($ass->getBadgeId());
71 $image_rids[] = $badge->getImageRid();
72 $badge_by_id[$badge->getId()] = $badge;
75 $this->irss->preload(array_filter($image_rids));
77 foreach ($user_badges as $ass) {
79 if ($ass->getPosition()) {
86 $tpl->setCurrentBlock(
'hidden_badge');
87 $tpl->touchBlock(
'hidden_badge');
88 $tpl->parseCurrentBlock();
91 $tpl->setCurrentBlock(
'badge_bl');
92 $tpl->setVariable(
'BADGE',
$renderer->getHTML());
93 $tpl->parseCurrentBlock();
95 $has_public_badge =
true;
100 $tpl->setVariable(
'BADGE_HIDDEN_TXT_MORE', $this->
lng->txt(
'badge_profile_more'));
101 $tpl->setVariable(
'BADGE_HIDDEN_TXT_LESS', $this->
lng->txt(
'badge_profile_less'));
104 if ($has_public_badge) {
105 $tpl->setVariable(
'TXT_BADGES', $this->
lng->txt(
'obj_bdga'));
ilGlobalTemplateInterface $main_tpl
static getInstancesByUserId(int $a_user_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(?ilGlobalTemplateInterface $main_tpl=null, ?ilLanguage $lng=null)