ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilDashboardSidePanelSettingsRepository Class Reference
+ Collaboration diagram for ilDashboardSidePanelSettingsRepository:

Public Member Functions

 __construct (?ilSetting $dashboard_settings=null)
 
 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)
 

Protected Attributes

ilSetting $setting
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilDashboardSidePanelSettingsRepository::__construct ( ?ilSetting  $dashboard_settings = null)

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

31 {
32 $this->setting = is_null($dashboard_settings)
33 ? new ilSetting('dash')
34 : $dashboard_settings;
35 }
ILIAS Setting Class.

Member Function Documentation

◆ enable()

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

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

82 : void
83 {
84 if ($this->isValidModule($mod)) {
85 $this->setting->set('enable_' . $mod, $active ? '1' : '0');
86 }
87 }

References isValidModule().

+ Here is the call graph for this function:

◆ getPositions()

ilDashboardSidePanelSettingsRepository::getPositions ( )
Returns
string[]

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

61 : array
62 {
63 $positions = $this->setting->get('side_panel_positions', '');
64 $modules = [];
65 if ($positions !== '') {
66 $modules = unserialize($positions, ['allowed_classes' => false]);
67 }
68 $all_modules = $this->getValidModules();
69 foreach ($all_modules as $mod) {
70 if (!in_array($mod, $modules, true)) {
71 $modules[] = $mod;
72 }
73 }
74 return $modules;
75 }

References getValidModules().

+ Here is the call graph for this function:

◆ getValidModules()

ilDashboardSidePanelSettingsRepository::getValidModules ( )

◆ isEnabled()

ilDashboardSidePanelSettingsRepository::isEnabled ( string  $mod)

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

89 : bool
90 {
91 if ($this->isValidModule($mod)) {
92 return (bool) $this->setting->get('enable_' . $mod, '1');
93 }
94 return false;
95 }

References isValidModule().

+ Here is the call graph for this function:

◆ isValidModule()

ilDashboardSidePanelSettingsRepository::isValidModule ( string  $mod)
protected

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

77 : bool
78 {
79 return in_array($mod, $this->getValidModules());
80 }

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 53 of file class.ilDashboardSidePanelSettingsRepository.php.

53 : void
54 {
55 $this->setting->set('side_panel_positions', serialize($positions));
56 }

Field Documentation

◆ $setting

ilSetting ilDashboardSidePanelSettingsRepository::$setting
protected

◆ 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: