ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Badge\Modal Class Reference
+ Collaboration diagram for ILIAS\Badge\Modal:

Public Member Functions

 __construct (private readonly Container $container, $sign_file=[ilWACSignedPath::class, 'signFile'])
 
 components (ModalContent $content)
 

Private Member Functions

 item (ModalContent $content)
 

Private Attributes

readonly Closure $sign_file
 
ilBadgeImage $badge_image_service
 

Detailed Description

Definition at line 28 of file Modal.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Badge\Modal::__construct ( private readonly Container  $container,
  $sign_file = [ilWACSignedPath::class, 'signFile'] 
)

Definition at line 34 of file Modal.php.

37 {
38 $this->sign_file = Closure::fromCallable($sign_file);
39 $this->badge_image_service = new ilBadgeImage(
40 $container->resourceStorage(),
41 $container->upload(),
42 $container->ui()->mainTemplate()
43 );
44 }
readonly Closure $sign_file
Definition: Modal.php:31
$container
@noRector
Definition: wac.php:37

References $container, and ILIAS\Badge\Modal\$sign_file.

Member Function Documentation

◆ components()

ILIAS\Badge\Modal::components ( ModalContent  $content)
Returns
list<Component>

Definition at line 49 of file Modal.php.

49 : array
50 {
51 $modal_content = [];
52
53 $image_src = $this->badge_image_service->getImageFromBadge($content->badge(), ilBadgeImage::IMAGE_SIZE_XL);
54
55 $modal_content[] = $this->container->ui()->factory()->image()->responsive(
56 $image_src,
57 $content->badge()->getTitle()
58 );
59 $modal_content[] = $this->container->ui()->factory()->divider()->horizontal();
60 $modal_content[] = $this->item($content);
61
62 return $modal_content;
63 }
item(ModalContent $content)
Definition: Modal.php:65

References ILIAS\Badge\ModalContent\badge(), ILIAS\Badge\ilBadgeImage\IMAGE_SIZE_XL, and ILIAS\Badge\Modal\item().

+ Here is the call graph for this function:

◆ item()

ILIAS\Badge\Modal::item ( ModalContent  $content)
private

Definition at line 65 of file Modal.php.

65 : Component
66 {
67 return $this->container
68 ->ui()
69 ->factory()
70 ->item()
71 ->standard($content->badge()->getTitle())
72 ->withDescription($content->badge()->getDescription())
73 ->withProperties($content->properties());
74 }

References ILIAS\Badge\ModalContent\badge(), and ILIAS\Badge\ModalContent\properties().

Referenced by ILIAS\Badge\Modal\components().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $badge_image_service

ilBadgeImage ILIAS\Badge\Modal::$badge_image_service
private

Definition at line 32 of file Modal.php.

◆ $sign_file

readonly Closure ILIAS\Badge\Modal::$sign_file
private

Definition at line 31 of file Modal.php.

Referenced by ILIAS\Badge\Modal\__construct().


The documentation for this class was generated from the following file: