19declare(strict_types=1);
43 $this->ui_factory =
$DIC->ui()->factory();
44 $this->ui_renderer =
$DIC->ui()->renderer();
45 $this->
lng = $DIC->language();
46 $this->
lng->loadLanguageModule(
'badge');
59 array $badge_properties = [],
60 bool $enclose_in_div =
false
62 if ($badge_image !== null) {
63 if ($enclose_in_div) {
64 $modal_content[] = $this->ui_factory->legacy()->content(
65 '<div class="ilBadgeImage">' . $this->ui_renderer->render($badge_image) .
'</div>'
68 $modal_content[] = $badge_image;
72 if ($this->assignment) {
80 $modal_content[] = $this->ui_factory->item()
81 ->standard($badge_title)
83 ->withProperties($badge_properties);
85 $card = $this->ui_factory->card()
86 ->standard($badge_title)
87 ->withHiddenSections($modal_content);
89 return $this->ui_factory->modal()->lightbox(
90 $this->ui_factory->modal()->lightboxCardPage($card)
96 return $this->ui_renderer->render($modal);
101 return $this->ui_renderer->render($this->ui_factory->button()->shy($label, $modal->getShowSignal()));
112 if (\count($properties) > 0) {
113 foreach ($properties as $lang_var =>
$data) {
115 $translations[$this->
lng->txt($lang_var)] =
$data;
119 return $translations;
translateKeysWithValidDataAttribute(array $properties)
__construct(?ilBadgeAssignment $assignment=null)
renderShyButton(string $label, Modal $modal)
ilBadgeAssignment $assignment
renderModal(Modal $modal)
constructModal(?Image $badge_image, string $badge_title, array $badge_properties=[], bool $enclose_in_div=false)
Builds a Color from either hex- or rgb values.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class for date presentation.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
This describes commonalities between the different modals.
This is how the factory for UI elements looks.
An entity that renders components to a string output.
if(!file_exists('../ilias.ini.php'))