Skip to content

Commit

Permalink
Merge pull request #23 from b13/task/v12-compatability
Browse files Browse the repository at this point in the history
[TASK] Add v12 compatibility
  • Loading branch information
ochorocho authored Feb 13, 2024
2 parents a05ea9d + ea64ff1 commit ea17e18
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 95 deletions.
12 changes: 6 additions & 6 deletions Classes/LinkHandler/PageLinkHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
class PageLinkHandler extends \TYPO3\CMS\Recordlist\LinkHandler\PageLinkHandler implements LinkHandlerInterface, LinkParameterProviderInterface
{

public function render(ServerRequestInterface $request)
public function render(ServerRequestInterface $request): string
{
if ((new Typo3Version())->getMajorVersion() < 11) {
$this->view->setTemplateRootPaths([200 => 'EXT:link2language/Resources/Private/Templates/LinkBrowser10']);
} else {
$this->view->setTemplateRootPaths([200 => 'EXT:link2language/Resources/Private/Templates/LinkBrowser']);
if ((new Typo3Version())->getMajorVersion() < 12) {
$this->view->setTemplateRootPaths([200 => 'EXT:link2language/Resources/Private/TemplateOverrides/Templates/LinkBrowser']);
}

// page.tsconfig is used to set the template for v12 and above
return parent::render($request);
}

Expand Down Expand Up @@ -156,7 +156,7 @@ protected function getRecordsOnExpandedPage($pageId)

$colPosMapping = [];
foreach ($colPosArray as $colPos) {
$colPosMapping[(int)$colPos[1]] = $colPos[0];
$colPosMapping[(int)($colPos[1] ?? $colPos['value'])] = $colPos[0] ?? $colPos['label'];
}
// Enrich list of records
$groupedContentElements = [];
Expand Down
3 changes: 3 additions & 0 deletions Configuration/page.tsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
templates.typo3/cms-backend {
1643293191 = b13/link2language:Resources/Private/TemplateOverrides
}
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ For details see the LICENSE file in this repository.

If you find an issue, feel free to create an issue on GitHub or a pull request.

## ToDo

- The labels should be localizable.

### Credits

This extension was created by [Benni Mack](https://github.com/bmack) for [b13 GmbH](https://b13.com).
Expand Down
11 changes: 11 additions & 0 deletions Resources/Private/Language/de.locallang_db.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file>
<body>
<trans-unit id="link2language.headline" resname="link2language.headline">
<source>Link to page</source>
<target>Link auf Seite</target>
</trans-unit>
</body>
</file>
</xliff>
10 changes: 10 additions & 0 deletions Resources/Private/Language/locallang_db.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.0">
<file>
<body>
<trans-unit id="link2language.headline" resname="link2language.headline">
<source>Link to page</source>
</trans-unit>
</body>
</file>
</xliff>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<f:if condition="{expandActivePage}">
<f:if condition="{activePageLink}">
<f:then>
<h3>Link to page</h3>
<h3><f:translate key="LLL:EXT:link2language/Resources/Private/Language/locallang_db.xlf:link2language.headline"/></h3>
<f:if condition="{f:count(subject: availableLanguages)}">
<f:then>
<f:for each="{availableLanguages}" as="language">
Expand Down
67 changes: 0 additions & 67 deletions Resources/Private/Templates/LinkBrowser10/Page.html

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "GPL-2.0+",
"keywords": ["TYPO3 CMS", "Link Handler", "Links", "Language"],
"require": {
"typo3/cms-core": "^9.5 || ^10.4 || ^11.5"
"typo3/cms-core": "^11.5 || ^12.4"
},
"autoload": {
"psr-4": {
Expand Down
29 changes: 14 additions & 15 deletions ext_emconf.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
<?php

$EM_CONF[$_EXTKEY] = array(
'title' => 'Links to specific languages',
'description' => 'Allows to select links to pages or content elements for a specific language',
'category' => 'be',
'version' => '2.0.2',
'state' => 'stable',
'clearcacheonload' => 1,
'author' => 'b13 GmbH',
'author_email' => '[email protected]',
'author_company' => 'b13 GmbH',
'constraints' => array(
'depends' => array(
'typo3' => '9.5.0-11.5.99',
'recordlist' => '9.5.0-11.5.99',
),
),
'title' => 'Links to specific languages',
'description' => 'Allows to select links to pages or content elements for a specific language',
'category' => 'be',
'version' => '3.0.0',
'state' => 'stable',
'clearcacheonload' => 1,
'author' => 'b13 GmbH',
'author_email' => '[email protected]',
'author_company' => 'b13 GmbH',
'constraints' => array(
'depends' => array(
'typo3' => '11.5.0-12.4.99',
),
),
);
2 changes: 1 addition & 1 deletion ext_localconf.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
defined('TYPO3_MODE') or die();
defined('TYPO3') or die();

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['removeParams_PostProc']['link2language'] = \B13\Link2Language\RteParserTypoLinkHook::class;

Expand Down

0 comments on commit ea17e18

Please sign in to comment.