forked from GreenMeteor/humhub-RESTful-API
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Events.php
31 lines (28 loc) · 833 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
<?php
namespace humhub\modules\api;
use Yii;
use yii\helpers\Url;
/**
* Events provides callbacks for all defined module events.
*
* @author petersmithca
*/
class Events extends \yii\base\Object
{
/**
* Adds an api administration item to the admin menu.
*
* @param type $event
*/
public static function onAdminMenuInit(\yii\base\Event $event)
{
$event->sender->addItem([
'label' => Yii::t('base', '<strong>HumHub</strong> API'),
'url' => Url::toRoute('/api/admin/index'),
'group' => 'settings',
'icon' => '<i class="fa fa-object-group"></i>',
'isActive' => Yii::$app->controller->module && Yii::$app->controller->module->id == 'api' && Yii::$app->controller->id == 'admin',
'sortOrder' => 650
]);
}
}