ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilPersonalDesktopSettingsRepository.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
12{
16 protected $settings;
17
22 {
23 $this->settings = $settings;
24 }
25
26
32 protected function ifNotesEnabled()
33 {
34 return (bool) !$this->settings->get("disable_notes");
35 }
36
42 protected function enableNotes(bool $active = true)
43 {
44 $this->settings->set("disable_notes", (int) !$active);
45 }
46
52 protected function ifCommentsEnabled()
53 {
54 return (bool) !$this->settings->get("disable_comments");
55 }
56
62 protected function enableComments(bool $active = true)
63 {
64 $this->settings->set("disable_comments", (int) !$active);
65 }
66
72 protected function ifAuthorsCanDelete()
73 {
74 return (bool) $this->settings->get("comments_del_user", 0);
75 }
76
82 protected function enableAuthorsCanDelete(bool $active = true)
83 {
84 $this->settings->set("comments_del_user", (int) $active);
85 }
86
92 protected function ifTutorsCanDelete()
93 {
94 return (bool) $this->settings->get("comments_del_tutor", 1);
95 }
96
102 protected function enableTutorsCanDelete(bool $active = true)
103 {
104 $this->settings->set("comments_del_tutor", (int) $active);
105 }
106
113 {
114 return (string) $this->settings->get("comments_noti_recip");
115 }
116
122 protected function updateCommentsNotificationRecipients(string $recipients)
123 {
124 $this->settings->set("comments_noti_recip", $recipients);
125 }
126
132 protected function ifLearningHistoryEnabled()
133 {
134 return (bool) $this->settings->get("enable_learning_history");
135 }
136
142 protected function enableLearningHistory(bool $active = true)
143 {
144 $this->settings->set("enable_learning_history", (int) $active);
145 }
146
152 protected function ifChatViewerEnabled()
153 {
154 return (bool) $this->settings->get("block_activated_chatviewer");
155 }
156
162 protected function enableChatViewer(bool $active = true)
163 {
164 $this->settings->set("block_activated_chatviewer", (int) $active);
165 }
166
172 protected function getSystemMessagePresentation()
173 {
174 return (int) $this->settings->get("pd_sys_msg_mode");
175 }
176
182 protected function updateSystemMessagePresentation(int $mode)
183 {
184 $this->settings->set("pd_sys_msg_mode", $mode);
185 }
186
192 protected function ifForumDrafts()
193 {
194 return (bool) $this->settings->get('block_activated_pdfrmpostdraft', 0);
195 }
196
202 protected function enableForumDrafts(bool $active = true)
203 {
204 $this->settings->set("block_activated_pdfrmpostdraft", (int) $active);
205 }
206}
An exception for terminatinating execution or to throw for unit testing.
enableAuthorsCanDelete(bool $active=true)
Enable authors delete their comments.
getCommentsNotificationRecipients()
Get recipients of comments notification.
enableLearningHistory(bool $active=true)
Enable learning history.
updateCommentsNotificationRecipients(string $recipients)
Update recipients of comments notification.
enableForumDrafts(bool $active=true)
Enable forum draft block.
enableTutorsCanDelete(bool $active=true)
Enable tutors delete comments of others.
ifTutorsCanDelete()
Can tutors delete comments of others.
updateSystemMessagePresentation(int $mode)
Update system message presentation.
ILIAS Setting Class.
settings()
Definition: settings.php:2