ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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.

References $default_language, and checkLanguageName().

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  }
41  $diff = array_diff($install_local_languages, $install_languages);
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  }
+ 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.

Referenced by __construct().

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

◆ getDefaultLanguage()

ilLanguageSetupConfig::getDefaultLanguage ( )

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

References $default_language.

61  : string
62  {
64  }

◆ getInstallLanguages()

ilLanguageSetupConfig::getInstallLanguages ( )
Returns
string[]

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

References $install_languages.

69  : array
70  {
72  }

◆ getInstallLocalLanguages()

ilLanguageSetupConfig::getInstallLocalLanguages ( )
Returns
string[]

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

References $install_local_languages.

77  : array
78  {
80  }

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 getInstallLanguages().

◆ $install_local_languages

ilLanguageSetupConfig::$install_local_languages
protected

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

Referenced by getInstallLocalLanguages().


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