ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

38 : UIFactory
39 {
40 return $this->services->factory();
41 }

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

+ 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.

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 }

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

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

+ 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.

53 : string
54 {
55 return $this->language->getDefaultLanguage();
56 }

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

+ Here is the call graph for this function:

◆ loadLanguageModule()

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

Definition at line 48 of file UI.php.

48 : void
49 {
50 $this->language->loadLanguageModule($module);
51 }

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

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

+ 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.

58 : string
59 {
60 $this->loadLanguageModule($this->id);
61 return $this->language->txt($this->firstExisting([
62 $this->id . '_' . $name,
64 ], $name));
65 }
firstExisting(array $lang_vars, string $fallback)
Definition: UI.php:70
loadLanguageModule(string $module)
Definition: UI.php:48

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().

+ 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: