19declare(strict_types=1);
44 $this->ui_factory =
$DIC->ui()->factory();
45 $this->ui_renderer =
$DIC->ui()->renderer();
46 $this->
lng = $DIC->language();
47 $this->
lng->loadLanguageModule(
'badge');
60 array $badge_properties = []
62 if ($badge_image !== null) {
63 $modal_content[] = $badge_image;
66 if ($this->assignment) {
74 $modal_content[] = $this->ui_factory->item()
75 ->standard($badge_title)
77 ->withProperties($badge_properties);
79 $card = $this->ui_factory->card()
80 ->standard($badge_title)
81 ->withHiddenSections($modal_content);
83 return $this->ui_factory->modal()->lightbox(
84 $this->ui_factory->modal()->lightboxCardPage($card)
90 return $this->ui_renderer->render($modal);
95 return $this->ui_renderer->render($this->ui_factory->button()->shy($label, $modal->getShowSignal()));
106 if (\count($properties) > 0) {
107 foreach ($properties as $lang_var =>
$data) {
109 $translations[$this->
lng->txt($lang_var)] =
$data;
113 return $translations;
translateKeysWithValidDataAttribute(array $properties)
__construct(?ilBadgeAssignment $assignment=null)
renderShyButton(string $label, Modal $modal)
constructModal(?Image $badge_image, string $badge_title, array $badge_properties=[])
ilBadgeAssignment $assignment
renderModal(Modal $modal)
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'))