-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule.php
More file actions
84 lines (67 loc) · 1.92 KB
/
Copy pathModule.php
File metadata and controls
84 lines (67 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2025 HumHub GmbH & Co. KG
* @license https://www.humhub.com/licences
*/
namespace humhub\modules\letsMeet;
use humhub\modules\letsMeet\models\Meeting;
use humhub\modules\letsMeet\permissions\ManagePermission;
use humhub\modules\space\models\Space;
use humhub\modules\content\components\ContentContainerActiveRecord;
use humhub\modules\content\components\ContentContainerModule;
use Yii;
class Module extends ContentContainerModule
{
public $resourcesPath = 'resources';
public function getContentContainerTypes()
{
return [
Space::class,
];
}
protected function getAccessRules()
{
return [
[
'permission' => ManagePermission::class,
'actions' => ['*'],
],
];
}
public function disable()
{
foreach (Meeting::find()->all() as $meeting) {
$meeting->hardDelete();
}
parent::disable();
}
public function disableContentContainer(ContentContainerActiveRecord $container)
{
foreach (Meeting::find()->contentContainer($container)->all() as $meet) {
$meet->hardDelete();
}
parent::disableContentContainer($container);
}
public function getPermissions($contentContainer = null)
{
if ($contentContainer) {
return [
new ManagePermission(),
];
}
return [];
}
public function getContentContainerName(ContentContainerActiveRecord $container)
{
return Yii::t('LetsMeetModule.base', 'Let\'s Meet');
}
public function getContentContainerDescription(ContentContainerActiveRecord $container)
{
return Yii::t('LetsMeetModule.base', 'Allows to start Let\'s Meet.');
}
public function getContentClasses(): array
{
return [Meeting::class];
}
}