ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

36  {
37  global $DIC;
38 
39  $this->lng = $DIC->language();
40  $this->renderer = $DIC->ui()->renderer();
41  $this->tile = new Tile($DIC);
42 
43  if ($assignment) {
44  $this->assignment = $assignment;
45  $this->badge = new ilBadge($this->assignment->getBadgeId());
46  } else {
47  $this->assignment = null;
48  $this->badge = $badge;
49  }
50  }
readonly ilBadge $badge
global $DIC
Definition: feed.php:28
readonly ilBadgeAssignment $assignment
+ Here is the call graph for this function:

Member Function Documentation

◆ getHTML()

ilBadgeRenderer::getHTML ( )

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

References ILIAS\Repository\lng().

52  : string
53  {
54  $this->lng->loadLanguageModule('badge');
55  $content = $this->tile->modalContent($this->badge);
56  if ($this->assignment) {
57  $content = $this->tile->addAssignment($content, $this->assignment);
58  }
59 
60  return $this->renderer->render($this->tile->asImage($content));
61  }
+ Here is the call graph for this function:

Field Documentation

◆ $assignment

readonly ilBadgeAssignment ilBadgeRenderer::$assignment
private

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

Referenced by __construct().

◆ $badge

readonly ilBadge ilBadgeRenderer::$badge
private

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

Referenced by __construct().

◆ $lng

readonly ilLanguage ilBadgeRenderer::$lng
private

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

◆ $renderer

readonly Renderer ilBadgeRenderer::$renderer
private

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

◆ $tile

readonly Tile ilBadgeRenderer::$tile
private

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


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