ILIAS  release_8 Revision v8.24
ilTermsOfServiceUserHasLanguageCriterionGUI Class Reference

Class ilTermsOfServiceUserHasLanguageCriterionGUI. More...

+ Inheritance diagram for ilTermsOfServiceUserHasLanguageCriterionGUI:
+ Collaboration diagram for ilTermsOfServiceUserHasLanguageCriterionGUI:

Public Member Functions

 __construct (ilTermsOfServiceUserHasLanguageCriterion $type, ilLanguage $lng)
 
 appendOption (ilRadioGroupInputGUI $group, ilTermsOfServiceCriterionConfig $config)
 
 getConfigByForm (ilPropertyFormGUI $form)
 
 getIdentPresentation ()
 
 getValuePresentation (ilTermsOfServiceCriterionConfig $config, Factory $uiFactory)
 
 appendOption (ilRadioGroupInputGUI $group, ilTermsOfServiceCriterionConfig $config)
 
 getConfigByForm (ilPropertyFormGUI $form)
 
 getIdentPresentation ()
 
 getValuePresentation (ilTermsOfServiceCriterionConfig $config, Factory $uiFactory)
 

Protected Attributes

ilTermsOfServiceUserHasLanguageCriterion $type
 
ilLanguage $lng
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTermsOfServiceUserHasLanguageCriterionGUI::__construct ( ilTermsOfServiceUserHasLanguageCriterion  $type,
ilLanguage  $lng 
)

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

References $lng, $type, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ appendOption()

ilTermsOfServiceUserHasLanguageCriterionGUI::appendOption ( ilRadioGroupInputGUI  $group,
ilTermsOfServiceCriterionConfig  $config 
)

Implements ilTermsOfServiceCriterionTypeGUI.

Definition at line 41 of file class.ilTermsOfServiceUserHasLanguageCriterionGUI.php.

41 : void
42 {
43 $option = new ilRadioOption($this->getIdentPresentation(), $this->type->getTypeIdent());
44 $option->setInfo($this->lng->txt('tos_crit_type_usr_language_info'));
45
46 $languageSelection = new ilSelectInputGUI(
47 $this->lng->txt('language'),
48 $this->type->getTypeIdent() . '_lng'
49 );
50 $languageSelection->setRequired(true);
51
52 $options = [];
53 foreach ($this->lng->getInstalledLanguages() as $lng) {
54 $options[$lng] = $this->lng->txt('meta_l_' . $lng);
55 }
56
57 natcasesort($options);
58
59 $languageSelection->setOptions(['' => $this->lng->txt('please_choose')] + $options);
60 $languageSelection->setValue((string) ($config['lng'] ?? ''));
61
62 $option->addSubItem($languageSelection);
63
64 $group->addOption($option);
65 }
addOption(ilRadioOption $a_option)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a selection list property in a property form.
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85

References $config, $lng, ilRadioGroupInputGUI\addOption(), getIdentPresentation(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getConfigByForm()

ilTermsOfServiceUserHasLanguageCriterionGUI::getConfigByForm ( ilPropertyFormGUI  $form)

Implements ilTermsOfServiceCriterionTypeGUI.

Definition at line 67 of file class.ilTermsOfServiceUserHasLanguageCriterionGUI.php.

68 {
70 'lng' => (string) $form->getInput($this->type->getTypeIdent() . '_lng')
71 ]);
72
73 return $config;
74 }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
Class ilTermsOfServiceCriterionConfig.

References $config, and ilPropertyFormGUI\getInput().

+ Here is the call graph for this function:

◆ getIdentPresentation()

ilTermsOfServiceUserHasLanguageCriterionGUI::getIdentPresentation ( )

Implements ilTermsOfServiceCriterionTypeGUI.

Definition at line 76 of file class.ilTermsOfServiceUserHasLanguageCriterionGUI.php.

76 : string
77 {
78 return $this->lng->txt('tos_crit_type_usr_language');
79 }

References ILIAS\Repository\lng().

Referenced by appendOption().

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

◆ getValuePresentation()

ilTermsOfServiceUserHasLanguageCriterionGUI::getValuePresentation ( ilTermsOfServiceCriterionConfig  $config,
Factory  $uiFactory 
)

Implements ilTermsOfServiceCriterionTypeGUI.

Definition at line 81 of file class.ilTermsOfServiceUserHasLanguageCriterionGUI.php.

81 : Component
82 {
83 $lng = $config['lng'] ?? '';
84
85 if (!is_string($lng) || 2 !== strlen($lng)) {
86 return $uiFactory->legacy('');
87 }
88
89 return $uiFactory->legacy($this->lng->txt('meta_l_' . $lng));
90 }
legacy(string $content)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $config, $lng, ILIAS\UI\Factory\legacy(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilTermsOfServiceUserHasLanguageCriterionGUI::$lng
protected

◆ $type

ilTermsOfServiceUserHasLanguageCriterion ilTermsOfServiceUserHasLanguageCriterionGUI::$type
protected

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

Referenced by __construct().


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