ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
ilDashboardSidePanelSettingsRepository Class Reference
+ Collaboration diagram for ilDashboardSidePanelSettingsRepository:

Public Member Functions

 __construct (protected readonly ilSetting $setting=new ilSetting('dash'))
 
 getValidModules ()
 
 setPositions (array $positions)
 
 getPositions ()
 
 enable (string $mod, bool $active)
 
 isEnabled (string $mod)
 

Data Fields

const CALENDAR = 'cal'
 
const NEWS = 'news'
 
const MAIL = 'mail'
 
const TASKS = 'task'
 

Protected Member Functions

 isValidModule (string $mod)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilDashboardSidePanelSettingsRepository::__construct ( protected readonly ilSetting  $setting = new ilSetting('dash'))

Definition at line 28 of file class.ilDashboardSidePanelSettingsRepository.php.

29 {
30 }

Member Function Documentation

◆ enable()

ilDashboardSidePanelSettingsRepository::enable ( string  $mod,
bool  $active 
)

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

77 : void
78 {
79 if ($this->isValidModule($mod)) {
80 $this->setting->set('enable_' . $mod, $active ? '1' : '0');
81 }
82 }

References isValidModule().

+ Here is the call graph for this function:

◆ getPositions()

ilDashboardSidePanelSettingsRepository::getPositions ( )
Returns
string[]

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

56 : 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 }

References getValidModules().

+ Here is the call graph for this function:

◆ getValidModules()

ilDashboardSidePanelSettingsRepository::getValidModules ( )
final

◆ isEnabled()

ilDashboardSidePanelSettingsRepository::isEnabled ( string  $mod)

Definition at line 84 of file class.ilDashboardSidePanelSettingsRepository.php.

84 : bool
85 {
86 if ($this->isValidModule($mod)) {
87 return (bool) $this->setting->get('enable_' . $mod, '1');
88 }
89 return false;
90 }

References isValidModule().

+ Here is the call graph for this function:

◆ isValidModule()

ilDashboardSidePanelSettingsRepository::isValidModule ( string  $mod)
finalprotected

Definition at line 72 of file class.ilDashboardSidePanelSettingsRepository.php.

72 : bool
73 {
74 return in_array($mod, $this->getValidModules());
75 }

References getValidModules().

Referenced by enable(), and isEnabled().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPositions()

ilDashboardSidePanelSettingsRepository::setPositions ( array  $positions)
Parameters
string[]$positions

Definition at line 48 of file class.ilDashboardSidePanelSettingsRepository.php.

48 : void
49 {
50 $this->setting->set('side_panel_positions', serialize($positions));
51 }

Field Documentation

◆ CALENDAR

const ilDashboardSidePanelSettingsRepository::CALENDAR = 'cal'

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

Referenced by getValidModules().

◆ MAIL

const ilDashboardSidePanelSettingsRepository::MAIL = 'mail'

Definition at line 25 of file class.ilDashboardSidePanelSettingsRepository.php.

Referenced by getValidModules().

◆ NEWS

const ilDashboardSidePanelSettingsRepository::NEWS = 'news'

Definition at line 24 of file class.ilDashboardSidePanelSettingsRepository.php.

Referenced by getValidModules().

◆ TASKS

const ilDashboardSidePanelSettingsRepository::TASKS = 'task'

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

Referenced by getValidModules().


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