ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
ILIAS\LegalDocuments\ConsumerToolbox\UI Class Reference
+ Collaboration diagram for ILIAS\LegalDocuments\ConsumerToolbox\UI:

Public Member Functions

 __construct (private readonly string $id, private readonly UIServices $services, private readonly ilLanguage $language)
 
 create ()
 
 mainTemplate ()
 
 loadLanguageModule (string $module)
 
 getDefaultLanguage ()
 
 txt (string $name)
 

Private Member Functions

 firstExisting (array $lang_vars, string $fallback)
 

Detailed Description

Definition at line 29 of file UI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LegalDocuments\ConsumerToolbox\UI::__construct ( private readonly string  $id,
private readonly UIServices  $services,
private readonly ilLanguage  $language 
)

Definition at line 31 of file UI.php.

35  {
36  }

Member Function Documentation

◆ create()

ILIAS\LegalDocuments\ConsumerToolbox\UI::create ( )

Definition at line 38 of file UI.php.

Referenced by ILIAS\DataProtection\Consumer\showMatchingDocument().

38  : UIFactory
39  {
40  return $this->services->factory();
41  }
+ Here is the caller graph for this function:

◆ firstExisting()

ILIAS\LegalDocuments\ConsumerToolbox\UI::firstExisting ( array  $lang_vars,
string  $fallback 
)
private
Parameters
list<string>$lang_vars

Definition at line 70 of file UI.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

Referenced by ILIAS\LegalDocuments\ConsumerToolbox\UI\txt().

70  : string
71  {
72  foreach ($lang_vars as $lang_var) {
73  if ($this->language->exists($lang_var)) {
74  return $lang_var;
75  }
76  }
77 
78  return $fallback;
79  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultLanguage()

ILIAS\LegalDocuments\ConsumerToolbox\UI::getDefaultLanguage ( )

Definition at line 53 of file UI.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

53  : string
54  {
55  return $this->language->getDefaultLanguage();
56  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

◆ loadLanguageModule()

ILIAS\LegalDocuments\ConsumerToolbox\UI::loadLanguageModule ( string  $module)

Definition at line 48 of file UI.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

Referenced by ILIAS\LegalDocuments\ConsumerToolbox\UI\txt().

48  : void
49  {
50  $this->language->loadLanguageModule($module);
51  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mainTemplate()

ILIAS\LegalDocuments\ConsumerToolbox\UI::mainTemplate ( )

Definition at line 43 of file UI.php.

44  {
45  return $this->services->mainTemplate();
46  }

◆ txt()

ILIAS\LegalDocuments\ConsumerToolbox\UI::txt ( string  $name)

Definition at line 58 of file UI.php.

References ILIAS\LegalDocuments\ConsumerToolbox\UI\firstExisting(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), ILIAS\LegalDocuments\ConsumerToolbox\UI\loadLanguageModule(), and ilObjLegalDocumentsGUI\TYPE.

Referenced by ILIAS\DataProtection\Consumer\showMatchingDocument().

58  : string
59  {
60  $this->loadLanguageModule($this->id);
61  return $this->language->txt($this->firstExisting([
62  $this->id . '_' . $name,
63  ilObjLegalDocumentsGUI::TYPE . '_' . $name
64  ], $name));
65  }
firstExisting(array $lang_vars, string $fallback)
Definition: UI.php:70
loadLanguageModule(string $module)
Definition: UI.php:48
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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