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
9aa18013
Commit
9aa18013
authored
Aug 11, 2020
by
Kevin Ditscheid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BUGFIX] Fix annoying deprecations
parent
3e02043f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
9 deletions
+47
-9
Classes/Hook/PageHook.php
Classes/Hook/PageHook.php
+3
-5
Classes/UserFunction/FieldVisibilityUserFunction.php
Classes/UserFunction/FieldVisibilityUserFunction.php
+33
-1
Classes/Xclass/PageRepository.php
Classes/Xclass/PageRepository.php
+10
-2
ext_localconf.php
ext_localconf.php
+1
-1
No files found.
Classes/Hook/PageHook.php
View file @
9aa18013
...
...
@@ -26,16 +26,14 @@ namespace TYPO3\Languagevisibility\Hook;
***************************************************************/
use
Exception
;
use
ReflectionException
;
use
TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException
;
use
TYPO3\CMS\Core\Context\Context
;
use
TYPO3\CMS\Core\Context\Exception\AspectNotFoundException
;
use
TYPO3\CMS\Core\Database\ConnectionPool
;
use
TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction
;
use
TYPO3\CMS\Core\Domain\Repository\PageRepositoryGetPageOverlayHookInterface
;
use
TYPO3\CMS\Core\Domain\Repository\PageRepositoryGetRecordOverlayHookInterface
;
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
use
TYPO3\CMS\Frontend\Page\PageRepository
;
use
TYPO3\CMS\Frontend\Page\PageRepositoryGetPageOverlayHookInterface
;
use
TYPO3\CMS\Frontend\Page\PageRepositoryGetRecordOverlayHookInterface
;
use
TYPO3\CMS\Core\Domain\Repository\PageRepository
;
use
TYPO3\Languagevisibility\Exception\InvalidRowException
;
use
TYPO3\Languagevisibility\Exception\TableNotSupportedException
;
use
TYPO3\Languagevisibility\Service\FrontendServices
;
...
...
Classes/UserFunction/FieldVisibilityUserFunction.php
View file @
9aa18013
...
...
@@ -30,12 +30,21 @@ use Exception;
use
TYPO3\CMS\Backend\Form\Element\AbstractFormElement
;
use
TYPO3\CMS\Backend\Utility\BackendUtility
;
use
TYPO3\CMS\Core\Authentication\BackendUserAuthentication
;
use
TYPO3\CMS\Core\Cache\CacheManager
;
use
TYPO3\CMS\Core\Configuration\Loader\PageTsConfigLoader
;
use
TYPO3\CMS\Core\Configuration\Parser\PageTsConfigParser
;
use
TYPO3\CMS\Core\Context\Context
;
use
TYPO3\CMS\Core\Hooks\PagesTsConfigGuard
;
use
TYPO3\CMS\Core\Imaging\Icon
;
use
TYPO3\CMS\Core\Imaging\IconFactory
;
use
TYPO3\CMS\Core\Site\Entity\SiteLanguage
;
use
TYPO3\CMS\Core\Site\SiteFinder
;
use
TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser
;
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
use
TYPO3\CMS\Core\Utility\RootlineUtility
;
use
TYPO3\CMS\Core\Utility\VersionNumberUtility
;
use
TYPO3\CMS\Extbase\Utility\LocalizationUtility
;
use
TYPO3\CMS\Frontend\Configuration\TypoScript\ConditionMatching\ConditionMatcher
;
use
TYPO3\Languagevisibility\Element\Element
;
use
TYPO3\Languagevisibility\Element\ElementFactory
;
use
TYPO3\Languagevisibility\Repository\VisibilityFlagRepository
;
...
...
@@ -78,7 +87,30 @@ class FieldVisibilityUserFunction extends AbstractFormElement {
/** @var BackendUserAuthentication $backendUser */
$backendUser
=
$GLOBALS
[
'BE_USER'
];
$this
->
modTSconfig
=
BackendUtility
::
getRawPagesTSconfig
(
$pageId
)[
'mod.'
][
'languagevisibility.'
];
if
(
version_compare
(
VersionNumberUtility
::
getCurrentTypo3Version
(),
'10.2.0'
,
'<'
))
{
$this
->
modTSconfig
=
BackendUtility
::
getRawPagesTSconfig
(
$pageId
)[
'mod.'
][
'languagevisibility.'
];
}
else
{
$rootline
=
GeneralUtility
::
makeInstance
(
RootlineUtility
::
class
,
$pageId
)
->
get
();
$contentHashCache
=
GeneralUtility
::
makeInstance
(
CacheManager
::
class
)
->
getCache
(
'hash'
);
$loader
=
GeneralUtility
::
makeInstance
(
PageTsConfigLoader
::
class
);
$tsConfigString
=
$loader
->
load
(
array_reverse
(
$rootline
));
$parser
=
GeneralUtility
::
makeInstance
(
PageTsConfigParser
::
class
,
GeneralUtility
::
makeInstance
(
TypoScriptParser
::
class
),
$contentHashCache
);
$pagesTSconfig
=
$parser
->
parse
(
$tsConfigString
,
GeneralUtility
::
makeInstance
(
ConditionMatcher
::
class
,
GeneralUtility
::
makeInstance
(
Context
::
class
),
$pageId
,
$rootline
),
GeneralUtility
::
makeInstance
(
SiteFinder
::
class
)
->
getSiteByPageId
(
$pageId
)
);
$this
->
modTSconfig
=
$pagesTSconfig
[
'mod.'
][
'languagevisibility'
];
}
$elementfactory
=
GeneralUtility
::
makeInstance
(
ElementFactory
::
class
);
...
...
Classes/Xclass/PageRepository.php
View file @
9aa18013
...
...
@@ -25,14 +25,16 @@ namespace TYPO3\Languagevisibility\Xclass;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use
TYPO3\CMS\Core\Context\Context
;
use
TYPO3\CMS\Core\Context\Exception\AspectNotFoundException
;
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
use
TYPO3\Languagevisibility\Service\FrontendServices
;
/**
* Class PageRepository
* @package TYPO3\Languagevisibility\Xclass
*/
class
PageRepository
extends
\
TYPO3\CMS\
Frontend\Page
\PageRepository
{
class
PageRepository
extends
\
TYPO3\CMS\
Core\Domain\Repository
\PageRepository
{
/**
* This just checks, if the wanted page is available for the current language with the languagevisibility filters
* from the backend. (The Table)
...
...
@@ -54,7 +56,13 @@ class PageRepository extends \TYPO3\CMS\Frontend\Page\PageRepository {
return
$page
;
}
if
(
FrontendServices
::
checkVisiblityForElement
(
$page
,
'pages'
,
$this
->
sys_language_uid
))
{
if
(
FrontendServices
::
checkVisiblityForElement
(
$page
,
'pages'
,
GeneralUtility
::
makeInstance
(
Context
::
class
)
->
getPropertyFromAspect
(
'language'
,
'id'
,
0
)
)
)
{
return
$page
;
}
...
...
ext_localconf.php
View file @
9aa18013
...
...
@@ -59,7 +59,7 @@ 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
]
=
$GLOBALS
[
'TYPO3_CONF_VARS'
][
'SYS'
][
'Objects'
][
\
TYPO3\CMS\
Core\Domain\Repository
\PageRepository
::
class
]
=
[
'className'
=>
\
TYPO3\Languagevisibility\Xclass\PageRepository
::
class
];
if
(
\
TYPO3\CMS\Core\Utility\ExtensionManagementUtility
::
isLoaded
(
'mask'
))
{
...
...
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