ILIAS
trunk Revision v12.0_alpha-1227-g7ff6d300864
◀ ilDoc Overview
class.ilDashboardSidePanelSettingsRepository.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
class
ilDashboardSidePanelSettingsRepository
22
{
23
public
const
CALENDAR
=
'cal'
;
24
public
const
NEWS
=
'news'
;
25
public
const
MAIL
=
'mail'
;
26
public
const
TASKS
=
'task'
;
27
28
public
function
__construct
(
protected
readonly
ilSetting
$setting =
new
ilSetting
(
'dash'
))
29
{
30
}
31
35
final
public
function
getValidModules
(): array
36
{
37
return
[
38
self::TASKS
,
39
self::CALENDAR
,
40
self::NEWS
,
41
self::MAIL
,
42
];
43
}
44
48
public
function
setPositions
(array $positions): void
49
{
50
$this->setting->set(
'side_panel_positions'
, serialize($positions));
51
}
52
56
public
function
getPositions
(): array
57
{
58
$positions = $this->setting->get(
'side_panel_positions'
,
''
);
59
$modules = [];
60
if
($positions !==
''
) {
61
$modules = unserialize($positions, [
'allowed_classes'
=>
false
]);
62
}
63
$all_modules = $this->
getValidModules
();
64
foreach
($all_modules as $mod) {
65
if
(!in_array($mod, $modules,
true
)) {
66
$modules[] = $mod;
67
}
68
}
69
return
$modules;
70
}
71
72
final
protected
function
isValidModule
(
string
$mod): bool
73
{
74
return
in_array($mod, $this->
getValidModules
());
75
}
76
77
public
function
enable
(
string
$mod,
bool
$active): void
78
{
79
if
($this->
isValidModule
($mod)) {
80
$this->setting->set(
'enable_'
. $mod, $active ?
'1'
:
'0'
);
81
}
82
}
83
84
public
function
isEnabled
(
string
$mod): bool
85
{
86
if
($this->
isValidModule
($mod)) {
87
return
(
bool
) $this->setting->get(
'enable_'
. $mod,
'1'
);
88
}
89
return
false
;
90
}
91
}
ilDashboardSidePanelSettingsRepository
Definition:
class.ilDashboardSidePanelSettingsRepository.php:22
ilDashboardSidePanelSettingsRepository\__construct
__construct(protected readonly ilSetting $setting=new ilSetting('dash'))
Definition:
class.ilDashboardSidePanelSettingsRepository.php:28
ilDashboardSidePanelSettingsRepository\TASKS
const TASKS
Definition:
class.ilDashboardSidePanelSettingsRepository.php:26
ilDashboardSidePanelSettingsRepository\isEnabled
isEnabled(string $mod)
Definition:
class.ilDashboardSidePanelSettingsRepository.php:84
ilDashboardSidePanelSettingsRepository\getValidModules
getValidModules()
Definition:
class.ilDashboardSidePanelSettingsRepository.php:35
ilDashboardSidePanelSettingsRepository\getPositions
getPositions()
Definition:
class.ilDashboardSidePanelSettingsRepository.php:56
ilDashboardSidePanelSettingsRepository\enable
enable(string $mod, bool $active)
Definition:
class.ilDashboardSidePanelSettingsRepository.php:77
ilDashboardSidePanelSettingsRepository\isValidModule
isValidModule(string $mod)
Definition:
class.ilDashboardSidePanelSettingsRepository.php:72
ilDashboardSidePanelSettingsRepository\MAIL
const MAIL
Definition:
class.ilDashboardSidePanelSettingsRepository.php:25
ilDashboardSidePanelSettingsRepository\CALENDAR
const CALENDAR
Definition:
class.ilDashboardSidePanelSettingsRepository.php:23
ilDashboardSidePanelSettingsRepository\setPositions
setPositions(array $positions)
Definition:
class.ilDashboardSidePanelSettingsRepository.php:48
ilDashboardSidePanelSettingsRepository\NEWS
const NEWS
Definition:
class.ilDashboardSidePanelSettingsRepository.php:24
ilSetting
ILIAS Setting Class.
Definition:
class.ilSetting.php:27
components
ILIAS
Dashboard
ItemsBlock
classes
class.ilDashboardSidePanelSettingsRepository.php
Generated on Wed Apr 8 2026 23:04:39 for ILIAS by
1.9.4 (using
Doxyfile
)