ILIAS  release_8 Revision v8.24
class.ilTermsOfServiceUserHasLanguageCriterion.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26{
27 public function getTypeIdent(): string
28 {
29 return 'usr_language';
30 }
31
32 public function hasUniqueNature(): bool
33 {
34 return true;
35 }
36
38 {
39 $lng = $config['lng'] ?? '';
40
41 if (!is_string($lng) || 2 !== strlen($lng) || !is_string($user->getLanguage())) {
42 return false;
43 }
44
45 return strtolower($lng) === strtolower($user->getLanguage());
46 }
47
49 {
51 }
52}
language handling
User class.
Class ilTermsOfServiceCriterionConfig.
hasUniqueNature()
Returns whether or not a criterion is unique by it's nature.
evaluate(ilObjUser $user, ilTermsOfServiceCriterionConfig $config)
Interface ilTermsOfServiceCriterionTypeGUI.
Interface ilTermsOfServiceCriterionType.
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85
$lng