Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
TYPO3
languagevisibility
Commits
df285a2b
Commit
df285a2b
authored
Jul 10, 2020
by
Fabian Galinski
😾
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BUGFIX] The languagevisibility isn't checked for content, which show pages
parent
a488a828
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
0 deletions
+88
-0
Classes/Xclass/ContentObjectRenderer.php
Classes/Xclass/ContentObjectRenderer.php
+23
-0
Classes/Xclass/PageRepository.php
Classes/Xclass/PageRepository.php
+63
-0
ext_localconf.php
ext_localconf.php
+2
-0
No files found.
Classes/Xclass/ContentObjectRenderer.php
View file @
df285a2b
...
...
@@ -2,6 +2,29 @@
namespace
TYPO3\Languagevisibility\Xclass
;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use
Exception
;
use
TYPO3\CMS\Core\Context\Context
;
use
TYPO3\CMS\Core\Context\Exception\AspectNotFoundException
;
...
...
Classes/Xclass/PageRepository.php
0 → 100644
View file @
df285a2b
<?php
namespace
TYPO3\Languagevisibility\Xclass
;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use
TYPO3\CMS\Core\Context\Exception\AspectNotFoundException
;
use
TYPO3\Languagevisibility\Service\FrontendServices
;
/**
* Class PageRepository
* @package TYPO3\Languagevisibility\Xclass
*/
class
PageRepository
extends
\
TYPO3\CMS\Frontend\Page\PageRepository
{
/**
* This just checks, if the wanted page is available for the current language with the languagevisibility filters
* from the backend. (The Table)
*
* @inheritdoc
*
* @param int $uid The page id to look up
* @param bool $disableGroupAccessCheck set to true to disable group access check
*
* @return array The resulting page record with overlays or empty array
*
* @throws \UnexpectedValueException
* @throws AspectNotFoundException
* @throws \Exception
*/
public
function
getPage
(
$uid
,
$disableGroupAccessCheck
=
false
)
{
$page
=
parent
::
getPage
(
$uid
,
$disableGroupAccessCheck
);
if
(
count
(
$page
)
<=
0
)
{
return
$page
;
}
if
(
FrontendServices
::
checkVisiblityForElement
(
$page
,
'pages'
,
$this
->
sys_language_uid
))
{
return
$page
;
}
return
[];
}
}
ext_localconf.php
View file @
df285a2b
...
...
@@ -59,6 +59,8 @@ call_user_func(
[
'className'
=>
\
TYPO3\Languagevisibility\Xclass\Typo3DbBackend
::
class
];
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SYS'
][
'Objects'
][
\
TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
::
class
]
=
[
'className'
=>
\
TYPO3\Languagevisibility\Xclass\ContentObjectRenderer
::
class
];
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SYS'
][
'Objects'
][
\
TYPO3\CMS\Frontend\Page\PageRepository
::
class
]
=
[
'className'
=>
\
TYPO3\Languagevisibility\Xclass\PageRepository
::
class
];
if
(
\
TYPO3\CMS\Core\Utility\ExtensionManagementUtility
::
isLoaded
(
'mask'
))
{
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SYS'
][
'Objects'
][
'MASK\Mask\Helper\InlineHelper'
]
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment