Skip to content

Commit 9e62d8d

Browse files
authored
Merge branch 'trunk_font_sizes' into trunk_font_size
2 parents ce9152e + 0aa6b8a commit 9e62d8d

2,187 files changed

Lines changed: 140010 additions & 161389 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ virtual-data
5151
captainhook.config.json
5252
captainhook.local.json
5353
.phpunit.result.cache
54+
.php-cs-fixer.cache
5455

5556
# File Delivery
5657
override.php
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace ILIAS\Chatroom\GlobalScreen;
4+
5+
use ilDatePresentation;
6+
use ilDateTime;
7+
use ILIAS\GlobalScreen\Scope\Notification\Provider\AbstractNotificationProvider;
8+
use ILIAS\UI\Component\Symbol\Icon\Standard;
9+
use ilNotificationOSDHandler;
10+
11+
/******************************************************************************
12+
*
13+
* This file is part of ILIAS, a powerful learning management system.
14+
*
15+
* ILIAS is licensed with the GPL-3.0, you should have received a copy
16+
* of said license along with the source code.
17+
*
18+
* If this is not the case or you just want to try ILIAS, you'll find
19+
* us at:
20+
* https://www.ilias.de
21+
* https://github.com/ILIAS-eLearning
22+
*
23+
*****************************************************************************/
24+
class ChatInvitationNotificationProvider extends AbstractNotificationProvider
25+
{
26+
27+
/**
28+
* @inheritDoc
29+
*/
30+
public function getNotifications() : array
31+
{
32+
if (0 === $this->dic->user()->getId() || $this->dic->user()->isAnonymous()) {
33+
return [];
34+
}
35+
36+
$invitations = [];
37+
$latest_time = 0;
38+
foreach (ilNotificationOSDHandler::getNotificationsForUser(
39+
$this->dic->user()->getId(),
40+
true,
41+
0,
42+
'chat_invitation'
43+
) as $osd) {
44+
$invitations[] = $osd;
45+
if ($latest_time < (int) $osd['time_added']) {
46+
$latest_time = (int) $osd['time_added'];
47+
}
48+
}
49+
50+
$this->dic->language()->loadLanguageModule('chatroom');
51+
$notificationItem = $this->dic->ui()->factory()->item()->notification(
52+
$this->dic->language()->txt('chat_invitations'),
53+
$this->dic->ui()->factory()->symbol()->icon()->standard(Standard::CHTA, 'chat_invitations')
54+
->withIsOutlined(true)
55+
)
56+
->withDescription($this->dic->language()->txt('chat_invitation_nc_no_inv'));
57+
58+
if (count($invitations) !== 0) {
59+
foreach ($invitations as $invitation) {
60+
$link = '';
61+
if (count($invitation['data']->links) === 1) {
62+
$link = $this->dic->ui()->renderer()->render(
63+
$this->dic->ui()->factory()->link()->standard(
64+
$invitation['data']->shortDescription,
65+
$invitation['data']->links[0]->getUrl()
66+
)
67+
);
68+
}
69+
$aggregatedItems[] = $this->dic->ui()->factory()->item()->notification(
70+
$invitation['data']->title,
71+
$this->dic->ui()->factory()->symbol()->icon()->standard(Standard::CHTA, 'chat_invitations')
72+
->withIsOutlined(true)
73+
)
74+
->withDescription($link)
75+
->withProperties([
76+
$this->dic->language()->txt('time') => ilDatePresentation::formatDate(
77+
new ilDateTime($osd['time_added'], IL_CAL_UNIX)
78+
)
79+
]);
80+
}
81+
82+
$notificationItem = $this->dic->ui()->factory()->item()->notification(
83+
$this->dic->ui()->factory()->link()->standard($this->dic->language()->txt('chat_invitations'), '#'),
84+
$this->dic->ui()->factory()->symbol()->icon()->standard(Standard::CHTA, 'chat_invitations')
85+
->withIsOutlined(true)
86+
)
87+
->withAggregateNotifications($aggregatedItems)
88+
->withDescription(sprintf($this->dic->language()->txt('chat_invitation_nc_inv_x'), count($aggregatedItems)))
89+
->withProperties([
90+
$this->dic->language()->txt('time') => ilDatePresentation::formatDate(
91+
new ilDateTime($latest_time, IL_CAL_UNIX)
92+
)
93+
]);
94+
} else {
95+
return [];
96+
}
97+
98+
return [
99+
$this->globalScreen()->notifications()->factory()->standardGroup($this->if->identifier('chat_invitation_bucket_group'))
100+
->withTitle('Chat')
101+
->addNotification(
102+
$this->globalScreen()->notifications()->factory()->standard($this->if->identifier('chat_invitation_bucket'))
103+
->withNotificationItem($notificationItem)
104+
->withNewAmount(count($invitations))
105+
)
106+
];
107+
}
108+
}

Modules/Chatroom/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,9 @@ client.cfg:
285285
```json
286286
{
287287
"name": "onscreen",
288-
"enable_osd": false,
289288
"enable_osc": true,
290-
"osd_intervall": 60,
291289
"chat_enabled": true,
292290
"enable_smilies": true,
293-
"play_invitation_sound": false,
294291
"auth": {
295292
"key": "0cdc8989-d5f0-1111-4444-244320d9dabc",
296293
"secret": "f7471a0e-c454-2222-3333-bb0f1b5d4123"

Modules/Chatroom/classes/admingui/class.ilChatroomAdminSmileyGUI.php

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function executeDefault(string $requestedMethod) : void
2424
*/
2525
public function view() : void
2626
{
27-
ilChatroom::checkUserPermissions('read', $this->gui->ref_id);
27+
ilChatroom::checkUserPermissions('read', $this->gui->getRefId());
2828

2929
$this->gui->switchToVisibleMode();
3030

@@ -121,10 +121,10 @@ private static function _insertDefaultValues() : void
121121
*/
122122
public function editSmiliesObject() : void
123123
{
124-
if (!$this->rbacsystem->checkAccess('read', $this->gui->ref_id)) {
124+
if (!$this->rbacsystem->checkAccess('read', $this->gui->getRefId())) {
125125
$this->ilias->raiseError(
126126
$this->ilLng->txt('msg_no_perm_read'),
127-
$this->gui->ilias->error_obj->MESSAGE
127+
$this->ilias->error_obj->MESSAGE
128128
);
129129
}
130130

@@ -143,7 +143,7 @@ public function editSmiliesObject() : void
143143
'Modules/Chatroom'
144144
);
145145
$tpl_smilies->setVariable('SMILEY_TABLE', $table);
146-
$tpl_smilies->setVariable('SMILEY_FORM', $this->form_gui->getHtml());
146+
$tpl_smilies->setVariable('SMILEY_FORM', $this->form_gui->getHTML());
147147

148148
$this->mainTpl->setContent($tpl_smilies->get());
149149
}
@@ -188,7 +188,7 @@ public function initSmiliesForm() : ilPropertyFormGUI
188188
$this->form_gui->addItem($inp);
189189

190190

191-
if ($this->rbacsystem->checkAccess('write', $this->gui->ref_id)) {
191+
if ($this->rbacsystem->checkAccess('write', $this->gui->getRefId())) {
192192
$this->form_gui->addCommandButton(
193193
'smiley-uploadSmileyObject',
194194
$DIC->language()->txt('chatroom_upload_smiley')
@@ -206,7 +206,7 @@ public function showEditSmileyEntryFormObject() : void
206206
{
207207
$this->gui->switchToVisibleMode();
208208

209-
if (!$this->rbacsystem->checkAccess('read', $this->gui->ref_id)) {
209+
if (!$this->rbacsystem->checkAccess('read', $this->gui->getRefId())) {
210210
$this->ilias->raiseError(
211211
$this->ilLng->txt('msg_no_perm_read'),
212212
$this->ilias->error_obj->MESSAGE
@@ -239,13 +239,11 @@ protected function getSmileyFormDataById(int $smileyId) : array
239239
{
240240
$smiley = ilChatroomSmilies::_getSmiley($smileyId);
241241

242-
$form_data = [
242+
return [
243243
'chatroom_smiley_id' => $smiley['smiley_id'],
244244
'chatroom_smiley_keywords' => $smiley['smiley_keywords'],
245245
'chatroom_current_smiley_image_path' => $smiley['smiley_fullpath'],
246246
];
247-
248-
return $form_data;
249247
}
250248

251249
/**
@@ -322,7 +320,7 @@ public function showDeleteSmileyFormObject() : void
322320
{
323321
$this->gui->switchToVisibleMode();
324322

325-
if (!$this->rbacsystem->checkAccess('write', $this->gui->ref_id)) {
323+
if (!$this->rbacsystem->checkAccess('write', $this->gui->getRefId())) {
326324
$this->ilias->raiseError(
327325
$this->ilLng->txt('msg_no_perm_write'),
328326
$this->ilias->error_obj->MESSAGE
@@ -349,7 +347,7 @@ public function showDeleteSmileyFormObject() : void
349347

350348
public function deleteSmileyObject() : void
351349
{
352-
if (!$this->rbacsystem->checkAccess('write', $this->gui->ref_id)) {
350+
if (!$this->rbacsystem->checkAccess('write', $this->gui->getRefId())) {
353351
$this->ilias->raiseError(
354352
$this->ilLng->txt('msg_no_perm_write'),
355353
$this->ilias->error_obj->MESSAGE
@@ -368,7 +366,7 @@ public function deleteSmileyObject() : void
368366

369367
public function updateSmiliesObject() : void
370368
{
371-
if (!$this->rbacsystem->checkAccess('write', $this->gui->ref_id)) {
369+
if (!$this->rbacsystem->checkAccess('write', $this->gui->getRefId())) {
372370
$this->ilias->raiseError(
373371
$this->ilLng->txt('msg_no_perm_write'),
374372
$this->ilias->error_obj->MESSAGE
@@ -434,7 +432,7 @@ public function deleteMultipleObject() : void
434432
{
435433
$this->gui->switchToVisibleMode();
436434

437-
if (!$this->rbacsystem->checkAccess('write', $this->gui->ref_id)) {
435+
if (!$this->rbacsystem->checkAccess('write', $this->gui->getRefId())) {
438436
$this->ilias->raiseError(
439437
$this->ilLng->txt('msg_no_perm_write'),
440438
$this->ilias->error_obj->MESSAGE
@@ -478,7 +476,7 @@ public function deleteMultipleObject() : void
478476

479477
public function confirmedDeleteMultipleObject() : void
480478
{
481-
if (!$this->rbacsystem->checkAccess('write', $this->gui->ref_id)) {
479+
if (!$this->rbacsystem->checkAccess('write', $this->gui->getRefId())) {
482480
$this->ilias->raiseError(
483481
$this->ilLng->txt('msg_no_perm_write'),
484482
$this->ilias->error_obj->MESSAGE
@@ -504,7 +502,7 @@ public function confirmedDeleteMultipleObject() : void
504502

505503
public function uploadSmileyObject() : void
506504
{
507-
if (!$this->rbacsystem->checkAccess('write', $this->gui->ref_id)) {
505+
if (!$this->rbacsystem->checkAccess('write', $this->gui->getRefId())) {
508506
$this->ilias->raiseError(
509507
$this->ilLng->txt('msg_no_perm_write'),
510508
$this->ilias->error_obj->MESSAGE

Modules/Chatroom/classes/admingui/class.ilChatroomAdminViewGUI.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,33 +111,25 @@ public function saveClientSettings() : void
111111

112112
$settings = array(
113113
'name' => (string) $form->getInput('client_name'),
114-
'enable_osd' => (bool) $form->getInput('enable_osd'),
115114
'enable_osc' => (bool) $form->getInput('enable_osc'),
116115
'enable_browser_notifications' => (bool) $form->getInput('enable_browser_notifications'),
117116
'conversation_idle_state_in_minutes' => $convIdleStateTime,
118-
'osd_intervall' => (int) $form->getInput('osd_intervall'),
119117
'chat_enabled' => (bool) $form->getInput('chat_enabled'),
120118
'enable_smilies' => (bool) $form->getInput('enable_smilies'),
121-
'play_invitation_sound' => (bool) $form->getInput('play_invitation_sound'),
122119
'auth' => $form->getInput('auth')
123120
);
124121

125122
if (!$settings['chat_enabled']) {
126123
$settings['enable_osc'] = false;
127124
}
128125

129-
$notificationSettings = new ilSetting('notifications');
130-
$notificationSettings->set('osd_polling_intervall', (string) ((int) $form->getInput('osd_intervall')));
131-
$notificationSettings->set('enable_osd', (string) ((bool) $form->getInput('enable_osd')));
132-
133126
$chatSettings = new ilSetting('chatroom');
134127
$chatSettings->set('chat_enabled', (string) $settings['chat_enabled']);
135128
$chatSettings->set('enable_browser_notifications', (string) $settings['enable_browser_notifications']);
136129
$chatSettings->set('conversation_idle_state_in_minutes', (string) $convIdleStateTime);
137130
$chatSettings->set('enable_osc', (string) $settings['enable_osc']);
138-
$chatSettings->set('play_invitation_sound', (string) ((bool) $form->getInput('play_invitation_sound')));
139131

140-
$adminSettings = new ilChatroomAdmin($this->gui->object->getId());
132+
$adminSettings = new ilChatroomAdmin($this->gui->getObject()->getId());
141133
$adminSettings->saveClientSettings((object) $settings);
142134

143135
$fileHandler = new ilChatroomConfigFileHandler();
@@ -154,7 +146,7 @@ public function clientsettings(ilPropertyFormGUI $form = null) : void
154146
$this->defaultActions();
155147
$this->gui->switchToVisibleMode();
156148

157-
$adminSettings = new ilChatroomAdmin($this->gui->object->getId());
149+
$adminSettings = new ilChatroomAdmin($this->gui->getObject()->getId());
158150
$serverSettings = $adminSettings->loadGeneralSettings();
159151

160152
if ($form === null) {
@@ -167,7 +159,7 @@ public function clientsettings(ilPropertyFormGUI $form = null) : void
167159
$this->checkServerConnection($serverSettings);
168160

169161
$form->setTitle($this->ilLng->txt('general_settings_title'));
170-
if (ilChatroom::checkUserPermissions('write', $this->gui->ref_id, false)) {
162+
if (ilChatroom::checkUserPermissions('write', $this->gui->getRefId(), false)) {
171163
$form->addCommandButton('view-saveClientSettings', $this->ilLng->txt('save'));
172164
} else {
173165
$form->getItemByPostVar('auth')->setIsReadOnly(true);

Modules/Chatroom/classes/class.ilBannedUsersTableGUI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
class ilBannedUsersTableGUI extends ilTable2GUI
1111
{
12-
public function __construct(ilObjChatroomGUI $a_parent_obj, string $a_parent_cmd)
12+
public function __construct(ilChatroomObjectGUI $a_parent_obj, string $a_parent_cmd)
1313
{
1414
$this->setId('banned_users');
1515

0 commit comments

Comments
 (0)