-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathEvents.php
More file actions
42 lines (35 loc) · 1.01 KB
/
Events.php
File metadata and controls
42 lines (35 loc) · 1.01 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
<?php
/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2017 HumHub GmbH & Co. KG
* @license https://www.humhub.com/licences
*/
namespace humhub\modules\devtools;
use humhub\helpers\ControllerHelper;
use humhub\modules\ui\menu\MenuLink;
use humhub\widgets\TopMenu;
use Yii;
class Events
{
public static function onTopMenuInit($event)
{
if (Yii::$app->user->isGuest) {
return true;
}
/* @var TopMenu $menu */
$menu = $event->sender;
$menu->addEntry(new MenuLink([
'label' => Yii::t('DevtoolsModule.base', 'Devtools'),
'id' => 'devtools',
'icon' => 'code',
'url' => ['/devtools/index'],
'sortOrder' => 100,
'isActive' => ControllerHelper::isActivePath('devtools'),
]));
}
public static function onConsoleApplicationInit($event)
{
$application = $event->sender;
$application->controllerMap['dummy'] = commands\DummyController::class;
}
}