From 798553d6f62d1c072a3565ea916503ae8d813574 Mon Sep 17 00:00:00 2001 From: chrode Date: Mon, 23 Sep 2024 17:13:05 +0200 Subject: [PATCH] 11.5 compatibility (#7) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [TASK] added compat for v10 and v11 * [TASK] worked on compat for v10 and v11, removed dead code and fixed some typos * handle more deprecations, align to recommended file structure --------- Co-authored-by: Michael Grundkötter Co-authored-by: MarcMoschSLUB <37207418+MarcMoschSLUB@users.noreply.github.com> Co-authored-by: Carsten Radeck --- Classes/Backend/ItemsProcFunc.php | 10 +- Classes/Controller/EntityFactController.php | 15 +- Classes/Domain/Model/EntityFact.php | 4 +- .../FF_SlubEntityfacts_Entityfactslisting.xml | 2 +- Configuration/Icons.php | 8 + Configuration/TCA/Overrides/sys_template.php | 10 +- Configuration/TCA/Overrides/tt_content.php | 16 +- .../TsConfig/ContentElementWizard.tsconfig | 14 + .../{constants.ts => constants.typoscript} | 7 +- .../TypoScript/{setup.ts => setup.typoscript} | 0 .../Private/Templates76/EntityFact/Show.html | 318 ------------------ Resources/Public/Icons/Extension.gif | Bin 0 -> 177 bytes composer.json | 7 +- ext_emconf.php | 6 +- ext_localconf.php | 34 +- 15 files changed, 67 insertions(+), 384 deletions(-) create mode 100644 Configuration/Icons.php create mode 100644 Configuration/TsConfig/ContentElementWizard.tsconfig rename Configuration/TypoScript/{constants.ts => constants.typoscript} (70%) rename Configuration/TypoScript/{setup.ts => setup.typoscript} (100%) delete mode 100644 Resources/Private/Templates76/EntityFact/Show.html create mode 100644 Resources/Public/Icons/Extension.gif diff --git a/Classes/Backend/ItemsProcFunc.php b/Classes/Backend/ItemsProcFunc.php index 65ad354..339b37c 100644 --- a/Classes/Backend/ItemsProcFunc.php +++ b/Classes/Backend/ItemsProcFunc.php @@ -6,9 +6,9 @@ * * For the full copyright and license information, please read the * LICENSE.txt file that was distributed with this source code. - * + * * (c) 2021 Tobias Kreße , SLUB Dresden - * + * ***/ class ItemsProcFunc @@ -18,15 +18,15 @@ class ItemsProcFunc * * @param array &$config configuration array */ - public function user_sameAsSelected(array &$config) + public function user_sameAsSelected(array &$config): void { $search = $config['row']['settings.entityfacts.personality']; - //api commmunication and decoding + //api communication and decoding $apiAnswer = file_get_contents('http://hub.culturegraph.org/entityfacts/' . $search); $apiAnswerDecode = json_decode ($apiAnswer, true); - + //constructing the wanted array foreach ($apiAnswerDecode['sameAs'] as $item) { $newItems[] = [$item['collection']['name'],$item['collection']['abbr']]; diff --git a/Classes/Controller/EntityFactController.php b/Classes/Controller/EntityFactController.php index e9319e4..4de83de 100644 --- a/Classes/Controller/EntityFactController.php +++ b/Classes/Controller/EntityFactController.php @@ -1,6 +1,8 @@ , SLUB Dresden * ***/ - /** * EntityFactController */ -class EntityFactController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController +class EntityFactController extends ActionController { /** @@ -23,10 +24,8 @@ class EntityFactController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionContr * * @return void */ - public function showAction() + public function showAction(): ResponseInterface { - //$entityFacts = $this->entityFactRepository->findAll(); - //Get the nine chars long entity facts id from Flexform that the user wants to call $search = $this->settings['entityfacts']['personality']; @@ -34,7 +33,6 @@ public function showAction() $selection = $this->settings['entityfacts']['selection']; $arguments = $this->request->getArguments(); - //print_r($arguments); if ($arguments['search']){ $search = $arguments['search']; @@ -48,7 +46,7 @@ public function showAction() $apiAnswer = file_get_contents('https://hub.culturegraph.org/entityfacts/'.$search); } - //Replace @id for easier calling of informations (no value with "@id" expected) + //Replace @id for easier calling of information (no value with "@id" expected) $apiAnswerClean = str_replace('"@id"', '"atid"', $apiAnswer); $apiAnswerDecode = json_decode ($apiAnswerClean, true); @@ -98,8 +96,7 @@ public function showAction() $this->view->assign('sameAsArray', $sameAsArray); $this->view->assign('viewArray', $viewArray); - //$this->view->assign('multiSelectArray', $multiSelectArray); $this->view->assign('apiAnswerDecode', $apiAnswerDecode); - //$this->view->assign('entityFact', $entityFact); + return $this->htmlResponse(); } } diff --git a/Classes/Domain/Model/EntityFact.php b/Classes/Domain/Model/EntityFact.php index 25ad4bb..2addbf5 100644 --- a/Classes/Domain/Model/EntityFact.php +++ b/Classes/Domain/Model/EntityFact.php @@ -1,6 +1,7 @@ , SLUB Dresden * ***/ - /** * EntityFact */ -class EntityFact extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity +class EntityFact extends AbstractEntity { } diff --git a/Configuration/FlexForms/FF_SlubEntityfacts_Entityfactslisting.xml b/Configuration/FlexForms/FF_SlubEntityfacts_Entityfactslisting.xml index f753c3e..4b590f7 100644 --- a/Configuration/FlexForms/FF_SlubEntityfacts_Entityfactslisting.xml +++ b/Configuration/FlexForms/FF_SlubEntityfacts_Entityfactslisting.xml @@ -69,7 +69,7 @@ placeOfBirth - Sterbesort + Sterbeort placeOfDeath diff --git a/Configuration/Icons.php b/Configuration/Icons.php new file mode 100644 index 0000000..a255a30 --- /dev/null +++ b/Configuration/Icons.php @@ -0,0 +1,8 @@ + [ + 'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, + 'source' => 'EXT:slub_entityfacts/Resources/Public/Icons/user_plugin_entityfactslisting.svg' + ], +]; \ No newline at end of file diff --git a/Configuration/TCA/Overrides/sys_template.php b/Configuration/TCA/Overrides/sys_template.php index cb16e26..24f0c7e 100644 --- a/Configuration/TCA/Overrides/sys_template.php +++ b/Configuration/TCA/Overrides/sys_template.php @@ -1,12 +1,12 @@ - - -This Template is responsible for displaying a single view for a domain object - -If you modify this template, do not forget to change the overwrite settings -in /Configuration/ExtensionBuilder/settings.yaml: - Resources: - Private: - Templates: - Show.html: keep - -Otherwise your changes will be overwritten the next time you save the extension in the extension builder - - - - - - - - -
-

- -

{relationship}

-
-
-
- - - - - - -
- -

-
-

{viewArray.id}

-
-
- - -
- -

-
-

-
-
- - -
- -

-
-

- - <f:translate id='slubentityfacts.depiction' /> {viewArray.preferredName} - -

-
-
- - - - - - -
-

- -

{variantName}

-
-
-
- - -
-

- - - - -

{placeOfBusinessArray}

-
- -

{placeOfBusinessArray}

-
-
-
-
-
-
- - -
-

- - - - -

{predecessorArray}

-
- -

{predecessorArray}

-
-
-
-
-
-
- - -
- -

-
- - - - -

{isAArray}

-
- -

{isAArray}

-
-
-
-
-
-
- - -
-

- -

{dateOfEstablishment}

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - -
-

- -

{number.preferredName}

-
-
-
- - - - - - - - - - - - - - -
-

-

* {viewArrayValue} ‐ - - † {viewArray.dateOfDeath} - -

-
-
- - - - - -
- -

-
-

{viewArray.preferredName}

-
-
- - - - - -
- -

-
-

{viewArrayValue}

-
-
- -
-
- - -

-

-
-
-
-
- - - -
- -

-
    - -
  • - - - - icon of {item.collection.name}{item.collection.name} - - - {item.collection.name} - - - -
  • -
    -
-
-
-
-
- - -
-

-

{viewArray.describedBy.atid}

-

: {viewArray.describedBy.license}

-

: {viewArray.describedBy.valid -> f:format.date(format:'d.m.Y H:m:s')}

-
-
- -
- diff --git a/Resources/Public/Icons/Extension.gif b/Resources/Public/Icons/Extension.gif new file mode 100644 index 0000000000000000000000000000000000000000..1a832d4b660d1b498d5f980098a7c3953ff69a8f GIT binary patch literal 177 zcmV;i08al$Nk%w1VG;lk0J8!BWo2cKj*jy3@|l^L$;ruVY;1*vg|V@*=H}+t*Vju+ zOI1}>D=RBPLPGxj{r~^~A^8LW00062EC2ui01^NY000DDP{>KEmFXN=lmdfw08JA} z4Wlvz6_lkRDJ!#33)}#bQJ)i%E+I(Nh?AENSWw+41YJXc5Fk4ec9G3FRl5J_Rh9}OA1rm-a80vh15)lA9z(qn} literal 0 HcmV?d00001 diff --git a/composer.json b/composer.json index 9086dff..6fd8077 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,12 @@ ], "license": "GPL-3.0-or-later", "require": { - "typo3/cms-core": "~7.6.23|~8.7.10|~9.5.1" + "typo3/cms-core": "~10.4|~11.5" + }, + "extra": { + "typo3/cms": { + "extension-key": "slub_entityfacts" + } }, "autoload": { "psr-4": { diff --git a/ext_emconf.php b/ext_emconf.php index 9abf0a1..f3fd62e 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -17,14 +17,10 @@ 'author' => 'Sebastian Semsker', 'author_email' => 'typo3@slub-dresden.de', 'state' => 'stable', - 'internal' => '', - 'uploadfolder' => '0', - 'createDirs' => '', - 'clearCacheOnLoad' => 0, 'version' => '1.2.2', 'constraints' => [ 'depends' => [ - 'typo3' => '7.6.0-9.5.99', + 'typo3' => '10.4.0-11.5.99', ], 'conflicts' => [], 'suggests' => [], diff --git a/ext_localconf.php b/ext_localconf.php index def99f6..507ea0a 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -1,40 +1,24 @@ 'show' + \Slub\SlubEntityfacts\Controller\EntityFactController::class => 'show' ], // non-cacheable actions [ ] ); - // wizards - \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig( - 'mod { - wizards.newContentElement.wizardItems.plugins { - elements { - entityfactslisting { - icon = EXT:slub_entityfacts/Resources/Public/Icons/user_plugin_entityfactslisting.svg - title = LLL:EXT:slub_entityfacts/Resources/Private/Language/locallang_db.xlf:tx_slub_entityfacts_domain_model_entityfactslisting - description = LLL:EXT:slub_entityfacts/Resources/Private/Language/locallang_db.xlf:tx_slub_entityfacts_domain_model_entityfactslisting.description - tt_content_defValues { - CType = list - list_type = slubentityfacts_entityfactslisting - } - } - } - show = * - } - }' - ); - }, - $_EXTKEY + // wizards + \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig( + '@import "EXT:slub_entityfacts/Configuration/TsConfig/ContentElementWizard.tsconfig"' + ); + } );