/** * Group Section of the directory * * Shows a list of all groups in the application. */ public function actionGroups() { $groups = \humhub\modules\user\models\Group::find()->all(); \yii\base\Event::on(Sidebar::className(), Sidebar::EVENT_INIT, function ($event) { $event->sender->addWidget(\humhub\modules\directory\widgets\GroupStatistics::className(), [], ['sortOrder' => 10]); }); return $this->render('groups', array('groups' => $groups)); }
/** * Group Section of the directory * * Shows a list of all groups in the application. */ public function actionGroups() { if (!$this->module->isGroupListingEnabled()) { return $this->redirect(['members']); } $groups = \humhub\modules\user\models\Group::getDirectoryGroups(); \yii\base\Event::on(Sidebar::className(), Sidebar::EVENT_INIT, function ($event) { $event->sender->addWidget(\humhub\modules\directory\widgets\GroupStatistics::className(), [], ['sortOrder' => 10]); }); return $this->render('groups', array('groups' => $groups)); }