ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
class.ilAuthPageEditorSettings.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
use
ILIAS\components\Authentication\Pages\AuthPageEditorContext
;
22
23
class
ilAuthPageEditorSettings
24
{
26
private
static
array
$instances
= [];
27
31
private
array
$languages
= [];
32
private
ilSetting
$storage
;
33
private
ilLanguage
$lng
;
34
35
36
private
function
__construct
(
AuthPageEditorContext
$context
)
37
{
38
global
$DIC
;
39
40
$this->
lng
= $DIC->language();
41
$this->storage =
new
ilSetting
($context->value);
42
43
$this->
read
();
44
}
45
46
public
static
function
getInstance
(
AuthPageEditorContext
$context
): self
47
{
48
return
self::$instances[$context->value] ?? (self::$instances[$context->value] =
new
self
(
$context
));
49
}
50
51
private
function
getStorage
():
ilSetting
52
{
53
return
$this->storage
;
54
}
55
56
public
function
getIliasEditorLanguage
(
string
$a_langkey): 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
}
68
69
public
function
enableIliasEditor
(
string
$a_langkey,
bool
$a_status): void
70
{
71
$this->languages[$a_langkey] = $a_status;
72
}
73
74
public
function
isIliasEditorEnabled
(
string
$a_langkey): bool
75
{
76
return
$this->languages[$a_langkey] ??
false
;
77
}
78
79
public
function
update
(): void
80
{
81
foreach
($this->languages as $lngkey => $stat) {
82
$this->storage->set($lngkey, (
string
) $stat);
83
}
84
}
85
86
public
function
read
(): void
87
{
88
$this->languages = [];
89
foreach
($this->
lng
->getInstalledLanguages() as $lngkey) {
90
$this->
enableIliasEditor
($lngkey, (
bool
) $this->
getStorage
()->
get
($lngkey,
''
));
91
}
92
}
93
}
ilLanguage
ilAuthPageEditorSettings\isIliasEditorEnabled
isIliasEditorEnabled(string $a_langkey)
Definition:
class.ilAuthPageEditorSettings.php:74
$context
$context
Definition:
webdav.php:31
ILIAS\components\Authentication\Pages\AuthPageEditorContext
AuthPageEditorContext
Definition:
AuthPageEditorContext.php:23
ilAuthPageEditorSettings\__construct
__construct(AuthPageEditorContext $context)
Definition:
class.ilAuthPageEditorSettings.php:36
ilAuthPageEditorSettings
ilAuthPageEditorSettings\enableIliasEditor
enableIliasEditor(string $a_langkey, bool $a_status)
Definition:
class.ilAuthPageEditorSettings.php:69
ilAuthPageEditorSettings\read
read()
Definition:
class.ilAuthPageEditorSettings.php:86
ilAuthPageEditorSettings\$storage
ilSetting $storage
Definition:
class.ilAuthPageEditorSettings.php:32
ilAuthPageEditorSettings\$instances
static array $instances
Definition:
class.ilAuthPageEditorSettings.php:26
ilAuthPageEditorSettings\$lng
ilLanguage $lng
Definition:
class.ilAuthPageEditorSettings.php:33
ILIAS\Repository\lng
lng()
Definition:
trait.GlobalDICDomainServices.php:61
ilAuthPageEditorSettings\update
update()
Definition:
class.ilAuthPageEditorSettings.php:79
$DIC
global $DIC
Definition:
shib_login.php:26
ilAuthPageEditorSettings\getStorage
getStorage()
Definition:
class.ilAuthPageEditorSettings.php:51
ilAuthPageEditorSettings\$languages
array $languages
Definition:
class.ilAuthPageEditorSettings.php:31
ilAuthPageEditorSettings\getIliasEditorLanguage
getIliasEditorLanguage(string $a_langkey)
Definition:
class.ilAuthPageEditorSettings.php:56
ilAuthPageEditorSettings\getInstance
static getInstance(AuthPageEditorContext $context)
Definition:
class.ilAuthPageEditorSettings.php:46
ilSetting
components
ILIAS
Authentication
classes
class.ilAuthPageEditorSettings.php
Generated on Sun Aug 31 2025 23:02:07 for ILIAS by
1.8.13 (using
Doxyfile
)