ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilPersonalDesktopSettingsRepository.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24{
25 protected Setting $settings;
26
27 public function __construct(Setting $settings)
28 {
29 $this->settings = $settings;
30 }
31
32
33 public function ifNotesEnabled(): bool
34 {
35 return !$this->settings->get('disable_notes');
36 }
37
38 public function enableNotes(bool $active = true): void
39 {
40 $this->settings->set('disable_notes', $active ? '0' : '1');
41 }
42
43 public function ifCommentsEnabled(): bool
44 {
45 return !$this->settings->get('disable_comments');
46 }
47
48 public function enableComments(bool $active = true): void
49 {
50 $this->settings->set('disable_comments', $active ? '0' : '1');
51 }
52
53 public function ifAuthorsCanDelete(): bool
54 {
55 return (bool) $this->settings->get('comments_del_user', '0');
56 }
57
58 public function enableAuthorsCanDelete(bool $active = true): void
59 {
60 $this->settings->set('comments_del_user', $active ? '1' : '0');
61 }
62
63 public function ifTutorsCanDelete(): bool
64 {
65 return (bool) $this->settings->get('comments_del_tutor', '1');
66 }
67
68 public function enableTutorsCanDelete(bool $active = true): void
69 {
70 $this->settings->set('comments_del_tutor', $active ? '1' : '0');
71 }
72
73 public function getCommentsNotificationRecipients(): string
74 {
75 return (string) $this->settings->get('comments_noti_recip');
76 }
77
78 public function updateCommentsNotificationRecipients(string $recipients): void
79 {
80 $this->settings->set('comments_noti_recip', $recipients);
81 }
82
83 public function ifLearningHistoryEnabled(): bool
84 {
85 return (bool) $this->settings->get('enable_learning_history');
86 }
87
88 public function enableLearningHistory(bool $active = true): void
89 {
90 $this->settings->set('enable_learning_history', $active ? '1' : '0');
91 }
92
93 public function ifChatViewerEnabled(): bool
94 {
95 return (bool) $this->settings->get('block_activated_chatviewer');
96 }
97
98 public function enableChatViewer(bool $active = true): void
99 {
100 $this->settings->set('block_activated_chatviewer', $active ? '1' : '0');
101 }
102
104 {
105 return (int) $this->settings->get('pd_sys_msg_mode');
106 }
107
108 public function updateSystemMessagePresentation(int $mode): void
109 {
110 $this->settings->set('pd_sys_msg_mode', (string) $mode);
111 }
112
113 public function ifForumDrafts(): bool
114 {
115 return (bool) $this->settings->get('block_activated_pdfrmpostdraft', '0');
116 }
117
118 public function enableForumDrafts(bool $active = true): void
119 {
120 $this->settings->set('block_activated_pdfrmpostdraft', $active ? '1' : '0');
121 }
122}