-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathModule.php
35 lines (28 loc) · 935 Bytes
/
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
<?php
namespace humhub\modules\darkMode;
use humhub\modules\darkMode\assets\DarkStyleAsset;
use yii\helpers\Url;
use Yii;
class Module extends \humhub\components\Module {
public $resourcesPath = 'resources';
// Translatable Module Name
public function getName() {
return Yii::t('DarkModeModule.admin', 'Dark Mode');
}
// Translatable Module Description
public function getDescription() {
return Yii::t('DarkModeModule.admin', 'Adds a Dark Mode to HumHub');
}
// Link to configuration page
public function getConfigUrl() {
return Url::to(['/dark-mode/admin']);
}
// Remove cached settings on deactivation
public function disable(): void
{
Yii::$app->cache->delete(DarkStyleAsset::PATH_CACHE);
Yii::$app->cache->delete(DarkStyleAsset::FILENAME_CACHE);
// Don't forget to call this!!
parent::disable();
}
}