ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilPersonalDesktopSettingsRepository.php
Go to the documentation of this file.
1 <?php
2 
20 {
21  protected \ILIAS\Administration\Setting $settings;
22 
23  public function __construct(\ILIAS\Administration\Setting $settings)
24  {
25  $this->settings = $settings;
26  }
27 
28 
29  // Notes enabled?
30  public function ifNotesEnabled(): bool
31  {
32  return !$this->settings->get("disable_notes");
33  }
34 
35  public function enableNotes(bool $active = true): void
36  {
37  $this->settings->set("disable_notes", (int) !$active);
38  }
39 
40  // Comments enabled?
41  public function ifCommentsEnabled(): bool
42  {
43  return !$this->settings->get("disable_comments");
44  }
45 
46  public function enableComments(bool $active = true): void
47  {
48  $this->settings->set("disable_comments", (int) !$active);
49  }
50 
51  // Can authors delete their comments
52  public function ifAuthorsCanDelete(): bool
53  {
54  return (bool) $this->settings->get("comments_del_user", '0');
55  }
56 
57  public function enableAuthorsCanDelete(bool $active = true): void
58  {
59  $this->settings->set("comments_del_user", (int) $active);
60  }
61 
62  // Can tutors delete comments of others
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", (int) $active);
71  }
72 
73  // Get recipients of comments notification
74  public function getCommentsNotificationRecipients(): string
75  {
76  return (string) $this->settings->get("comments_noti_recip");
77  }
78 
79  // Update recipients of comments notification
80  public function updateCommentsNotificationRecipients(string $recipients): void
81  {
82  $this->settings->set("comments_noti_recip", $recipients);
83  }
84 
85  // learning history enabled?
86  public function ifLearningHistoryEnabled(): bool
87  {
88  return (bool) $this->settings->get("enable_learning_history");
89  }
90 
91  public function enableLearningHistory(bool $active = true): void
92  {
93  $this->settings->set("enable_learning_history", (int) $active);
94  }
95 
96  // chat viewer enabled?
97  public function ifChatViewerEnabled(): bool
98  {
99  return (bool) $this->settings->get("block_activated_chatviewer");
100  }
101 
102  public function enableChatViewer(bool $active = true): void
103  {
104  $this->settings->set("block_activated_chatviewer", (int) $active);
105  }
106 
108  {
109  return (int) $this->settings->get("pd_sys_msg_mode");
110  }
111 
112  public function updateSystemMessagePresentation(int $mode): void
113  {
114  $this->settings->set("pd_sys_msg_mode", $mode);
115  }
116 
117  // forum draft block enabled?
118  public function ifForumDrafts(): bool
119  {
120  return (bool) $this->settings->get('block_activated_pdfrmpostdraft', '0');
121  }
122 
123  public function enableForumDrafts(bool $active = true): void
124  {
125  $this->settings->set("block_activated_pdfrmpostdraft", (int) $active);
126  }
127 }
Class ChatMainBarProvider .
__construct(\ILIAS\Administration\Setting $settings)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...