|
|
@@ -15,6 +15,7 @@ use Psr\Http\Message\ResponseInterface;
|
|
|
use TYPO3\CMS\Extbase\Mvc\View\ViewInterface;
|
|
|
use TYPO3\CMS\Core\Page\PageRenderer;
|
|
|
use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder;
|
|
|
+use Meramo\Pagemanager\Utils\Gedoens;
|
|
|
|
|
|
class BackendController extends ActionController
|
|
|
{
|
|
|
@@ -93,22 +94,9 @@ class BackendController extends ActionController
|
|
|
return $this->uriBuilder->reset()->uriFor($action, $parameters, $controller);
|
|
|
}
|
|
|
|
|
|
- public function createCategoryFromSlug($slug)
|
|
|
- {
|
|
|
- if (substr($slug, 0, 1) === '/') {
|
|
|
- $value = ltrim($slug, '/');
|
|
|
-
|
|
|
- if (substr($slug, 0, 1) === '_') {
|
|
|
- $value = ltrim($slug, '_');
|
|
|
- }
|
|
|
-
|
|
|
- $data = explode('/', $slug);
|
|
|
- }
|
|
|
- return $data[0];
|
|
|
- }
|
|
|
-
|
|
|
public function indexAction(): ResponseInterface
|
|
|
{
|
|
|
+ $this->gedoens = GeneralUtility::makeInstance(Gedoens::class);
|
|
|
$activePages = $this->activePageRepository->findActivePagesAndPageCreatetors();
|
|
|
$itemsperpage = $this->settings['itemsPerPage'] ?? 50;
|
|
|
|
|
|
@@ -121,7 +109,7 @@ class BackendController extends ActionController
|
|
|
$pageObj->setEndtime($activePage['endtime']);
|
|
|
$pageObj->setTitle($activePage['title']);
|
|
|
$pageObj->setRoof($activePage['roof']);
|
|
|
- $pageObj->setCategory($this->activePageRepository->createCategoryFromSlug($activePage['slug']));
|
|
|
+ $pageObj->setCategory($this->gedoens->createCategoryFromSlug($activePage['slug']));
|
|
|
$pageObj->setCreator($activePage['username']);
|
|
|
$pageObj->setFullName($activePage['realName']);
|
|
|
|
|
|
@@ -137,6 +125,7 @@ class BackendController extends ActionController
|
|
|
|
|
|
public function showLast30Action()
|
|
|
{
|
|
|
+ $this->gedoens = GeneralUtility::makeInstance(Gedoens::class);
|
|
|
$activePagesExpiredInlast30days = $this->activePageRepository->findExpiredRecordsInTheLast30OR90Days(30);
|
|
|
$itemsperpage = $this->settings['itemsPerPage'] ?? 50;
|
|
|
|
|
|
@@ -149,7 +138,7 @@ class BackendController extends ActionController
|
|
|
$pageObj->setEndtime($activePage['endtime']);
|
|
|
$pageObj->setTitle($activePage['title']);
|
|
|
$pageObj->setRoof($activePage['roof']);
|
|
|
- $pageObj->setCategory($this->activePageRepository->createCategoryFromSlug($activePage['slug']));
|
|
|
+ $pageObj->setCategory($this->gedoens->createCategoryFromSlug($activePage['slug']));
|
|
|
$pageObj->setCreator($activePage['username']);
|
|
|
$pageObj->setFullName($activePage['realName']);
|
|
|
|
|
|
@@ -165,6 +154,7 @@ class BackendController extends ActionController
|
|
|
|
|
|
public function showLast90Action()
|
|
|
{
|
|
|
+ $this->gedoens = GeneralUtility::makeInstance(Gedoens::class);
|
|
|
$activePagesExpiredInlast90days = $this->activePageRepository->findExpiredRecordsInTheLast30OR90Days(90);
|
|
|
$itemsperpage = $this->settings['itemsPerPage'] ?? 50;
|
|
|
|
|
|
@@ -177,7 +167,7 @@ class BackendController extends ActionController
|
|
|
$pageObj->setEndtime($activePage['endtime']);
|
|
|
$pageObj->setTitle($activePage['title']);
|
|
|
$pageObj->setRoof($activePage['roof']);
|
|
|
- $pageObj->setCategory($this->activePageRepository->createCategoryFromSlug($activePage['slug']));
|
|
|
+ $pageObj->setCategory($this->gedoens->createCategoryFromSlug($activePage['slug']));
|
|
|
$pageObj->setCreator($activePage['username']);
|
|
|
$pageObj->setFullName($activePage['realName']);
|
|
|
|