ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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  {
46  return new ilAccessibilityUserHasLanguageCriterionGUI($this, $lng);
47  }
48 }
$result
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
hasUniqueNature()
Returns whether or not a criterion is unique by it&#39;s nature.Example: "User Language". A user account can only have one profile language . bool
ui(ilLanguage $lng)
ilAccessibilityCriterionTypeGUI
getTypeIdent()
Returns a unique id of the criterion type.string
Class ilAccessibilityCriterionConfig.
$lng
Interface ilAccessibilityCriterionType.
language handling
evaluate(ilObjUser $user, ilAccessibilityCriterionConfig $config)
bool
Interface ilAccessibilityCriterionTypeGUI.
getLanguage()
returns a 2char-language-string public