ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilTermsOfServiceUserHasLanguageCriterionGUI Class Reference

Class ilTermsOfServiceUserHasLanguageCriterionGUI. More...

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

Public Member Functions

 __construct (\ilTermsOfServiceUserHasLanguageCriterion $type, \ilLanguage $lng)
 ilTermsOfServiceUserHasLanguageCriterionGUI constructor. More...
 
 appendOption (\ilRadioGroupInputGUI $group, \ilTermsOfServiceCriterionConfig $config)
 
Parameters
ilRadioGroupInputGUI$option
\ilTermsOfServiceCriterionConfig$config
More...
 
 getConfigByForm (\ilPropertyFormGUI $form)
 
Parameters
ilPropertyFormGUI$form
Returns
\ilTermsOfServiceCriterionConfig
More...
 
 getIdentPresentation ()
 
Returns
string
More...
 
 getValuePresentation (\ilTermsOfServiceCriterionConfig $config, Factory $uiFactory)
 
Parameters
\ilTermsOfServiceCriterionConfig$config
Factory$uiFactory
Returns
Component
More...
 
 appendOption (\ilRadioGroupInputGUI $option, \ilTermsOfServiceCriterionConfig $config)
 
 getConfigByForm (\ilPropertyFormGUI $form)
 
 getIdentPresentation ()
 
 getValuePresentation (\ilTermsOfServiceCriterionConfig $config, Factory $uiFactory)
 

Protected Attributes

 $type
 
 $lng
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ appendOption()

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

Parameters
ilRadioGroupInputGUI$option
\ilTermsOfServiceCriterionConfig$config

Implements ilTermsOfServiceCriterionTypeGUI.

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

36 {
37 $option = new \ilRadioOption($this->getIdentPresentation(), $this->type->getTypeIdent());
38 $option->setInfo($this->lng->txt('tos_crit_type_usr_language_info'));
39
40 $languageSelection = new \ilSelectInputGUI(
41 $this->lng->txt('language'),
42 $this->type->getTypeIdent() . '_lng'
43 );
44 $languageSelection->setRequired(true);
45
46 $options = [];
47 foreach ($this->lng->getInstalledLanguages() as $lng) {
48 $options[$lng] = $this->lng->txt('meta_l_' . $lng);
49 }
50
51 asort($options);
52
53 $languageSelection->setOptions(['' => $this->lng->txt('please_choose')] + $options);
54 $languageSelection->setValue((string) ($config['lng'] ?? ''));
55
56 $option->addSubItem($languageSelection);
57
58 $group->addOption($option);
59 }
$config
Definition: bootstrap.php:15

References $config, $lng, PHPMailer\PHPMailer\$options, ilRadioGroupInputGUI\addOption(), and getIdentPresentation().

+ Here is the call graph for this function:

◆ getConfigByForm()

ilTermsOfServiceUserHasLanguageCriterionGUI::getConfigByForm ( \ilPropertyFormGUI  $form)

Parameters
ilPropertyFormGUI$form
Returns
\ilTermsOfServiceCriterionConfig

Implements ilTermsOfServiceCriterionTypeGUI.

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

65 {
66 $config = new \ilTermsOfServiceCriterionConfig([
67 'lng' => (string) $form->getInput($this->type->getTypeIdent() . '_lng')
68 ]);
69
70 return $config;
71 }
Class ilTermsOfServiceCriterionConfig.
if(isset($_POST['submit'])) $form

References $config, and $form.

◆ getIdentPresentation()

ilTermsOfServiceUserHasLanguageCriterionGUI::getIdentPresentation ( )

Returns
string

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 }

Referenced by appendOption().

+ Here is the caller graph for this function:

◆ getValuePresentation()

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

Parameters
\ilTermsOfServiceCriterionConfig$config
Factory$uiFactory
Returns
Component

Implements ilTermsOfServiceCriterionTypeGUI.

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

84 : Component
85 {
86 $lng = $config['lng'] ?? '';
87
88 if (!is_string($lng) || 2 !== strlen($lng)) {
89 return $uiFactory->legacy('');
90 }
91
92 return $uiFactory->legacy($this->lng->txt('meta_l_' . (string) $lng));
93 }
A component is the most general form of an entity in the UI.
Definition: Component.php:14
legacy($content)

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

+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilTermsOfServiceUserHasLanguageCriterionGUI::$lng
protected

◆ $type

ilTermsOfServiceUserHasLanguageCriterionGUI::$type
protected

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

Referenced by __construct().


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