-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Events.php
34 lines (28 loc) · 974 Bytes
/
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
<?php
namespace humhub\modules\chatwee;
use Yii;
use yii\helpers\Url;
use humhub\models\Setting;
class Events extends \yii\base\BaseObject
{
public static function onAdminMenuInit(\yii\base\Event $event)
{
$event->sender->addItem([
'label' => Yii::t('ChatweeModule.base', 'ChatWee Settings'),
'url' => Url::toRoute('/chatwee/admin/index'),
'group' => 'settings',
'icon' => '<i class="fa fa-commenting-o"></i>',
'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'chatwee' && Yii::$app->controller->id == 'admin',
'sortOrder' => 650
]);
}
public static function onLayoutAddonsInit(\yii\base\Event $event)
{
if (Yii::$app->user->isGuest) {
return;
}
$event->sender->addWidget(widgets\ChatweeFrame::class, [], [
'sortOrder' => Setting::Get('timeout', 'chatwee')
]);
}
}