ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

37 {
38 global $DIC;
39
40 $this->lng = $DIC->language();
41 $this->storage = new ilSetting($context->value);
42
43 $this->read();
44 }
ILIAS Setting Class.
global $DIC
Definition: shib_login.php:26
$context
Definition: webdav.php:31

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

+ 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.

69 : void
70 {
71 $this->languages[$a_langkey] = $a_status;
72 }

Referenced by read().

+ Here is the caller graph for this function:

◆ getIliasEditorLanguage()

ilAuthPageEditorSettings::getIliasEditorLanguage ( string  $a_langkey)

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

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 }

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

+ Here is the call graph for this function:

◆ getInstance()

static ilAuthPageEditorSettings::getInstance ( AuthPageEditorContext  $context)
static

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

46 : self
47 {
48 return self::$instances[$context->value] ?? (self::$instances[$context->value] = new self($context));
49 }

References $context.

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

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

+ Here is the caller graph for this function:

◆ isIliasEditorEnabled()

ilAuthPageEditorSettings::isIliasEditorEnabled ( string  $a_langkey)

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

74 : bool
75 {
76 return $this->languages[$a_langkey] ?? false;
77 }

Referenced by getIliasEditorLanguage().

+ Here is the caller graph for this function:

◆ read()

ilAuthPageEditorSettings::read ( )

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

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)

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

Referenced by __construct().

+ 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

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