1 <?php declare(strict_types=1);
44 $option->
setInfo($this->lng->txt(
'tos_crit_type_usr_country_info'));
47 $this->lng->txt(
'country'),
48 $this->type->getTypeIdent() .
'_country' 50 $countrySelection->setRequired(
true);
53 foreach ($this->countryCodes as $country) {
54 $options[strtolower($country)] = $this->lng->txt(
'meta_c_' . strtoupper($country));
58 $countrySelection->setOptions([
'' => $this->lng->txt(
'please_choose')] + $options);
59 $countrySelection->setValue((
string) ($config[
'country'] ??
''));
61 $option->addSubItem($countrySelection);
72 'country' => (
string) $form->
getInput($this->type->getTypeIdent() .
'_country')
83 return $this->lng->txt(
'tos_crit_type_usr_country');
91 $country = $config[
'country'] ??
'';
93 if (!is_string($country) || 2 !== strlen($country)) {
94 return $uiFactory->
legacy(
'');
97 return $uiFactory->
legacy($this->lng->txt(
'meta_c_' . strtoupper((
string) $country)));
This class represents an option in a radio group.
Interface ilTermsOfServiceCriterionTypeGUI.
getIdentPresentation()
string
setInfo($a_info)
Set Info.
Class ilTermsOfServiceCriterionConfig.
This is how the factory for UI elements looks.
getConfigByForm(ilPropertyFormGUI $form)
ilTermsOfServiceCriterionConfig
getValuePresentation(ilTermsOfServiceCriterionConfig $config, Factory $uiFactory)
Component
legacy($content)
description: purpose: > This component is used to wrap an existing ILIAS UI element into a UI compon...
Class ilTermsOfServiceUserHasCountryCriterion.
appendOption(ilRadioGroupInputGUI $group, ilTermsOfServiceCriterionConfig $config)
__construct(ilTermsOfServiceUserHasCountryCriterion $type, ilLanguage $lng, array $countryCodes)
ilTermsOfServiceUserHasLanguageCriterionGUI constructor.
Class ilTermsOfServiceUserHasCountryCriterionGUI.