-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule.php
More file actions
65 lines (56 loc) · 1.43 KB
/
Module.php
File metadata and controls
65 lines (56 loc) · 1.43 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
<?php
/**
* Rocket
* @link https://www.cuzy.app
* @license https://www.cuzy.app/cuzy-license
* @author [Marc FARRE](https://marc.fun)
*/
namespace humhub\modules\rocket;
use humhub\modules\admin\permissions\ManageSettings;
use humhub\modules\content\components\ContentContainerActiveRecord;
use humhub\modules\content\components\ContentContainerModule;
use humhub\modules\space\models\Space;
use Yii;
use yii\helpers\Url;
class Module extends ContentContainerModule
{
/**
* @var string defines the icon
*/
public $icon = 'commenting-o';
/**
* @inheritdoc
*/
public function getContentContainerTypes()
{
return
Yii::$app->request->isConsoleRequest
|| (
!Yii::$app->user->isGuest
&& Yii::$app->user->can(ManageSettings::class)
)
? [Space::class]
: [];
}
public function getName()
{
return 'Rocket.chat';
}
public function getDescription()
{
return Yii::t('RocketModule.config', '');
}
public function getConfigUrl()
{
return Url::to(['/rocket/config']);
}
/**
* @inheritdoc
*/
public function getContentContainerConfigUrl(ContentContainerActiveRecord $container)
{
return Yii::$app->user->can(ManageSettings::class)
? $container->createUrl('/rocket/container-config')
: '';
}
}