ILIAS  release_7 Revision v7.30-3-g800a261c036
ilLanguageSetupConfig Class Reference
+ Inheritance diagram for ilLanguageSetupConfig:
+ Collaboration diagram for ilLanguageSetupConfig:

Public Member Functions

 __construct (string $default_language, array $install_languages, array $install_local_languages)
 
 getDefaultLanguage ()
 
 getInstallLanguages ()
 
 getInstallLocalLanguages ()
 

Protected Member Functions

 checkLanguageName (string $l)
 

Protected Attributes

 $default_language
 
 $install_languages
 
 $install_local_languages
 

Detailed Description

Definition at line 7 of file class.ilLanguageSetupConfig.php.

Constructor & Destructor Documentation

◆ __construct()

ilLanguageSetupConfig::__construct ( string  $default_language,
array  $install_languages,
array  $install_local_languages 
)

Definition at line 24 of file class.ilLanguageSetupConfig.php.

28 {
30 foreach ($install_languages as $l) {
31 $this->checkLanguageName($l);
32 }
33 foreach ($install_local_languages as $l) {
34 $this->checkLanguageName($l);
35 }
36 if (!in_array($default_language, $install_languages)) {
37 throw new \InvalidArgumentException(
38 "Default language '$default_language' is not in the languages to be installed."
39 );
40 }
42 if (count($diff) > 0) {
43 throw new \InvalidArgumentException(
44 "Local languages " . implode(", ", $diff) . " are not in the languages to be installed."
45 );
46 }
47 $this->default_language = $default_language;
48 $this->install_languages = array_values($install_languages);
49 $this->install_local_languages = array_values($install_local_languages);
50 }

References $default_language, $install_languages, $install_local_languages, and checkLanguageName().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkLanguageName()

ilLanguageSetupConfig::checkLanguageName ( string  $l)
protected

Definition at line 52 of file class.ilLanguageSetupConfig.php.

52 : void
53 {
54 if (!strlen($l) == 2) {
55 throw new \InvalidArgumentException(
56 "'$l' is not a valid language id."
57 );
58 }
59 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ getDefaultLanguage()

ilLanguageSetupConfig::getDefaultLanguage ( )

Definition at line 61 of file class.ilLanguageSetupConfig.php.

61 : string
62 {
64 }

References $default_language.

◆ getInstallLanguages()

ilLanguageSetupConfig::getInstallLanguages ( )
Returns
string[]

Definition at line 69 of file class.ilLanguageSetupConfig.php.

69 : array
70 {
72 }

References $install_languages.

◆ getInstallLocalLanguages()

ilLanguageSetupConfig::getInstallLocalLanguages ( )
Returns
string[]

Definition at line 77 of file class.ilLanguageSetupConfig.php.

77 : array
78 {
80 }

References $install_local_languages.

Field Documentation

◆ $default_language

ilLanguageSetupConfig::$default_language
protected

Definition at line 12 of file class.ilLanguageSetupConfig.php.

Referenced by __construct(), and getDefaultLanguage().

◆ $install_languages

ilLanguageSetupConfig::$install_languages
protected

Definition at line 17 of file class.ilLanguageSetupConfig.php.

Referenced by __construct(), and getInstallLanguages().

◆ $install_local_languages

ilLanguageSetupConfig::$install_local_languages
protected

Definition at line 22 of file class.ilLanguageSetupConfig.php.

Referenced by __construct(), and getInstallLocalLanguages().


The documentation for this class was generated from the following file: