From bd4f772d928702d0f5106b4a3d27d23ff3d210cc Mon Sep 17 00:00:00 2001 From: Sarah Tsumayoi Date: Tue, 14 May 2019 04:01:32 -0400 Subject: [PATCH 01/15] Update config.php --- config.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/config.php b/config.php index f4ad2a2..f5a1364 100644 --- a/config.php +++ b/config.php @@ -1,17 +1,13 @@ 'mostactivespaces', - 'class' => 'Baleks\humhub\modules\mostactivespaces\Module', - 'namespace' => 'Baleks\humhub\modules\mostactivespaces', + 'class' => 'humhub\modules\mostactivespaces\Module', + 'namespace' => 'humhub\modules\mostactivespaces', 'events' => [ - [ - 'class' => Sidebar::class, - 'event' => Sidebar::EVENT_INIT, - 'callback' => [Events::class, 'onSidebarInit'] - ], + ['class' => Sidebar::class, 'event' => Sidebar::EVENT_INIT, 'callback' => [\humhub\modules\mostactivespaces\Module::class, 'onSidebarInit']], ], ]; +?> From 0d7a72e42397a836ae2496f915f0375a119ad42a Mon Sep 17 00:00:00 2001 From: Sarah Tsumayoi Date: Tue, 14 May 2019 04:02:50 -0400 Subject: [PATCH 02/15] Update Module.php --- Module.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Module.php b/Module.php index eed40a9..04fae52 100644 --- a/Module.php +++ b/Module.php @@ -1,9 +1,10 @@ hasModule('mostactivespaces')) { + $event->sender->addWidget(widgets\Sidebar::class, [], [ + 'sortOrder' => 400 + ]); + } + } + /** * @inheritdoc */ @@ -24,8 +39,8 @@ public function enable() parent::enable(); $module = Yii::$app->getModule('mostactivespaces'); - if (! $module->settings->get('spaces_count')) { - $module->settings->set('spaces_count', 5); + if (! $module->Settings::Set('spaces_count')) { + $module->Settings::Set('spaces_count', 5); } } From 84865a6fa63e599297c679981aa513dab678c90a Mon Sep 17 00:00:00 2001 From: Sarah Tsumayoi Date: Tue, 14 May 2019 04:03:36 -0400 Subject: [PATCH 03/15] Update Assets.php --- assets/Assets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/Assets.php b/assets/Assets.php index b584450..b332067 100644 --- a/assets/Assets.php +++ b/assets/Assets.php @@ -1,6 +1,6 @@ Date: Tue, 14 May 2019 04:04:25 -0400 Subject: [PATCH 04/15] Update Sidebar.php --- widgets/Sidebar.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/widgets/Sidebar.php b/widgets/Sidebar.php index 938f15b..c5981a8 100644 --- a/widgets/Sidebar.php +++ b/widgets/Sidebar.php @@ -1,20 +1,19 @@ getModule('mostactivespaces'); $spaces = ActiveSpace::find()->limit((int) $module->settings->get('spaces_count'))->all(); - return $this->render('sidebar', [ - 'spaces' => $spaces - ]); + return $this->render('sidebar', ['spaces' => $spaces]); } } From e56d5b71885ddd78be9999f0bc619f616e064b63 Mon Sep 17 00:00:00 2001 From: Sarah Tsumayoi Date: Tue, 14 May 2019 04:05:01 -0400 Subject: [PATCH 05/15] Update sidebar.php --- widgets/views/sidebar.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/widgets/views/sidebar.php b/widgets/views/sidebar.php index b97ff01..9cc7f4a 100644 --- a/widgets/views/sidebar.php +++ b/widgets/views/sidebar.php @@ -1,8 +1,9 @@
From 498bea93338116a796bd43cc4b7dbbee028ba1ec Mon Sep 17 00:00:00 2001 From: Sarah Tsumayoi Date: Tue, 14 May 2019 04:05:39 -0400 Subject: [PATCH 06/15] Update AdminController.php --- controllers/AdminController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/AdminController.php b/controllers/AdminController.php index 6697b88..77e4a35 100644 --- a/controllers/AdminController.php +++ b/controllers/AdminController.php @@ -1,8 +1,8 @@ Date: Tue, 14 May 2019 04:06:12 -0400 Subject: [PATCH 07/15] Update ListController.php --- controllers/ListController.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/controllers/ListController.php b/controllers/ListController.php index 2222919..ce06b7a 100644 --- a/controllers/ListController.php +++ b/controllers/ListController.php @@ -1,9 +1,11 @@ [ - 'class' => \humhub\components\behaviors\AccessControl::class, + 'class' => AccessControl::class, 'guestAllowedActions' => ['list'] ] ]; @@ -31,7 +33,7 @@ public function actionIndex() $query = ActiveSpace::find(); $countQuery = clone $query; - $pagination = new \yii\data\Pagination(['totalCount' => $countQuery->count(), 'pageSize' => $this->pageSize]); + $pagination = new Pagination(['totalCount' => $countQuery->count(), 'pageSize' => $this->pageSize]); $query->offset($pagination->offset)->limit($pagination->limit); return $this->renderAjax('index', [ From 93064ed2823c4cb37cc766bfe6317f1d74ef1256 Mon Sep 17 00:00:00 2001 From: Sarah Tsumayoi Date: Tue, 14 May 2019 04:06:50 -0400 Subject: [PATCH 08/15] Update ActiveSpace.php --- models/ActiveSpace.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/ActiveSpace.php b/models/ActiveSpace.php index 392acc4..c8008db 100644 --- a/models/ActiveSpace.php +++ b/models/ActiveSpace.php @@ -1,6 +1,6 @@ Date: Tue, 14 May 2019 04:07:20 -0400 Subject: [PATCH 09/15] Update ConfigForm.php --- models/ConfigForm.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/models/ConfigForm.php b/models/ConfigForm.php index 263d5c0..1de63c0 100644 --- a/models/ConfigForm.php +++ b/models/ConfigForm.php @@ -1,5 +1,6 @@ Date: Tue, 14 May 2019 04:08:37 -0400 Subject: [PATCH 10/15] Update index.php --- views/list/index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/views/list/index.php b/views/list/index.php index ed435d1..c1fd2e9 100644 --- a/views/list/index.php +++ b/views/list/index.php @@ -1,6 +1,8 @@