Skip to content

Commit

Permalink
Fix tile view for badges, #42599 (ILIAS-eLearning#8358)
Browse files Browse the repository at this point in the history
  • Loading branch information
gvollbach authored Nov 7, 2024
1 parent 3af7d0b commit c26fe46
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/ILIAS/Badge/classes/Modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function components(ModalContent $content): array
$image_src = $this->badge_image_service->getImageFromBadge($content->badge());

$modal_content[] = $this->container->ui()->factory()->image()->responsive(
($this->sign_file)($image_src),
$image_src,
$image_src
);
$modal_content[] = $this->container->ui()->factory()->divider()->horizontal();
Expand Down
4 changes: 2 additions & 2 deletions components/ILIAS/Badge/classes/Tile.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ private function modal(Card $card): Component

private function image(Component $modal, ilBadge $badge): Component
{
$image_src = $this->badge_image_service->getImageFromBadge($badge);
$image_src = $this->badge_image_service->getImageFromBadge($badge, ilBadgeImage::IMAGE_SIZE_M);
return $this->container
->ui()
->factory()
->image()
->responsive(($this->sign_file)($image_src), $image_src)
->responsive($image_src, $image_src)
->withAction($modal->getShowSignal());
}

Expand Down
4 changes: 2 additions & 2 deletions components/ILIAS/Badge/classes/class.ilBadgeImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ public function __construct(
$this->main_template = $main_template;
}

public function getImageFromBadge(ilBadge $badge): string
public function getImageFromBadge(ilBadge $badge, int $size = self::IMAGE_SIZE_XS): string
{
$image_rid = $badge->getImageRid();
return $this->getImageFromResourceId($badge, (string) $image_rid);
return $this->getImageFromResourceId($badge, (string) $image_rid, $size);
}

public function getImageFromResourceId(
Expand Down

0 comments on commit c26fe46

Please sign in to comment.