-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEvents.php
47 lines (41 loc) · 1.12 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
43
44
45
46
47
<?php
namespace humhub\humhub\modules\template;
use Yii;
use yii\helpers\Url;
use humhub\modules\ui\menu\MenuLink;
class Events
{
/**
* Defines what to do when the top menu is initialized.
*
* @param Events $event
*/
public static function onTopMenuInit($event)
{
$menu = $event->sender;
$menu->addEntry(new MenuLink([
'label' => 'Template',
'icon' => 'fa-exclamation-triangle',
'url' => Url::to(['/template/index']),
'sortOrder' => 99999,
'isActive' => MenuLink::isActiveState('template'),
]));
}
/**
* Defines what to do if admin menu is initialized.
*
* @param Events $event
*/
public static function onAdminMenuInit($event)
{
$menu = $event->sender;
$menu->addEntry(new MenuLink([
'label' => 'Template',
'url' => Url::to(['/template/admin']),
'group' => 'manage',
'icon' => 'fa-exclamation-triangle',
'isActive' => MenuLink::isActiveState('template'),
'sortOrder' => 99999,
]));
}
}