ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Language\Activities Namespace Reference

Data Structures

class  AddLanguageEntry
 
class  AmbiguousLanguageTitleException
 
class  Failure
 Error of maybePerformAs(): 4xx exceptions answer the call and pass unchanged, anything else is a defect whose message may leak internals, so it is masked and kept as previous. More...
 
class  GrindingInputAccess
 Sole point of coupling to ILIAS\UI\Implementation\Component\Input\*: the public FormInput interfaces expose no way to collect raw request data (withNameFrom(), withInput(), getContent(), getDedicatedName()), and there is no public alternative. More...
 
class  InstallLanguage
 
class  InvalidInputException
 
class  InvalidLanguageFilesException
 A state of the server, not of the call: 409, so Failure::of() passes it on and the GUI can name the languages. More...
 
class  LanguageActivity
 
interface  LanguageSettings
 The settings of the language administration changed by the Activities. More...
 
class  LanguageSettingsLegacyProxy
 No component offers the settings yet, so they are taken from the legacy container on every call. More...
 
class  RemoveLocalLanguageChanges
 
class  RepositoryProvider
 Every legacy and repository access of the runtime language activities. More...
 
class  SetLanguageDetectionEnabled
 
class  SetLanguageTranslationEnabled
 
class  UninstallLanguage
 
class  UpdateLanguage
 

Functions

 inputSectionTitle ()
 
 getInputDescription (FieldFactory $f)
 
 normalizeParameters (array $grind_result)
 
 toLanguageKeyList (mixed $value)
 

Variables

trait DeclaresLanguageKeysOnlyInput
 
trait ParsesLanguageKeyList
 

Function Documentation

◆ getInputDescription()

ILIAS\Language\Activities\getInputDescription ( FieldFactory  $f)

Definition at line 32 of file DeclaresLanguageKeysOnlyInput.php.

32 : FormInput
33 {
34 $language_keys = $f->text(
35 'Language keys',
36 'Comma-separated list of language keys, e.g. de, fr, it.'
37 )->withRequired(true)->withDedicatedName('language_keys');
38
39 return $f->section([
40 'language_keys' => $language_keys,
41 ], $this->inputSectionTitle());
42 }
This describes inputs that can be used in forms.
Definition: FormInput.php:33

References Vendor\Package\$f, and ILIAS\Language\Activities\inputSectionTitle().

Referenced by ILIAS\Language\Tests\Activities\AddLanguageEntryTest\testSubclassOverridingGetInputDescriptionWithThePlainInterfaceSignatureDoesNotTriggerAFatalError().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ inputSectionTitle()

ILIAS\Language\Activities\inputSectionTitle ( )
abstractprotected

Referenced by ILIAS\Language\Activities\getInputDescription().

+ Here is the caller graph for this function:

◆ normalizeParameters()

ILIAS\Language\Activities\normalizeParameters ( array  $grind_result)
protected
Parameters
array{language_keysstring} $grind_result
Returns
array{language_keys: list<string>}

Definition at line 48 of file DeclaresLanguageKeysOnlyInput.php.

48 : array
49 {
50 return [
51 'language_keys' => $this->toLanguageKeyList($grind_result['language_keys']),
52 ];
53 }

References ILIAS\Language\Activities\toLanguageKeyList().

+ Here is the call graph for this function:

◆ toLanguageKeyList()

ILIAS\Language\Activities\toLanguageKeyList ( mixed  $value)
private
Returns
list<string>

Definition at line 29 of file ParsesLanguageKeyList.php.

29 : array
30 {
31 if (!is_string($value) && !is_array($value)) {
32 throw new InvalidInputException('language_keys must be a string or an array of strings.');
33 }
34
35 $values = is_array($value) ? $value : [$value];
36 $language_keys = [];
37
38 foreach ($values as $item) {
39 if (!is_string($item)) {
40 throw new InvalidInputException('language_keys must be a string or an array of strings.');
41 }
42
43 foreach (explode(',', (string) $item) as $language_key) {
44 $language_key = trim($language_key);
45 if ($language_key === '') {
46 continue;
47 }
48
49 if (preg_match(self::LANGUAGE_KEY_FORMAT, $language_key) !== 1) {
50 throw new InvalidInputException(
51 'Invalid language key "' . $language_key . '": a language key must be ' .
52 'exactly two lowercase ASCII letters (e.g. "de", "en", "fr").'
53 );
54 }
55
56 if (!in_array($language_key, $language_keys, true)) {
57 $language_keys[] = $language_key;
58 }
59 }
60 }
61
62 if ($language_keys === []) {
63 throw new InvalidInputException('At least one language key is required.');
64 }
65
66 return $language_keys;
67 }

Referenced by ILIAS\Language\Activities\normalizeParameters(), ILIAS\Language\Activities\InstallLanguage\normalizeParameters(), ILIAS\Language\Tests\Activities\ParsesLanguageKeyListTest\parse(), ILIAS\Language\Activities\InstallLanguage\perform(), ILIAS\Language\Activities\RemoveLocalLanguageChanges\perform(), ILIAS\Language\Activities\UninstallLanguage\perform(), and ILIAS\Language\Activities\UpdateLanguage\perform().

+ Here is the caller graph for this function:

Variable Documentation

◆ DeclaresLanguageKeysOnlyInput

trait ILIAS::Language::Activities\DeclaresLanguageKeysOnlyInput
Initial value:

Definition at line 26 of file DeclaresLanguageKeysOnlyInput.php.

◆ ParsesLanguageKeyList

trait ILIAS::Language::Activities\ParsesLanguageKeyList
Initial value:
{
private const LANGUAGE_KEY_FORMAT = '/^[a-z]{2}\z/'

Definition at line 23 of file ParsesLanguageKeyList.php.

Referenced by ILIAS\Language\Tests\Activities\ParsesLanguageKeyListTest\parse().