예제 #1
0
 /**
  * Space Section of directory
  *
  * Provides a list of all visible spaces.
  *
  * @todo Dont pass lucene hits to view, build user array inside of action
  */
 public function actionSpaces()
 {
     $keyword = Yii::$app->request->get('keyword', "");
     $page = (int) Yii::$app->request->get('page', 1);
     $searchResultSet = Yii::$app->search->find($keyword, ['model' => \humhub\modules\space\models\Space::className(), 'page' => $page, 'sortField' => $keyword == '' ? 'title' : null, 'pageSize' => Setting::Get('paginationSize')]);
     $pagination = new \yii\data\Pagination(['totalCount' => $searchResultSet->total, 'pageSize' => $searchResultSet->pageSize]);
     \yii\base\Event::on(Sidebar::className(), Sidebar::EVENT_INIT, function ($event) {
         $event->sender->addWidget(\humhub\modules\directory\widgets\NewSpaces::className(), [], ['sortOrder' => 10]);
         $event->sender->addWidget(\humhub\modules\directory\widgets\SpaceStatistics::className(), [], ['sortOrder' => 20]);
     });
     return $this->render('spaces', array('keyword' => $keyword, 'spaces' => $searchResultSet->getResultInstances(), 'pagination' => $pagination));
 }
예제 #2
0
<div class="container">
    <div class="row">
        <div class="col-md-8">
            <?php 
echo \humhub\modules\dashboard\widgets\DashboardContent::widget();
?>
        </div>
        <div class="col-md-4 layout-sidebar-container">
            <?php 
echo \humhub\modules\dashboard\widgets\Sidebar::widget(['widgets' => [[\humhub\modules\directory\widgets\NewMembers::className(), ['showMoreButton' => true], ['sortOrder' => 300]], [\humhub\modules\directory\widgets\NewSpaces::className(), ['showMoreButton' => true], ['sortOrder' => 400]]]]);
?>
        </div>
    </div>
</div>