-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModule.php
114 lines (107 loc) · 3.2 KB
/
Module.php
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
namespace humhub\modules\gamertag;
use Yii;
use yii\helpers\Url;
use humhub\modules\user\models\User;
use humhub\modules\ui\icon\widgets\Icon;
use humhub\components\Module as BaseModule;
use humhub\modules\content\components\ContentContainerActiveRecord;
/**
* GamerTag Module Definition
*/
class Module extends BaseModule
{
public function getConfigUrl()
{
return Url::to(['/gamertag/admin']);
}
public function disable()
{
foreach (models\GamerTag::find()->all() as $tag) {
$tag->delete();
}
parent::disable();
}
public function enableContentContainer(ContentContainerActiveRecord $container)
{
if ($container instanceof User) {
parent::enableContentContainer($container);
}
}
public function disableContentContainer(ContentContainerActiveRecord $container)
{
if ($container instanceof User) {
parent::disableContentContainer($container);
}
}
public static function getPlatforms()
{
return [
'xbox' => [
'label' => 'Xbox',
'icon' => 'fas fa-xbox',
'color' => '#107C10'
],
'playstation' => [
'label' => 'PlayStation',
'icon' => 'fas fa-playstation',
'color' => '#003791'
],
'nintendo' => [
'label' => 'Nintendo',
'icon' => 'fas fa-gamepad',
'color' => '#E60012'
],
'steam' => [
'label' => 'Steam',
'icon' => 'fab fa-steam',
'color' => '#171A21'
],
'epic' => [
'label' => 'Epic Games',
'icon' => 'fas fa-store',
'color' => '#2F2D2E'
],
'ea' => [
'label' => 'EA',
'icon' => 'fas fa-gamepad',
'color' => '#FF4747'
],
'battlenet' => [
'label' => 'Battle.net',
'icon' => 'fas fa-network-wired',
'color' => '#00AEFF'
],
'ubisoft' => [
'label' => 'Ubisoft',
'icon' => 'fas fa-gamepad',
'color' => '#0070FF'
],
'gog' => [
'label' => 'GOG',
'icon' => 'fas fa-gamepad',
'color' => '#5D2E8C'
],
'riot' => [
'label' => 'Riot Games',
'icon' => 'fas fa-bolt',
'color' => '#D13639'
],
'discord' => [
'label' => 'Discord',
'icon' => 'fab fa-discord',
'color' => '#5865F2'
],
'minecraft' => [
'label' => 'Minecraft',
'icon' => 'fas fa-cube',
'color' => '#62B47A'
],
'other' => [
'label' => 'Other',
'icon' => 'fas fa-gamepad',
'color' => '#777777'
]
];
}
}