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