Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sg_news
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TYPO3
sg_news
Commits
a4632d37
Commit
a4632d37
authored
1 year ago
by
Stefan Galinski
Browse files
Options
Downloads
Patches
Plain Diff
[TASK] Cleanup
parent
d3e02841
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Classes/Controller/OverviewController.php
+27
-22
27 additions, 22 deletions
Classes/Controller/OverviewController.php
with
27 additions
and
22 deletions
Classes/Controller/OverviewController.php
+
27
−
22
View file @
a4632d37
...
...
@@ -26,6 +26,9 @@ namespace SGalinski\SgNews\Controller;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\Driver\Exception
;
use
Psr\Http\Message\ResponseInterface
;
use
SGalinski\SgNews\Domain\Model\Category
;
use
SGalinski\SgNews\Domain\Model\News
;
use
SGalinski\SgNews\Domain\Repository\CategoryRepository
;
...
...
@@ -34,10 +37,14 @@ use SGalinski\SgNews\Domain\Repository\TagRepository;
use
SGalinski\SgNews\Domain\Service\NewsService
;
use
SGalinski\SgNews\Service\ConfigurationService
;
use
SGalinski\SgNews\Service\HeaderMetaDataService
;
use
SGalinski\SgSeo\Service\HeadTagService
;
use
TYPO3\CMS\Core\Error\Http\PageNotFoundException
;
use
TYPO3\CMS\Core\Http\ImmediateResponseException
;
use
TYPO3\CMS\Core\Utility\ExtensionManagementUtility
;
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
use
TYPO3\CMS\Core\Utility\VersionNumberUtility
;
use
TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException
;
use
TYPO3\CMS\Extbase\Http\ForwardResponse
;
use
TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
;
use
TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
;
use
TYPO3\CMS\Extbase\Persistence\Generic\QueryResult
;
use
TYPO3\CMS\Extbase\Persistence\QueryInterface
;
use
TYPO3\CMS\Frontend\Controller\ErrorController
;
...
...
@@ -115,25 +122,23 @@ class OverviewController extends AbstractController {
* @param array $newsFilter
* @param int $currentPageBrowserPage
* @return void
* @throws \InvalidArgumentException
* @throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
* @throws \TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException
* @throws ImmediateResponseException
* @throws DBALException
* @throws Exception
* @throws PageNotFoundException
* @throws \TYPO3\CMS\Core\Package\Exception
* @throws InvalidConfigurationTypeException
* @throws StopActionException
* @throws InvalidQueryException
*/
public
function
overviewAction
(
array
$newsFilter
=
[],
int
$currentPageBrowserPage
=
0
):
?
\Psr\Http\Message\ResponseInterface
{
$groupBy
=
$this
->
settings
[
'groupBy'
]
??
0
;
$enableFilter
=
$this
->
settings
[
'enableFilter'
]
??
FALSE
;
if
((
int
)
$groupBy
===
0
&&
(
bool
)
$enableFilter
===
FALSE
)
{
if
(
version_compare
(
\TYPO3\CMS\Core\Utility\VersionNumberUtility
::
getCurrentTypo3Version
(),
'11.0.0'
,
'<'
))
{
public
function
overviewAction
(
array
$newsFilter
=
[],
int
$currentPageBrowserPage
=
0
):
?ResponseInterface
{
$groupBy
=
(
int
)
(
$this
->
settings
[
'groupBy'
]
??
0
);
$enableFilter
=
(
bool
)
(
$this
->
settings
[
'enableFilter'
]
??
FALSE
);
if
(
$groupBy
===
0
&&
$enableFilter
===
FALSE
)
{
if
(
version_compare
(
VersionNumberUtility
::
getCurrentTypo3Version
(),
'11.0.0'
,
'<'
))
{
$this
->
forward
(
'overviewWithoutCategories'
,
NULL
,
NULL
,
$this
->
request
->
getArguments
());
}
else
{
return
(
new
\TYPO3\CMS\Extbase\Http\ForwardResponse
(
'overviewWithoutCategories'
))
return
(
new
ForwardResponse
(
'overviewWithoutCategories'
))
->
withArguments
(
$this
->
request
->
getArguments
());
}
}
...
...
@@ -337,7 +342,7 @@ class OverviewController extends AbstractController {
$this
->
view
->
assign
(
'groupBy'
,
'none'
);
}
if
(
version_compare
(
\TYPO3\CMS\Core\Utility\
VersionNumberUtility
::
getCurrentTypo3Version
(),
'11.0.0'
,
'<'
))
{
if
(
version_compare
(
VersionNumberUtility
::
getCurrentTypo3Version
(),
'11.0.0'
,
'<'
))
{
return
NULL
;
}
else
{
return
$this
->
htmlResponse
();
...
...
@@ -361,13 +366,13 @@ class OverviewController extends AbstractController {
switch
(
$columnAmount
)
{
case
4
:
$columnClasses
.
=
'col-lg-3 '
;
// no break
// no break
case
3
:
$columnClasses
.
=
'col-md-4 '
;
// no break
// no break
case
2
:
$columnClasses
.
=
'col-sm-6 '
;
// no break
// no break
default
:
$columnClasses
.
=
'col-xs-12'
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment