-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathModule.php
More file actions
executable file
·46 lines (39 loc) · 1 KB
/
Module.php
File metadata and controls
executable file
·46 lines (39 loc) · 1 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
<?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
{
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;
}
}