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

Public Member Functions

 __construct (?ilBadgeAssignment $assignment=null, ?ilBadge $badge=null)
 
 getHTML ()
 

Private Attributes

readonly ilLanguage $lng
 
readonly Renderer $renderer
 
readonly Tile $tile
 
readonly ilBadgeAssignment $assignment
 
readonly ilBadge $badge
 

Detailed Description

Definition at line 22 of file class.ilBadgeRenderer.php.

Constructor & Destructor Documentation

◆ __construct()

ilBadgeRenderer::__construct ( ?ilBadgeAssignment  $assignment = null,
?ilBadge  $badge = null 
)

Definition at line 30 of file class.ilBadgeRenderer.php.

33 {
34 global $DIC;
35
36 $this->lng = $DIC->language();
37 $this->renderer = $DIC->ui()->renderer();
38 $this->tile = new Tile($DIC);
39
40 if ($assignment) {
41 $this->assignment = $assignment;
42 $this->badge = new ilBadge($this->assignment->getBadgeId());
43 } else {
44 $this->assignment = null;
45 $this->badge = $badge;
46 }
47 }
renderer()
readonly ilBadgeAssignment $assignment
readonly ilBadge $badge
global $DIC
Definition: shib_login.php:26

References $assignment, $badge, $DIC, ILIAS\Repository\lng(), and renderer().

+ Here is the call graph for this function:

Member Function Documentation

◆ getHTML()

ilBadgeRenderer::getHTML ( )

Definition at line 49 of file class.ilBadgeRenderer.php.

49 : string
50 {
51 $this->lng->loadLanguageModule('badge');
52 $content = $this->tile->modalContent($this->badge);
53 if ($this->assignment) {
54 $content = $this->tile->addAssignment($content, $this->assignment);
55 }
56
57 return $this->renderer->render($this->tile->asImage($content));
58 }

References ILIAS\Repository\lng(), and renderer().

+ Here is the call graph for this function:

Field Documentation

◆ $assignment

readonly ilBadgeAssignment ilBadgeRenderer::$assignment
private

Definition at line 27 of file class.ilBadgeRenderer.php.

Referenced by __construct().

◆ $badge

readonly ilBadge ilBadgeRenderer::$badge
private

Definition at line 28 of file class.ilBadgeRenderer.php.

Referenced by __construct().

◆ $lng

readonly ilLanguage ilBadgeRenderer::$lng
private

Definition at line 24 of file class.ilBadgeRenderer.php.

◆ $renderer

readonly Renderer ilBadgeRenderer::$renderer
private

Definition at line 25 of file class.ilBadgeRenderer.php.

◆ $tile

readonly Tile ilBadgeRenderer::$tile
private

Definition at line 26 of file class.ilBadgeRenderer.php.


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