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
1b6450f0
Verified
Commit
1b6450f0
authored
2 years ago
by
Kevin Ditscheid
Browse files
Options
Downloads
Patches
Plain Diff
[TASK] Add documentation and use DOK_TYPE_NEWS constant instead of number
parent
d06f261f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Classes/Backend/CategoryWarningDrawer.php
+6
-2
6 additions, 2 deletions
Classes/Backend/CategoryWarningDrawer.php
with
6 additions
and
2 deletions
Classes/Backend/CategoryWarningDrawer.php
+
6
−
2
View file @
1b6450f0
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
namespace
SGalinski\SgNews\Backend
;
namespace
SGalinski\SgNews\Backend
;
use
SGalinski\SgNews\Domain\Model\Category
;
use
SGalinski\SgNews\Domain\Model\Category
;
use
SGalinski\SgNews\Domain\Model\News
;
use
TYPO3\CMS\Backend\Controller\PageLayoutController
;
use
TYPO3\CMS\Backend\Controller\PageLayoutController
;
use
TYPO3\CMS\Core\Database\Connection
;
use
TYPO3\CMS\Core\Database\Connection
;
use
TYPO3\CMS\Core\Database\ConnectionPool
;
use
TYPO3\CMS\Core\Database\ConnectionPool
;
...
@@ -36,17 +37,20 @@ use TYPO3\CMS\Core\Messaging\FlashMessageRendererResolver;
...
@@ -36,17 +37,20 @@ use TYPO3\CMS\Core\Messaging\FlashMessageRendererResolver;
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
/**
/**
*
* This class handles a warning message if the news is not located in a news category. It is implmeneted as a hook for
* $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/layout/db_layout.php']['drawHeaderHook'] in ext_localconf.php
*/
*/
class
CategoryWarningDrawer
{
class
CategoryWarningDrawer
{
/**
/**
* Renders the error message, if the given $parentObj is a news page and has no category as parent page
*
* @param array|NULL $params
* @param array|NULL $params
* @param PageLayoutController|NULL $parentObj
* @param PageLayoutController|NULL $parentObj
* @return string
* @return string
* @throws \Doctrine\DBAL\Driver\Exception|\Doctrine\DBAL\DBALException
* @throws \Doctrine\DBAL\Driver\Exception|\Doctrine\DBAL\DBALException
*/
*/
public
function
render
(
array
$params
=
NULL
,
PageLayoutController
$parentObj
=
NULL
):
string
{
public
function
render
(
array
$params
=
NULL
,
PageLayoutController
$parentObj
=
NULL
):
string
{
if
(
!
$parentObj
||
$parentObj
->
pageinfo
[
'doktype'
]
!==
116
)
{
if
(
!
$parentObj
||
$parentObj
->
pageinfo
[
'doktype'
]
!==
News
::
DOK_TYPE_NEWS
)
{
return
''
;
return
''
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Kevin Ditscheid
@kditscheid
mentioned in commit
f1ba09a8
·
2 years ago
mentioned in commit
f1ba09a8
mentioned in commit f1ba09a8728d4416927a27f566e039b25f888deb
Toggle commit list
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