Skip to content
Snippets Groups Projects

[FEATURE] News Overview Tag / Category Restrictions

Merged Tim Wagner requested to merge feature_allowRestrictingNewsOverview into master
4 files
+ 92
0
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -160,6 +160,19 @@ class OverviewController extends AbstractController {
return;
}
$categoryRestrictions = GeneralUtility::intExplode(',', $this->settings['categoryRestrictions'], TRUE);
if (count($categoryRestrictions) > 0) {
foreach ($categories as $key => $category) {
if (!in_array($category->getUid(), $categoryRestrictions, TRUE)) {
unset($categories[$key]);
}
}
}
if (count($categories) <= 0) {
return;
}
$startTime = (int) $this->settings['starttime'];
$endTime = (int) $this->settings['endtime'];
@@ -331,6 +344,15 @@ class OverviewController extends AbstractController {
$tags = $this->tagRepository->findAll()->toArray();
}
$tagRestrictions = GeneralUtility::intExplode(',', $this->settings['tagRestrictions'], TRUE);
if (count($tagRestrictions) > 0) {
foreach ($tags as $key => $tag) {
if (!in_array($tag->getUid(), $tagRestrictions, TRUE)) {
unset($tags[$key]);
}
}
}
// Get news by tag id
$tagIds = [];
$tagsById = [];
Loading