Skip to content
Snippets Groups Projects
Commit 853bf1cd authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASk] Revert changes to ListByCategoryController

parent cad6a6c9
No related branches found
Tags 5.1.0
1 merge request!5Feature 5 2 0
...@@ -56,12 +56,11 @@ class ListByCategoryController extends AbstractController { ...@@ -56,12 +56,11 @@ class ListByCategoryController extends AbstractController {
* Renders the news list of a category * Renders the news list of a category
* *
* @param array $newsMetaData * @param array $newsMetaData
* @param array $newsFilter
* @return void * @return void
* @throws \InvalidArgumentException * @throws \InvalidArgumentException
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException * @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
*/ */
public function indexAction(array $newsMetaData = [], array $newsFilter = []) { public function indexAction(array $newsMetaData = []) {
$filterByCategories = FALSE; $filterByCategories = FALSE;
$categoryUids = GeneralUtility::intExplode(',', $this->settings['categories']); $categoryUids = GeneralUtility::intExplode(',', $this->settings['categories']);
$tagUids = GeneralUtility::intExplode(',', $this->settings['tags'], TRUE); $tagUids = GeneralUtility::intExplode(',', $this->settings['tags'], TRUE);
...@@ -72,19 +71,10 @@ class ListByCategoryController extends AbstractController { ...@@ -72,19 +71,10 @@ class ListByCategoryController extends AbstractController {
} }
} }
// remember selection of the filter values
$selectedTag = $this->tagRepository->findByUid((int) $newsFilter['tag']);
$selectedCategory = $this->categoryRepository->findByUid((int) $newsFilter['category']);
$this->view->assign('selectedTag', $selectedTag);
$this->view->assign('selectedCategory', $selectedCategory);
if (!$filterByCategories) { if (!$filterByCategories) {
$categoryUids = [(int) $GLOBALS['TSFE']->id]; $categoryUids = [(int) $GLOBALS['TSFE']->id];
} }
$tags = $this->tagRepository->findAll()->toArray();
$this->view->assign('tags', $tags);
$categories = []; $categories = [];
foreach ($categoryUids as $categoryUid) { foreach ($categoryUids as $categoryUid) {
$categories[$categoryUid] = $this->categoryRepository->findByUid($categoryUid); $categories[$categoryUid] = $this->categoryRepository->findByUid($categoryUid);
...@@ -127,7 +117,7 @@ class ListByCategoryController extends AbstractController { ...@@ -127,7 +117,7 @@ class ListByCategoryController extends AbstractController {
$nextPage = $currentPageBrowserPage + 1; $nextPage = $currentPageBrowserPage + 1;
if ($nextPage <= $numberOfPages) { if ($nextPage <= $numberOfPages) {
GeneralUtility::_GETset(['tx_sgnews_pagebrowser' => ['currentPage' => $nextPage]]); GeneralUtility::_GETset(['tx_sgnews_pagebrowser' => ['currentPage' => $nextPage]]);
$this->indexAction($newsMetaData, $newsFilter); $this->indexAction($newsMetaData);
return; return;
} }
} }
......
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