generated from GreenMeteor/humhub-template-module
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Events.php
42 lines (38 loc) · 1.17 KB
/
Events.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
<?php
namespace humhub\humhub\modules\ripfelli;
use Yii;
use yii\helpers\Url;
class Events
{
/**
* Defines what to do when the top menu is initialized.
*
* @param $event
*/
public static function onTopMenuInit($event)
{
$event->sender->addItem([
'label' => 'RIP Felli',
'icon' => '<i class="fas fa-cross"></i>',
'url' => Url::to(['/ripfelli/index']),
'sortOrder' => 99999,
'isActive' => (Yii::$app->controller->module && Yii::$app->controller->module->id == 'ripfelli' && Yii::$app->controller->id == 'index'),
]);
}
/**
* Defines what to do if admin menu is initialized.
*
* @param $event
*/
public static function onAdminMenuInit($event)
{
$event->sender->addItem([
'label' => 'RIP Felli',
'url' => Url::to(['/ripfelli/admin']),
'group' => 'manage',
'icon' => '<i class="fas fa-cross"></i>',
'isActive' => (Yii::$app->controller->module && Yii::$app->controller->module->id == 'ripfelli' && Yii::$app->controller->id == 'admin'),
'sortOrder' => 99999,
]);
}
}