ILIAS  release_7 Revision v7.30-3-g800a261c036
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)
 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...
 

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.

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

35  : void
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  }
This class represents an option in a radio group.
setInfo($a_info)
Set Info.
addOption($a_option)
Add Option.
+ 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.

References $config, and ilPropertyFormGUI\getInput().

65  {
67  'lng' => (string) $form->getInput($this->type->getTypeIdent() . '_lng')
68  ]);
69 
70  return $config;
71  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
Class ilTermsOfServiceCriterionConfig.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
+ Here is the call graph for this function:

◆ getIdentPresentation()

ilTermsOfServiceUserHasLanguageCriterionGUI::getIdentPresentation ( )

Returns
string

Implements ilTermsOfServiceCriterionTypeGUI.

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

Referenced by appendOption().

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

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

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  }
legacy($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

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: