38 $option->setInfo($this->lng->txt(
'tos_crit_type_usr_language_info'));
40 $languageSelection = new \ilSelectInputGUI(
41 $this->lng->txt(
'language'),
42 $this->type->getTypeIdent() .
'_lng'
44 $languageSelection->setRequired(
true);
47 foreach ($this->lng->getInstalledLanguages() as
$lng) {
53 $languageSelection->setOptions([
'' => $this->lng->txt(
'please_choose')] +
$options);
54 $languageSelection->setValue((
string) (
$config[
'lng'] ??
''));
56 $option->addSubItem($languageSelection);
66 $config = new \ilTermsOfServiceCriterionConfig([
67 'lng' => (
string)
$form->getInput($this->type->getTypeIdent() .
'_lng')
78 return $this->lng->txt(
'tos_crit_type_usr_language');
88 if (!is_string(
$lng) || 2 !== strlen(
$lng)) {
89 return $uiFactory->
legacy(
'');
92 return $uiFactory->
legacy($this->lng->txt(
'meta_l_' . (
string)
$lng));
An exception for terminatinating execution or to throw for unit testing.
Class ilTermsOfServiceCriterionConfig.
Class ilTermsOfServiceUserHasLanguageCriterionGUI.
__construct(\ilTermsOfServiceUserHasLanguageCriterion $type, \ilLanguage $lng)
ilTermsOfServiceUserHasLanguageCriterionGUI constructor.
appendOption(\ilRadioGroupInputGUI $group, \ilTermsOfServiceCriterionConfig $config)
getConfigByForm(\ilPropertyFormGUI $form)
\ilTermsOfServiceCriterionConfig
getValuePresentation(\ilTermsOfServiceCriterionConfig $config, Factory $uiFactory)
Component
getIdentPresentation()
string
Class ilTermsOfServiceUserHasLanguageCriterion.
A component is the most general form of an entity in the UI.
This is how the factory for UI elements looks.
Interface ilTermsOfServiceCriterionTypeGUI.
if(isset($_POST['submit'])) $form