ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilAuthPageEditorSettings Class Reference
+ Collaboration diagram for ilAuthPageEditorSettings:

Public Member Functions

 getIliasEditorLanguage (string $a_langkey)
 
 enableIliasEditor (string $a_langkey, bool $a_status)
 
 isIliasEditorEnabled (string $a_langkey)
 
 update ()
 
 read ()
 

Static Public Member Functions

static getInstance (AuthPageEditorContext $context)
 

Private Member Functions

 __construct (AuthPageEditorContext $context)
 
 getStorage ()
 

Private Attributes

array $languages = []
 
ilSetting $storage
 
ilLanguage $lng
 

Static Private Attributes

static array $instances = []
 

Detailed Description

Definition at line 23 of file class.ilAuthPageEditorSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilAuthPageEditorSettings::__construct ( AuthPageEditorContext  $context)
private

Definition at line 36 of file class.ilAuthPageEditorSettings.php.

References $DIC, ILIAS\Repository\lng(), and read().

37  {
38  global $DIC;
39 
40  $this->lng = $DIC->language();
41  $this->storage = new ilSetting($context->value);
42 
43  $this->read();
44  }
$context
Definition: webdav.php:31
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ enableIliasEditor()

ilAuthPageEditorSettings::enableIliasEditor ( string  $a_langkey,
bool  $a_status 
)

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

Referenced by read().

69  : void
70  {
71  $this->languages[$a_langkey] = $a_status;
72  }
+ Here is the caller graph for this function:

◆ getIliasEditorLanguage()

ilAuthPageEditorSettings::getIliasEditorLanguage ( string  $a_langkey)

Definition at line 56 of file class.ilAuthPageEditorSettings.php.

References isIliasEditorEnabled(), and ILIAS\Repository\lng().

56  : string
57  {
58  if ($this->isIliasEditorEnabled($a_langkey)) {
59  return $a_langkey;
60  }
61 
62  if ($this->isIliasEditorEnabled($this->lng->getDefaultLanguage())) {
63  return $this->lng->getDefaultLanguage();
64  }
65 
66  return '';
67  }
+ Here is the call graph for this function:

◆ getInstance()

static ilAuthPageEditorSettings::getInstance ( AuthPageEditorContext  $context)
static

Definition at line 46 of file class.ilAuthPageEditorSettings.php.

References $context.

Referenced by ilAuthPageEditorGUI\activate(), ilAuthPageEditorGUI\deactivate(), ilStartUpGUI\getAuthPageEditorHtml(), and ILIAS\components\Authentication\Pages\AuthPageLanguagesOverviewTable\initRecords().

46  : self
47  {
48  return self::$instances[$context->value] ?? (self::$instances[$context->value] = new self($context));
49  }
$context
Definition: webdav.php:31
+ Here is the caller graph for this function:

◆ getStorage()

ilAuthPageEditorSettings::getStorage ( )
private

Definition at line 51 of file class.ilAuthPageEditorSettings.php.

References $storage.

Referenced by read().

51  : ilSetting
52  {
53  return $this->storage;
54  }
+ Here is the caller graph for this function:

◆ isIliasEditorEnabled()

ilAuthPageEditorSettings::isIliasEditorEnabled ( string  $a_langkey)

Definition at line 74 of file class.ilAuthPageEditorSettings.php.

Referenced by getIliasEditorLanguage().

74  : bool
75  {
76  return $this->languages[$a_langkey] ?? false;
77  }
+ Here is the caller graph for this function:

◆ read()

ilAuthPageEditorSettings::read ( )

Definition at line 86 of file class.ilAuthPageEditorSettings.php.

References enableIliasEditor(), getStorage(), and ILIAS\Repository\lng().

Referenced by __construct().

86  : void
87  {
88  $this->languages = [];
89  foreach ($this->lng->getInstalledLanguages() as $lngkey) {
90  $this->enableIliasEditor($lngkey, (bool) $this->getStorage()->get($lngkey, ''));
91  }
92  }
enableIliasEditor(string $a_langkey, bool $a_status)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilAuthPageEditorSettings::update ( )

Definition at line 79 of file class.ilAuthPageEditorSettings.php.

79  : void
80  {
81  foreach ($this->languages as $lngkey => $stat) {
82  $this->storage->set($lngkey, (string) $stat);
83  }
84  }

Field Documentation

◆ $instances

array ilAuthPageEditorSettings::$instances = []
staticprivate

Definition at line 26 of file class.ilAuthPageEditorSettings.php.

◆ $languages

array ilAuthPageEditorSettings::$languages = []
private

Definition at line 31 of file class.ilAuthPageEditorSettings.php.

◆ $lng

ilLanguage ilAuthPageEditorSettings::$lng
private

Definition at line 33 of file class.ilAuthPageEditorSettings.php.

◆ $storage

ilSetting ilAuthPageEditorSettings::$storage
private

Definition at line 32 of file class.ilAuthPageEditorSettings.php.

Referenced by getStorage().


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