-
Notifications
You must be signed in to change notification settings - Fork 1
/
Events.php
50 lines (39 loc) · 1.25 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
48
49
50
<?php
namespace humhub\modules\classifieds;
use Yii;
use humhub\modules\space\models\Space;
use humhub\modules\user\models\User;
/**
* Description of humhub\modules\fallos\Module Events
*
* @author [email protected] */
class Events extends \yii\base\BasObject
{
/**
* On build of a Space Navigation, check if this module is enabled.
* When enabled add a menu item
*
* @param type $event
*/
public static function onSpaceMenuInit($event)
{
$space = $event->sender->space;
// Is Module enabled on this workspace?
if ($space->isModuleEnabled('classifieds')) {
$event->sender->addItem(array(
'label' => 'Classifieds',
'group' => 'modules',
'url' => $space->createUrl('/classifieds/classifieds/index'),
'icon' => '<i class="fas fa-exclamation-triangle"></i>',
'isActive' => (Yii::$app->controller->module && Yii::$app->controller->module->id == 'classifieds'),
));
}
}
public static function onWallEntryControlsInit($event)
{
$object = $event->sender->object;
if(!$object instanceof ShareObject) {
return;
}
}
}