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
b916af5b
Commit
b916af5b
authored
7 years ago
by
Fabian Galinski
Browse files
Options
Downloads
Patches
Plain Diff
[BUGFIX] News and category translations aren't shown in the page module
parent
1afd0cf6
No related branches found
Branches containing commit
Tags
3.7.1
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Classes/Utility/VersionUtility.php
+83
-0
83 additions, 0 deletions
Classes/Utility/VersionUtility.php
Configuration/TCA/Overrides/pages.php
+114
-33
114 additions, 33 deletions
Configuration/TCA/Overrides/pages.php
with
197 additions
and
33 deletions
Classes/Utility/VersionUtility.php
0 → 100644
+
83
−
0
View file @
b916af5b
<?php
namespace
SGalinski\SgNews\Utility
;
/***************************************************************
* 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 3 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\Utility\VersionNumberUtility
;
/**
* Helper class to detect the used TYPO3 version.
*/
class
VersionUtility
{
/**
* Returns true if the current version ts TYPO3 6.2.
*
* @return bool
*/
public
static
function
isVersion62
()
{
$versionNumber
=
self
::
getVersion
();
return
(
$versionNumber
>=
6002000
&&
$versionNumber
<
7000000
);
}
/**
* Returns true if the current version ts TYPO3 7.6 and less version 8
*
* @return bool
*/
public
static
function
isVersion76
()
{
$versionNumber
=
self
::
getVersion
();
return
(
$versionNumber
>=
7006000
&&
$versionNumber
<
8000000
);
}
/**
* Returns true if the current version ts TYPO3 7.6 or later
*
* @return bool
*/
public
static
function
isVersion76OOrHigher
()
{
return
(
self
::
getVersion
()
>=
7006000
);
}
/**
* Returns true if the current version ts TYPO3 8.7 or later
*
* @return bool
*/
public
static
function
isVersion870OrHigher
()
{
return
(
self
::
getVersion
()
>=
8007000
);
}
/**
* Returns the current version as an integer.
*
* @return int
*/
protected
static
function
getVersion
()
{
return
VersionNumberUtility
::
convertVersionNumberToInteger
(
VersionNumberUtility
::
getNumericTypo3Version
()
);
}
}
This diff is collapsed.
Click to expand it.
Configuration/TCA/Overrides/pages.php
+
114
−
33
View file @
b916af5b
...
...
@@ -208,11 +208,8 @@ $columns = array_merge(
],
$imageColumns
);
// #
// # Pages
// #
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility
::
addTCAcolumns
(
'pages'
,
$columns
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility
::
addTCAcolumns
(
'pages_language_overlay'
,
$imageColumns
);
$GLOBALS
[
'TCA'
][
'pages'
][
'palettes'
][
'editorialWithNewsAuthor'
]
=
[
'showitem'
=>
'tx_sgnews_author;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tx_sgnews_author.inPalette,
...
...
@@ -229,8 +226,13 @@ $GLOBALS['TCA']['pages']['palettes']['titleDescriptionAndHighlightFlag'] = [
'canNotCollapse'
=>
1
,
];
$GLOBALS
[
'TCA'
][
'pages'
][
'types'
][
116
]
=
[
'showitem'
=>
'--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
if
(
\SGalinski\SgNews\Utility\VersionUtility
::
isVersion870OrHigher
())
{
#
# Pages
#
$GLOBALS['TCA']['pages']['types'][116] = [
'showitem'
=>
'--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
--palette--;;titleDescriptionAndHighlightFlag,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.editorial;editorialWithNewsAuthor,
tx_sgnews_related_news, tx_sgnews_tags,
...
...
@@ -242,7 +244,7 @@ $GLOBALS['TCA']['pages']['types'][116] = [
tx_projectbase_seo_titletag,tx_projectbase_seo_canonicaltag,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.appearance,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.layout;layout,
--div--;LLL:EXT:cm
s
/locallang_t
c
a.xlf:
pages.tabs.
access,
--div--;LLL:EXT:c
ore/Resources/Private/Language/For
m/locallang_ta
bs
.xlf:access,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.visibility;visibility,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.access;access,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.behaviour,
...
...
@@ -250,10 +252,10 @@ $GLOBALS['TCA']['pages']['types'][116] = [
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.language;language,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.miscellaneous;miscellaneous,
'
];
];
$GLOBALS
[
'TCA'
][
'pages'
][
'types'
][
117
]
=
[
'showitem'
=>
'--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
$GLOBALS
[
'TCA'
][
'pages'
][
'types'
][
117
]
=
[
'showitem'
=>
'--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
title, tx_realurl_pathsegment, tx_realurl_exclude,
--div--;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
...
...
@@ -263,7 +265,7 @@ $GLOBALS['TCA']['pages']['types'][117] = [
tx_projectbase_seo_titletag,tx_projectbase_seo_canonicaltag, description,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.appearance,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.layout;layout,
--div--;LLL:EXT:cm
s
/locallang_t
c
a.xlf:
pages.tabs.
access,
--div--;LLL:EXT:c
ore/Resources/Private/Language/For
m/locallang_ta
bs
.xlf:access,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.visibility;visibility,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.access;access,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.behaviour,
...
...
@@ -271,28 +273,94 @@ $GLOBALS['TCA']['pages']['types'][117] = [
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.language;language,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.miscellaneous;miscellaneous,
'
];
];
// Removal of the realurl fields, if the extension isn't installed.
if
(
!
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility
::
isLoaded
(
'realurl'
))
{
$GLOBALS
[
'TCA'
][
'pages'
][
'palettes'
][
'titleDescriptionAndHighlightFlag'
]
=
str_replace
(
'--linebreak--, tx_realurl_pathsegment, tx_realurl_exclude,'
,
''
,
$GLOBALS
[
'TCA'
][
'pages'
][
'palettes'
][
'titleDescriptionAndHighlightFlag'
]
);
$GLOBALS
[
'TCA'
][
'pages'
][
'types'
][
117
]
=
str_replace
(
'tx_realurl_pathsegment, tx_realurl_exclude,'
,
''
,
$GLOBALS
[
'TCA'
][
'pages'
][
'types'
][
117
]
);
}
#
# Pages Overlay
#
$GLOBALS['TCA']['pages_language_overlay']['types'][116] = [
'showitem'
=>
'--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
subtitle;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.subtitle.inPalette,
description, tx_realurl_pathsegment, author,
--div--;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.abstract;abstract,
tx_projectbase_seo_titletag,tx_projectbase_seo_canonicaltag,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
sys_language_uid,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.visibility;hiddenonly,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.access;access'
];
// #
// # Pages Overlay
// #
$GLOBALS
[
'TCA'
][
'pages_language_overlay'
][
'types'
][
117
]
=
[
'showitem'
=>
'--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
title, tx_realurl_pathsegment,
--div--;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.abstract;abstract,
tx_projectbase_seo_titletag,tx_projectbase_seo_canonicaltag, description,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
sys_language_uid,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.visibility;hiddenonly,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.access;access'
];
}
else
{
#
# Pages
#
$GLOBALS['TCA']['pages']['types'][116] = [
'showitem'
=>
'--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
--palette--;;titleDescriptionAndHighlightFlag,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.editorial;editorialWithNewsAuthor,
tx_sgnews_related_news, tx_sgnews_tags,
--div--;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata,
tx_projectbase_devnullrobots_flags,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.abstract;abstract,
tx_projectbase_seo_titletag,tx_projectbase_seo_canonicaltag,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.appearance,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.layout;layout,
--div--;LLL:EXT:cms/locallang_tca.xlf:pages.tabs.access,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.visibility;visibility,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.access;access,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.behaviour,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.caching;caching,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.language;language,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.miscellaneous;miscellaneous,
'
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility
::
addTCAcolumns
(
'pages_language_overlay'
,
$imageColumns
);
$GLOBALS
[
'TCA'
][
'pages'
][
'types'
][
117
]
=
[
'showitem'
=>
'--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
title, tx_realurl_pathsegment, tx_realurl_exclude,
--div--;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.metadata,
tx_projectbase_devnullrobots_flags,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.abstract;abstract,
tx_projectbase_seo_titletag,tx_projectbase_seo_canonicaltag, description,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.appearance,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.layout;layout,
--div--;LLL:EXT:cms/locallang_tca.xlf:pages.tabs.access,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.visibility;visibility,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.access;access,
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.tabs.behaviour,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.caching;caching,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.language;language,
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_tca.xlf:pages.palettes.miscellaneous;miscellaneous,
'
];
$GLOBALS
[
'TCA'
][
'pages_language_overlay'
][
'types'
][
116
]
=
[
'showitem'
=>
'--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
#
# Pages Overlay
#
$GLOBALS['TCA']['pages_language_overlay']['types'][116] = [
'showitem'
=>
'--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
subtitle;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.subtitle.inPalette,
description, tx_realurl_pathsegment, author,
--div--;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tabs.images,
...
...
@@ -303,10 +371,10 @@ $GLOBALS['TCA']['pages_language_overlay']['types'][116] = [
--div--;LLL:EXT:cms/locallang_tca.xlf:pages.tabs.access,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.visibility;hiddenonly,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.access;access'
];
];
$GLOBALS
[
'TCA'
][
'pages_language_overlay'
][
'types'
][
117
]
=
[
'showitem'
=>
'--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
$GLOBALS
[
'TCA'
][
'pages_language_overlay'
][
'types'
][
117
]
=
[
'showitem'
=>
'--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.standard;standard,
title, tx_realurl_pathsegment,
--div--;LLL:EXT:sg_news/Resources/Private/Language/locallang_db.xlf:pages.tabs.images,
tx_sgnews_teaser2_image, tx_sgnews_teaser1_image,
...
...
@@ -316,4 +384,17 @@ $GLOBALS['TCA']['pages_language_overlay']['types'][117] = [
--div--;LLL:EXT:cms/locallang_tca.xlf:pages.tabs.access,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.visibility;hiddenonly,
--palette--;LLL:EXT:cms/locallang_tca.xlf:pages.palettes.access;access'
];
];
}
// Removal of the realurl fields, if the extension isn't installed.
if
(
!
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility
::
isLoaded
(
'realurl'
))
{
$GLOBALS
[
'TCA'
][
'pages'
][
'palettes'
][
'titleDescriptionAndHighlightFlag'
]
=
str_replace
(
'--linebreak--, tx_realurl_pathsegment, tx_realurl_exclude,'
,
''
,
$GLOBALS
[
'TCA'
][
'pages'
][
'palettes'
][
'titleDescriptionAndHighlightFlag'
]
);
$GLOBALS
[
'TCA'
][
'pages'
][
'types'
][
117
]
=
str_replace
(
'tx_realurl_pathsegment, tx_realurl_exclude,'
,
''
,
$GLOBALS
[
'TCA'
][
'pages'
][
'types'
][
117
]
);
}
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