-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathModule.php
executable file
·51 lines (43 loc) · 1.08 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
<?php
namespace humhub\modules\reportcontent;
use humhub\modules\reportcontent\models\Configuration;
use yii\helpers\Url;
/**
* ReportContentModule is responsible for allowing useres to report posts.
*
* @author Marjana Pesic
*
*/
class Module extends \humhub\components\Module
{
/**
* @inheritdoc
*/
public $resourcesPath = 'resources';
private ?Configuration $_configuration = null;
/**
* @inheritdoc
*/
public function disable()
{
foreach (models\ReportContent::find()->all() as $reportContent) {
$reportContent->delete();
}
parent::disable();
}
public function getConfigUrl()
{
return Url::to(['/reportcontent/admin/configuration']);
}
/**
* @inheritdoc
*/
public function getConfiguration(): Configuration
{
if ($this->_configuration === null) {
$this->_configuration = new Configuration(['settingsManager' => $this->settings]);
$this->_configuration->loadBySettings();
}
return $this->_configuration;
}
}