ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilAccessibilityUserHasLanguageCriterion.php
Go to the documentation of this file.
1<?php
2
23{
24 public function getTypeIdent(): string
25 {
26 return 'usr_language';
27 }
28
29 public function hasUniqueNature(): bool
30 {
31 return true;
32 }
33
34 public function evaluate(ilObjUser $user, ilAccessibilityCriterionConfig $config): bool
35 {
36 $lng = $config['lng'] ?? '';
37
38 if (!is_string($lng) || 2 !== strlen($lng)) {
39 return false;
40 }
41
42 $result = strtolower($lng) === strtolower($user->getLanguage());
43
44 return $result;
45 }
46
48 {
50 }
51}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
hasUniqueNature()
Returns whether or not a criterion is unique by it's nature.
evaluate(ilObjUser $user, ilAccessibilityCriterionConfig $config)
language handling
User class.
Interface ilAccessibilityCriterionTypeGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $lng
Definition: privfeed.php:31