summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/Http/Controllers/HomePageController.php12
-rw-r--r--resources/views/tree-page.phtml6
-rw-r--r--resources/views/user-page.phtml4
3 files changed, 12 insertions, 10 deletions
diff --git a/app/Http/Controllers/HomePageController.php b/app/Http/Controllers/HomePageController.php
index 5dba7c2448..75f9510cca 100644
--- a/app/Http/Controllers/HomePageController.php
+++ b/app/Http/Controllers/HomePageController.php
@@ -802,7 +802,7 @@ class HomePageController extends AbstractBaseController
// Deleted blocks
foreach ($existing_block_ids as $existing_block_id) {
- if (!in_array($existing_block_id, $main_blocks, true) && !in_array($existing_block_id, $side_blocks, true)) {
+ if (!in_array($existing_block_id, $main_blocks, false) && !in_array($existing_block_id, $side_blocks, false)) {
DB::table('block_setting')
->where('block_id', '=', $existing_block_id)
->delete();
@@ -813,10 +813,12 @@ class HomePageController extends AbstractBaseController
}
}
- foreach ([
- 'main' => $main_blocks,
- 'side' => $side_blocks,
- ] as $location => $updated_blocks) {
+ $updates = [
+ 'main' => $main_blocks,
+ 'side' => $side_blocks,
+ ];
+
+ foreach ($updates as $location => $updated_blocks) {
foreach ($updated_blocks as $block_order => $block_id) {
if (is_numeric($block_id)) {
// Updated block
diff --git a/resources/views/tree-page.phtml b/resources/views/tree-page.phtml
index 06a4721c58..4383b77bec 100644
--- a/resources/views/tree-page.phtml
+++ b/resources/views/tree-page.phtml
@@ -1,8 +1,8 @@
<div class="row">
- <?php if (empty($main_blocks) || empty($side_blocks)) : ?>
+ <?php if ($main_blocks->isEmpty() || $side_blocks->isEmpty()) : ?>
<div class="col-md-12 wt-main-blocks">
- <?php foreach ($main_blocks + $side_blocks as $block_id => $block) : ?>
- <?= view('tree-page-block', ['block_id' => $block_id, 'block' => $block, 'tree' => $tree]) ?>
+ <?php foreach ($main_blocks->concat($side_blocks) as $block_id => $block) : ?>
+ <?= view('user-page-block', ['block_id' => $block_id, 'block' => $block, 'tree' => $tree]) ?>
<?php endforeach ?>
</div>
<?php else : ?>
diff --git a/resources/views/user-page.phtml b/resources/views/user-page.phtml
index c227d363d2..0c2e4e2a8c 100644
--- a/resources/views/user-page.phtml
+++ b/resources/views/user-page.phtml
@@ -3,9 +3,9 @@
</h2>
<div class="row">
- <?php if (empty($main_blocks) || empty($side_blocks)) : ?>
+ <?php if ($main_blocks->isEmpty() || $side_blocks->isEmpty()) : ?>
<div class="col-md-12 wt-main-blocks">
- <?php foreach ($main_blocks + $side_blocks as $block_id => $block) : ?>
+ <?php foreach ($main_blocks->concat($side_blocks) as $block_id => $block) : ?>
<?= view('user-page-block', ['block_id' => $block_id, 'block' => $block, 'tree' => $tree]) ?>
<?php endforeach ?>
</div>