-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [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 <[email protected]> Co-authored-by: MarcMoschSLUB <[email protected]> Co-authored-by: Carsten Radeck <[email protected]>
- Loading branch information
1 parent
df25bd1
commit 798553d
Showing
15 changed files
with
67 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 <[email protected]>, 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']]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
<?php | ||
namespace Slub\SlubEntityfacts\Controller; | ||
|
||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; | ||
use Psr\Http\Message\ResponseInterface; | ||
/*** | ||
* | ||
* This file is part of the "slubentityfacts" Extension for TYPO3 CMS. | ||
|
@@ -11,30 +13,26 @@ | |
* (c) 2018 Sebastian Semsker <[email protected]>, SLUB Dresden | ||
* | ||
***/ | ||
|
||
/** | ||
* EntityFactController | ||
*/ | ||
class EntityFactController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController | ||
class EntityFactController extends ActionController | ||
{ | ||
|
||
/** | ||
* action show | ||
* | ||
* @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']; | ||
|
||
//Get the selected entity type from Flexform | ||
$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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?php | ||
namespace Slub\SlubEntityfacts\Domain\Model; | ||
|
||
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity; | ||
/*** | ||
* | ||
* This file is part of the "slubentityfacts" Extension for TYPO3 CMS. | ||
|
@@ -11,11 +12,10 @@ | |
* (c) 2018 Sebastian Semsker <[email protected]>, SLUB Dresden | ||
* | ||
***/ | ||
|
||
/** | ||
* EntityFact | ||
*/ | ||
class EntityFact extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity | ||
class EntityFact extends AbstractEntity | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
return [ | ||
'user_plugin_entityfactslisting' => [ | ||
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, | ||
'source' => 'EXT:slub_entityfacts/Resources/Public/Icons/user_plugin_entityfactslisting.svg' | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<?php | ||
defined('TYPO3_MODE') || die('Access denied.'); | ||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; | ||
|
||
defined('TYPO3') || die('Access denied.'); | ||
|
||
call_user_func( | ||
function($extKey) | ||
static function($extKey) | ||
{ | ||
|
||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($extKey, 'Configuration/TypoScript', 'SLUB DNB Entity Facts'); | ||
|
||
ExtensionManagementUtility::addStaticFile($extKey, 'Configuration/TypoScript', 'SLUB DNB Entity Facts'); | ||
}, | ||
'slub_entityfacts' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
<?php | ||
defined('TYPO3_MODE') || die('Access denied.'); | ||
use TYPO3\CMS\Extbase\Utility\ExtensionUtility; | ||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; | ||
|
||
defined('TYPO3') || die('Access denied.'); | ||
|
||
call_user_func( | ||
function($extKey) | ||
static function() | ||
{ | ||
|
||
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin( | ||
'Slub.SlubEntityfacts', | ||
ExtensionUtility::registerPlugin( | ||
'SlubEntityfacts', | ||
'Entityfactslisting', | ||
'SLUB: DNB Entity Facts' | ||
); | ||
|
||
$pluginSignature = 'slubentityfacts_entityfactslisting'; | ||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; | ||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue( | ||
ExtensionManagementUtility::addPiFlexFormValue( | ||
$pluginSignature, | ||
'FILE:EXT:slub_entityfacts/Configuration/FlexForms/FF_SlubEntityfacts_Entityfactslisting.xml' | ||
); | ||
|
||
}, | ||
'slub_entityfacts' | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
mod.wizards.newContentElement.wizardItems.plugins { | ||
elements { | ||
entityfactslisting { | ||
iconIdentifier = user_plugin_entityfactslisting | ||
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 = * | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.