ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilAccessibilityUserHasLanguageCriterion.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
3
8{
12 public function getTypeIdent() : string
13 {
14 return 'usr_language';
15 }
16
20 public function hasUniqueNature() : bool
21 {
22 return true;
23 }
24
29 {
30 $lng = $config['lng'] ?? '';
31
32 if (!is_string($lng) || 2 !== strlen($lng)) {
33 return false;
34 }
35
36 $result = strtolower($lng) === strtolower($user->getLanguage());
37
38 return $result;
39 }
40
45 {
47 }
48}
$result
An exception for terminatinating execution or to throw for unit testing.
Class ilAccessibilityCriterionConfig.
hasUniqueNature()
Returns whether or not a criterion is unique by it's nature.Example: "User Language"....
evaluate(ilObjUser $user, ilAccessibilityCriterionConfig $config)
bool
getTypeIdent()
Returns a unique id of the criterion type.string
language handling
getLanguage()
returns a 2char-language-string @access public
Interface ilAccessibilityCriterionTypeGUI.
Interface ilAccessibilityCriterionType.
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
$lng