From 5f4d80433d632189a26ab91a00836a48864742e7 Mon Sep 17 00:00:00 2001 From: Daniel Lorenz Date: Fri, 17 Aug 2018 07:55:12 +0200 Subject: [PATCH] [TASK] #23 - use new configuration api --- Classes/Hooks/GoogleMapHook.php | 10 ++++++---- composer.json | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Classes/Hooks/GoogleMapHook.php b/Classes/Hooks/GoogleMapHook.php index 1765445..4cb2c0b 100755 --- a/Classes/Hooks/GoogleMapHook.php +++ b/Classes/Hooks/GoogleMapHook.php @@ -14,6 +14,8 @@ * * The TYPO3 project - inspiring people to share! */ +use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; +use TYPO3\CMS\Core\Utility\GeneralUtility; /** * Google Map Hook @@ -101,11 +103,11 @@ public function render($params, $fObj) { $this->init($params); - $extensionConfArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['contacts']); - $googleMapsLibrary = $extensionConfArr['googleMapsLibrary']; + $googleMapsLibrary = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('contacts', 'googleMapsLibrary'); + $googleMapsApiKey = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('contacts', 'googleMapsApiKey'); - if ($extensionConfArr['googleMapsApiKey']) { - $googleMapsLibrary .= '&key=' . $extensionConfArr['googleMapsApiKey']; + if ($googleMapsApiKey) { + $googleMapsLibrary .= '&key=' . $googleMapsApiKey; } $this->tableName = $params['table']; diff --git a/composer.json b/composer.json index fd1f2ce..9b27509 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,8 @@ }, "require": { "php": ">=7.2.0 <7.3", - "typo3/cms-core": "^9.3" + "typo3/cms-core": "^9.3", + "typo3/cms-extbase": "^9.3" }, "require-dev": { "nimut/testing-framework": "^4.0",