ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 

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.

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

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  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setInfo(string $a_info)
addOption(ilRadioOption $a_option)
+ Here is the call graph for this function:

◆ getConfigByForm()

ilTermsOfServiceUserHasLanguageCriterionGUI::getConfigByForm ( ilPropertyFormGUI  $form)

Implements ilTermsOfServiceCriterionTypeGUI.

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

References $config, and ilPropertyFormGUI\getInput().

68  {
70  'lng' => (string) $form->getInput($this->type->getTypeIdent() . '_lng')
71  ]);
72 
73  return $config;
74  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
Class ilTermsOfServiceCriterionConfig.
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-...
+ Here is the call graph for this function:

◆ getIdentPresentation()

ilTermsOfServiceUserHasLanguageCriterionGUI::getIdentPresentation ( )

Implements ilTermsOfServiceCriterionTypeGUI.

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

References ILIAS\Repository\lng().

Referenced by appendOption().

76  : string
77  {
78  return $this->lng->txt('tos_crit_type_usr_language');
79  }
+ 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.

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

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  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
legacy(string $content)
description: purpose: > This component is used to wrap an existing ILIAS UI element into a UI compon...
+ 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: