forked from humhub-contrib/mostactiveusers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Module.php
executable file
·46 lines (36 loc) · 943 Bytes
/
Module.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
<?php
namespace humhub\modules\mostactiveusers;
use Yii;
use yii\helpers\Url;
use humhub\models\Setting;
class Module extends \humhub\components\Module
{
/**
* On build of the dashboard sidebar widget, add the mostactiveusers widget if module is enabled.
*
* @param type $event
*/
public static function onSidebarInit($event)
{
if (Yii::$app->hasModule('mostactiveusers')) {
$event->sender->addWidget(widgets\Sidebar::className(), array(), array(
'sortOrder' => 400
));
}
}
public function getConfigUrl()
{
return Url::to(['/mostactiveusers/config/config']);
}
/**
* Enables this module
*/
public function enable()
{
parent::enable();
if (Setting::Set('noUsers', 'mostactiveusers') == '') {
Setting::Set('noUsers', 5, 'mostactiveusers');
}
}
}
?>