Skip to content
Snippets Groups Projects
Commit 582d4adf authored by Michael Kessler's avatar Michael Kessler
Browse files

[TASK] Consider all filters when using the overview

parent 0acaf202
No related branches found
No related tags found
1 merge request!40[TASK] Consider all filters when using the overview
This commit is part of merge request !40. Comments created here will be created in the context of that merge request.
......@@ -295,6 +295,9 @@ class OverviewController extends AbstractController {
if ($newsFilter['tag']) {
$tagIds = [(int) $newsFilter['tag']];
}
if ($newsFilter['category']) {
$categoryIds = [(int) $newsFilter['category']];
}
$news = $this->newsRepository->findAllSortedNewsByCategories(
$categoryIds, $newsLimitPerCategory, $offset, $sortBy, $tagIds, $startTime, $endTime, $sortDirection
);
......@@ -336,7 +339,9 @@ class OverviewController extends AbstractController {
}
// remember selection of the filter values, if any
$selectedCategory = $this->categoryRepository->findByUid((int) $newsFilter['category']);
$selectedTag = $this->tagRepository->findByUid((int) $newsFilter['tag']);
$this->view->assign('selectedCategory', $selectedCategory);
$this->view->assign('selectedTag', $selectedTag);
$this->view->assign('tags', $tags);
$this->view->assign('categories', $categories);
......@@ -454,6 +459,9 @@ class OverviewController extends AbstractController {
}
// Get all news by tags.
if ($newsFilter['tag']) {
$tagIds = [(int) $newsFilter['tag']];
}
$news = $this->newsRepository->findAllSortedNewsByCategories(
$categoryIds, $newsLimitPerTag, $offset, $sortBy, $tagIds, $startTime, $endTime, $sortDirection
);
......@@ -496,8 +504,10 @@ class OverviewController extends AbstractController {
}
// remember selection of the filter values, if any
$selectedTag = $this->tagRepository->findByUid((int) $newsFilter['tag']);
$selectedCategory = $this->categoryRepository->findByUid((int) $newsFilter['category']);
$this->view->assign('selectedCategory', $selectedCategory);
$this->view->assign('selectedTag', $selectedTag);
$this->view->assign('tags', $tags);
$this->view->assign('categories', $categories);
$this->view->assign('numberOfPages', $numberOfPages);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment