-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule.php
More file actions
71 lines (59 loc) · 1.61 KB
/
Module.php
File metadata and controls
71 lines (59 loc) · 1.61 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
<?php
/**
* Banner
* @link https://www.cuzy.app
* @license https://www.cuzy.app/cuzy-license
* @author [Marc FARRE](https://marc.fun)
*/
namespace humhub\modules\banner;
use humhub\components\Event;
use humhub\modules\banner\models\Configuration;
use Yii;
use yii\helpers\Url;
/**
*
* @property-read mixed $configUrl
* @property-read Configuration $configuration
* @property-read string[] $notifications
*/
class Module extends \humhub\components\Module
{
public const EVENT_AFTER_GET_CONFIGURATION = 'afterGetBannerConfiguration';
/**
* @var string defines the icon
*/
public $icon = 'exclamation-triangle';
private ?Configuration $_configuration = null;
public function getConfiguration(): Configuration
{
if ($this->_configuration === null) {
$this->_configuration = new Configuration(['settingsManager' => $this->settings]);
$this->_configuration->loadBySettings();
$evt = new Event(['result' => $this->_configuration]);
Event::trigger($this, static::EVENT_AFTER_GET_CONFIGURATION, $evt);
$this->_configuration = $evt->result;
}
return $this->_configuration;
}
/**
* @inheritdoc
*/
public function getConfigUrl()
{
return Url::to(['/banner/config']);
}
/**
* @inerhitdoc
*/
public function getName()
{
return Yii::t('BannerModule.base', 'Banner');
}
/**
* @inerhitdoc
*/
public function getDescription()
{
return Yii::t('BannerModule.base', 'Add a customizable banner at the top of the screen');
}
}