-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathModule.php
More file actions
76 lines (62 loc) · 1.46 KB
/
Module.php
File metadata and controls
76 lines (62 loc) · 1.46 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
<?php
/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
* @license https://www.humhub.com/licences
*/
namespace humhub\modules\drawio;
use humhub\modules\space\models\Space;
use humhub\modules\content\components\ContentContainerModule;
use humhub\modules\content\components\ContentContainerActiveRecord;
use Yii;
use yii\helpers\Url;
/**
* File Module
*
* @since 0.5
*/
class Module extends ContentContainerModule
{
public $resourcesPath = 'resources';
public function getContentContainerTypes()
{
return [
Space::class,
];
}
public function disable()
{
parent::disable();
}
public function getContentContainerDescription(ContentContainerActiveRecord $container)
{
if ($container instanceof Space) {
return Yii::t('DrawioModule.base', 'View GLTF file');
}
}
public function disableContentContainer(ContentContainerActiveRecord $container)
{
parent::disableContentContainer($container);
}
/**
* @inheritdoc
*/
public function getConfigUrl()
{
return Url::to([
'/drawio/admin'
]);
}
public function getServerUrl()
{
$url = $this->settings->get('serverUrl');
if (empty($url)) {
return 'https://draw.io';
}
return $url;
}
public function getExtensions()
{
return ['xml', 'drawio'];
}
}