@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | protected function initializeAction() |
| 28 | 28 | { |
| 29 | - $this->uriBuilder->setArgumentPrefix('tx_aimeos_web_aimeos'); |
|
| 29 | + $this->uriBuilder->setArgumentPrefix( 'tx_aimeos_web_aimeos' ); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
@@ -37,15 +37,15 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function indexAction() |
| 39 | 39 | { |
| 40 | - $resource = $this->request->hasArgument('resource') ? $this->request->getArgument('resource') : ''; |
|
| 41 | - |
|
| 42 | - switch ($this->request->getMethod()) { |
|
| 43 | - case 'DELETE': return $this->deleteAction($resource); |
|
| 44 | - case 'PATCH': return $this->patchAction($resource); |
|
| 45 | - case 'POST': return $this->postAction($resource); |
|
| 46 | - case 'PUT': return $this->putAction($resource); |
|
| 47 | - case 'GET': return $this->getAction($resource); |
|
| 48 | - default: return $this->optionsAction($resource); |
|
| 40 | + $resource = $this->request->hasArgument( 'resource' ) ? $this->request->getArgument( 'resource' ) : ''; |
|
| 41 | + |
|
| 42 | + switch( $this->request->getMethod() ) { |
|
| 43 | + case 'DELETE': return $this->deleteAction( $resource ); |
|
| 44 | + case 'PATCH': return $this->patchAction( $resource ); |
|
| 45 | + case 'POST': return $this->postAction( $resource ); |
|
| 46 | + case 'PUT': return $this->putAction( $resource ); |
|
| 47 | + case 'GET': return $this->getAction( $resource ); |
|
| 48 | + default: return $this->optionsAction( $resource ); |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | * @param string Resource location, e.g. "product/property/type" |
| 57 | 57 | * @return string Generated output |
| 58 | 58 | */ |
| 59 | - public function deleteAction(string $resource) |
|
| 59 | + public function deleteAction( string $resource ) |
|
| 60 | 60 | { |
| 61 | - return $this->createAdmin($resource)->delete($this->getPsrRequest(), (new Psr17Factory)->createResponse()); |
|
| 61 | + return $this->createAdmin( $resource )->delete( $this->getPsrRequest(), ( new Psr17Factory )->createResponse() ); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | |
@@ -68,9 +68,9 @@ discard block |
||
| 68 | 68 | * @param string Resource location, e.g. "product/property/type" |
| 69 | 69 | * @return string Generated output |
| 70 | 70 | */ |
| 71 | - public function getAction(string $resource) |
|
| 71 | + public function getAction( string $resource ) |
|
| 72 | 72 | { |
| 73 | - return $this->createAdmin($resource)->get($this->getPsrRequest(), (new Psr17Factory)->createResponse()); |
|
| 73 | + return $this->createAdmin( $resource )->get( $this->getPsrRequest(), ( new Psr17Factory )->createResponse() ); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
@@ -80,9 +80,9 @@ discard block |
||
| 80 | 80 | * @param string Resource location, e.g. "product/property/type" |
| 81 | 81 | * @return string Generated output |
| 82 | 82 | */ |
| 83 | - public function patchAction(string $resource) |
|
| 83 | + public function patchAction( string $resource ) |
|
| 84 | 84 | { |
| 85 | - return $this->createAdmin($resource)->patch($this->getPsrRequest(), (new Psr17Factory)->createResponse()); |
|
| 85 | + return $this->createAdmin( $resource )->patch( $this->getPsrRequest(), ( new Psr17Factory )->createResponse() ); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
@@ -92,9 +92,9 @@ discard block |
||
| 92 | 92 | * @param string Resource location, e.g. "product/property/type" |
| 93 | 93 | * @return string Generated output |
| 94 | 94 | */ |
| 95 | - public function postAction(string $resource) |
|
| 95 | + public function postAction( string $resource ) |
|
| 96 | 96 | { |
| 97 | - return $this->createAdmin($resource)->post($this->getPsrRequest(), (new Psr17Factory)->createResponse()); |
|
| 97 | + return $this->createAdmin( $resource )->post( $this->getPsrRequest(), ( new Psr17Factory )->createResponse() ); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
@@ -104,9 +104,9 @@ discard block |
||
| 104 | 104 | * @param string Resource location, e.g. "product/property/type" |
| 105 | 105 | * @return string Generated output |
| 106 | 106 | */ |
| 107 | - public function putAction(string $resource) |
|
| 107 | + public function putAction( string $resource ) |
|
| 108 | 108 | { |
| 109 | - return $this->createAdmin($resource)->put($this->getPsrRequest(), (new Psr17Factory)->createResponse()); |
|
| 109 | + return $this->createAdmin( $resource )->put( $this->getPsrRequest(), ( new Psr17Factory )->createResponse() ); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | * @param string Resource location, e.g. "product/property/type" |
| 117 | 117 | * @return string Generated output |
| 118 | 118 | */ |
| 119 | - public function optionsAction(string $resource) |
|
| 119 | + public function optionsAction( string $resource ) |
|
| 120 | 120 | { |
| 121 | - return $this->createAdmin($resource)->options($this->getPsrRequest(), (new Psr17Factory)->createResponse()); |
|
| 121 | + return $this->createAdmin( $resource )->options( $this->getPsrRequest(), ( new Psr17Factory )->createResponse() ); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
@@ -128,10 +128,10 @@ discard block |
||
| 128 | 128 | * @param string Resource location, e.g. "product/property/type" |
| 129 | 129 | * @return \Aimeos\Admin\JsonAdm\Iface Jsonadm client |
| 130 | 130 | */ |
| 131 | - protected function createAdmin(string $resource) : \Aimeos\Admin\JsonAdm\Iface |
|
| 131 | + protected function createAdmin( string $resource ) : \Aimeos\Admin\JsonAdm\Iface |
|
| 132 | 132 | { |
| 133 | - $context = $this->contextBackend('admin/jsonadm/templates'); |
|
| 134 | - return \Aimeos\Admin\JsonAdm::create($context, Base::aimeos(), $resource); |
|
| 133 | + $context = $this->contextBackend( 'admin/jsonadm/templates' ); |
|
| 134 | + return \Aimeos\Admin\JsonAdm::create( $context, Base::aimeos(), $resource ); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | |
@@ -39,7 +39,8 @@ |
||
| 39 | 39 | { |
| 40 | 40 | $resource = $this->request->hasArgument('resource') ? $this->request->getArgument('resource') : ''; |
| 41 | 41 | |
| 42 | - switch ($this->request->getMethod()) { |
|
| 42 | + switch ($this->request->getMethod()) |
|
| 43 | + { |
|
| 43 | 44 | case 'DELETE': return $this->deleteAction($resource); |
| 44 | 45 | case 'PATCH': return $this->patchAction($resource); |
| 45 | 46 | case 'POST': return $this->postAction($resource); |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -defined('TYPO3') or die(); |
|
| 3 | +defined( 'TYPO3' ) or die(); |
|
| 4 | 4 | |
| 5 | 5 | |
| 6 | -$aimeosExtPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('aimeos' ); |
|
| 6 | +$aimeosExtPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath( 'aimeos' ); |
|
| 7 | 7 | |
| 8 | -if (file_exists($aimeosExtPath . '/Resources/Libraries/autoload.php' ) === true ) { |
|
| 8 | +if( file_exists( $aimeosExtPath . '/Resources/Libraries/autoload.php' ) === true ) { |
|
| 9 | 9 | require_once $aimeosExtPath . '/Resources/Libraries/autoload.php'; |
| 10 | 10 | } |
| 11 | 11 | |
@@ -260,41 +260,41 @@ discard block |
||
| 260 | 260 | * Register icons for Aimeos content elements |
| 261 | 261 | */ |
| 262 | 262 | $provider = 'TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider'; |
| 263 | -$icons = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class ); |
|
| 264 | -$icons->registerIcon('aimeos_catalog-home', $provider, ['name' => 'globe'] ); |
|
| 265 | -$icons->registerIcon('aimeos_catalog-list', $provider, ['name' => 'list'] ); |
|
| 266 | -$icons->registerIcon('aimeos_catalog-detail', $provider, ['name' => 'cube'] ); |
|
| 267 | -$icons->registerIcon('aimeos_catalog-filter', $provider, ['name' => 'filter'] ); |
|
| 268 | -$icons->registerIcon('aimeos_catalog-attribute', $provider, ['name' => 'filter'] ); |
|
| 269 | -$icons->registerIcon('aimeos_catalog-price', $provider, ['name' => 'filter'] ); |
|
| 270 | -$icons->registerIcon('aimeos_catalog-search', $provider, ['name' => 'filter'] ); |
|
| 271 | -$icons->registerIcon('aimeos_catalog-supplier', $provider, ['name' => 'filter'] ); |
|
| 272 | -$icons->registerIcon('aimeos_catalog-tree', $provider, ['name' => 'filter'] ); |
|
| 273 | -$icons->registerIcon('aimeos_catalog-suggest', $provider, ['name' => 'ellipsis-h'] ); |
|
| 274 | -$icons->registerIcon('aimeos_catalog-count', $provider, ['name' => 'bars'] ); |
|
| 275 | -$icons->registerIcon('aimeos_catalog-stage', $provider, ['name' => 'image'] ); |
|
| 276 | -$icons->registerIcon('aimeos_catalog-session', $provider, ['name' => 'thumb-tack'] ); |
|
| 277 | -$icons->registerIcon('aimeos_catalog-stock', $provider, ['name' => 'cubes'] ); |
|
| 278 | -$icons->registerIcon('aimeos_supplier-detail', $provider, ['name' => 'industry'] ); |
|
| 279 | -$icons->registerIcon('aimeos_locale-select', $provider, ['name' => 'globe'] ); |
|
| 280 | -$icons->registerIcon('aimeos_account-download', $provider, ['name' => 'download'] ); |
|
| 281 | -$icons->registerIcon('aimeos_account-basket', $provider, ['name' => 'cart-arrow-down'] ); |
|
| 282 | -$icons->registerIcon('aimeos_account-history', $provider, ['name' => 'history'] ); |
|
| 283 | -$icons->registerIcon('aimeos_account-favorite', $provider, ['name' => 'heart'] ); |
|
| 284 | -$icons->registerIcon('aimeos_account-profile', $provider, ['name' => 'user'] ); |
|
| 285 | -$icons->registerIcon('aimeos_account-review', $provider, ['name' => 'comments'] ); |
|
| 286 | -$icons->registerIcon('aimeos_account-subscription', $provider, ['name' => 'repeat'] ); |
|
| 287 | -$icons->registerIcon('aimeos_account-watch', $provider, ['name' => 'eye'] ); |
|
| 288 | -$icons->registerIcon('aimeos_basket-standard', $provider, ['name' => 'shopping-cart'] ); |
|
| 289 | -$icons->registerIcon('aimeos_basket-small', $provider, ['name' => 'shopping-basket'] ); |
|
| 290 | -$icons->registerIcon('aimeos_basket-related', $provider, ['name' => 'link'] ); |
|
| 291 | -$icons->registerIcon('aimeos_basket-bulk', $provider, ['name' => 'truck'] ); |
|
| 292 | -$icons->registerIcon('aimeos_checkout-standard', $provider, ['name' => 'credit-card'] ); |
|
| 293 | -$icons->registerIcon('aimeos_checkout-confirm', $provider, ['name' => 'check'] ); |
|
| 294 | -$icons->registerIcon('aimeos_checkout-update', $provider, ['name' => 'euro'] ); |
|
| 295 | -$icons->registerIcon('aimeos_jsonapi', $provider, ['name' => 'code'] ); |
|
| 296 | - |
|
| 297 | -$icons->registerIcon('aimeos-widget-latestorders', $provider, ['name' => 'shopping-cart'] ); |
|
| 263 | +$icons = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( \TYPO3\CMS\Core\Imaging\IconRegistry::class ); |
|
| 264 | +$icons->registerIcon( 'aimeos_catalog-home', $provider, ['name' => 'globe'] ); |
|
| 265 | +$icons->registerIcon( 'aimeos_catalog-list', $provider, ['name' => 'list'] ); |
|
| 266 | +$icons->registerIcon( 'aimeos_catalog-detail', $provider, ['name' => 'cube'] ); |
|
| 267 | +$icons->registerIcon( 'aimeos_catalog-filter', $provider, ['name' => 'filter'] ); |
|
| 268 | +$icons->registerIcon( 'aimeos_catalog-attribute', $provider, ['name' => 'filter'] ); |
|
| 269 | +$icons->registerIcon( 'aimeos_catalog-price', $provider, ['name' => 'filter'] ); |
|
| 270 | +$icons->registerIcon( 'aimeos_catalog-search', $provider, ['name' => 'filter'] ); |
|
| 271 | +$icons->registerIcon( 'aimeos_catalog-supplier', $provider, ['name' => 'filter'] ); |
|
| 272 | +$icons->registerIcon( 'aimeos_catalog-tree', $provider, ['name' => 'filter'] ); |
|
| 273 | +$icons->registerIcon( 'aimeos_catalog-suggest', $provider, ['name' => 'ellipsis-h'] ); |
|
| 274 | +$icons->registerIcon( 'aimeos_catalog-count', $provider, ['name' => 'bars'] ); |
|
| 275 | +$icons->registerIcon( 'aimeos_catalog-stage', $provider, ['name' => 'image'] ); |
|
| 276 | +$icons->registerIcon( 'aimeos_catalog-session', $provider, ['name' => 'thumb-tack'] ); |
|
| 277 | +$icons->registerIcon( 'aimeos_catalog-stock', $provider, ['name' => 'cubes'] ); |
|
| 278 | +$icons->registerIcon( 'aimeos_supplier-detail', $provider, ['name' => 'industry'] ); |
|
| 279 | +$icons->registerIcon( 'aimeos_locale-select', $provider, ['name' => 'globe'] ); |
|
| 280 | +$icons->registerIcon( 'aimeos_account-download', $provider, ['name' => 'download'] ); |
|
| 281 | +$icons->registerIcon( 'aimeos_account-basket', $provider, ['name' => 'cart-arrow-down'] ); |
|
| 282 | +$icons->registerIcon( 'aimeos_account-history', $provider, ['name' => 'history'] ); |
|
| 283 | +$icons->registerIcon( 'aimeos_account-favorite', $provider, ['name' => 'heart'] ); |
|
| 284 | +$icons->registerIcon( 'aimeos_account-profile', $provider, ['name' => 'user'] ); |
|
| 285 | +$icons->registerIcon( 'aimeos_account-review', $provider, ['name' => 'comments'] ); |
|
| 286 | +$icons->registerIcon( 'aimeos_account-subscription', $provider, ['name' => 'repeat'] ); |
|
| 287 | +$icons->registerIcon( 'aimeos_account-watch', $provider, ['name' => 'eye'] ); |
|
| 288 | +$icons->registerIcon( 'aimeos_basket-standard', $provider, ['name' => 'shopping-cart'] ); |
|
| 289 | +$icons->registerIcon( 'aimeos_basket-small', $provider, ['name' => 'shopping-basket'] ); |
|
| 290 | +$icons->registerIcon( 'aimeos_basket-related', $provider, ['name' => 'link'] ); |
|
| 291 | +$icons->registerIcon( 'aimeos_basket-bulk', $provider, ['name' => 'truck'] ); |
|
| 292 | +$icons->registerIcon( 'aimeos_checkout-standard', $provider, ['name' => 'credit-card'] ); |
|
| 293 | +$icons->registerIcon( 'aimeos_checkout-confirm', $provider, ['name' => 'check'] ); |
|
| 294 | +$icons->registerIcon( 'aimeos_checkout-update', $provider, ['name' => 'euro'] ); |
|
| 295 | +$icons->registerIcon( 'aimeos_jsonapi', $provider, ['name' => 'code'] ); |
|
| 296 | + |
|
| 297 | +$icons->registerIcon( 'aimeos-widget-latestorders', $provider, ['name' => 'shopping-cart'] ); |
|
| 298 | 298 | |
| 299 | 299 | |
| 300 | 300 | /** |
@@ -344,19 +344,19 @@ discard block |
||
| 344 | 344 | * Add cache configuration |
| 345 | 345 | */ |
| 346 | 346 | |
| 347 | -if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['aimeos'] ) ) { |
|
| 347 | +if( !isset( $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['aimeos'] ) ) { |
|
| 348 | 348 | $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['aimeos'] = []; |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | -if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['aimeos']['frontend'] ) ) { |
|
| 351 | +if( !isset( $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['aimeos']['frontend'] ) ) { |
|
| 352 | 352 | $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['aimeos']['frontend'] = 'TYPO3\\CMS\\Core\\Cache\\Frontend\\VariableFrontend'; |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | -if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['aimeos']['options'] ) ) { |
|
| 355 | +if( !isset( $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['aimeos']['options'] ) ) { |
|
| 356 | 356 | $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['aimeos']['options'] = ['defaultLifetime' => 0]; |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | -if (!isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['aimeos']['groups'] ) ) { |
|
| 359 | +if( !isset( $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['aimeos']['groups'] ) ) { |
|
| 360 | 360 | $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['aimeos']['groups'] = ['pages']; |
| 361 | 361 | } |
| 362 | 362 | |
@@ -366,13 +366,13 @@ discard block |
||
| 366 | 366 | */ |
| 367 | 367 | |
| 368 | 368 | // TYPO3 10, unnecessary in 11 |
| 369 | -if (!isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['logout_confirmed']['aimeos'] ) ) { |
|
| 369 | +if( !isset( $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['logout_confirmed']['aimeos'] ) ) { |
|
| 370 | 370 | $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['logout_confirmed']['aimeos'] = \Aimeos\Aimeos\Base::class . '->logout'; |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | -if (!isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']['aimeos'] ) ) { |
|
| 374 | - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']['aimeos'] = function(array $cacheType, $dataHandler ) { |
|
| 375 | - \Aimeos\Aimeos\Base::clearCache($cacheType ); |
|
| 373 | +if( !isset( $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']['aimeos'] ) ) { |
|
| 374 | + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']['aimeos'] = function( array $cacheType, $dataHandler ) { |
|
| 375 | + \Aimeos\Aimeos\Base::clearCache( $cacheType ); |
|
| 376 | 376 | }; |
| 377 | 377 | } |
| 378 | 378 | |
@@ -388,8 +388,8 @@ discard block |
||
| 388 | 388 | * Disable TYPO3 canonical tags so Aimeos ones are used |
| 389 | 389 | */ |
| 390 | 390 | |
| 391 | -if (!\Aimeos\Aimeos\Base::getExtConfig('typo3Canonical', false ) ) { |
|
| 392 | - unset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Frontend\Page\PageGenerator']['generateMetaTags']['canonical'] ); |
|
| 391 | +if( !\Aimeos\Aimeos\Base::getExtConfig( 'typo3Canonical', false ) ) { |
|
| 392 | + unset( $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Frontend\Page\PageGenerator']['generateMetaTags']['canonical'] ); |
|
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | |