@@ -79,8 +79,7 @@ |
||
| 79 | 79 | if( copy( $item, $target ) === false ) { |
| 80 | 80 | throw new \RuntimeException( sprintf( 'Unable to copy file "%1$s"', $item ) ); |
| 81 | 81 | } |
| 82 | - } |
|
| 83 | - else |
|
| 82 | + } else |
|
| 84 | 83 | { |
| 85 | 84 | self::createDirectory( $target ); |
| 86 | 85 | } |
@@ -37,9 +37,12 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function getAdditionalFields( array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject ) |
| 39 | 39 | { |
| 40 | - try { |
|
| 40 | + try |
|
| 41 | + { |
|
| 41 | 42 | return $this->getFields( $taskInfo, $task, $parentObject ); |
| 42 | - } catch( \Exception $e ) { |
|
| 43 | + } |
|
| 44 | + catch( \Exception $e ) |
|
| 45 | + { |
|
| 43 | 46 | $parentObject->addMessage( $e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR ); |
| 44 | 47 | } |
| 45 | 48 | |
@@ -72,9 +75,12 @@ discard block |
||
| 72 | 75 | */ |
| 73 | 76 | public function validateAdditionalFields( array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject ) |
| 74 | 77 | { |
| 75 | - try { |
|
| 78 | + try |
|
| 79 | + { |
|
| 76 | 80 | return $this->validateFields( $submittedData, $parentObject ); |
| 77 | - } catch( \Exception $e ) { |
|
| 81 | + } |
|
| 82 | + catch( \Exception $e ) |
|
| 83 | + { |
|
| 78 | 84 | $parentObject->addMessage( $e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR ); |
| 79 | 85 | } |
| 80 | 86 | |
@@ -70,8 +70,7 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | $object = $objectManager->get( 'TYPO3\CMS\Core\Configuration\ExtensionConfiguration' ); // TYPO3 9 |
| 72 | 72 | $demo = $object->get( 'aimeos', 'useDemoData' ); |
| 73 | - } |
|
| 74 | - else |
|
| 73 | + } else |
|
| 75 | 74 | { |
| 76 | 75 | $object = $objectManager->get( 'TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility' ); // TYPO3 7+8 |
| 77 | 76 | |
@@ -94,8 +93,7 @@ discard block |
||
| 94 | 93 | if( class_exists( '\TYPO3\CMS\Core\Configuration\ExtensionConfiguration' ) ) |
| 95 | 94 | { |
| 96 | 95 | $object->set( 'aimeos', 'useDemoData', '' ); |
| 97 | - } |
|
| 98 | - else |
|
| 96 | + } else |
|
| 99 | 97 | { |
| 100 | 98 | $conf['useDemoData'] = ''; |
| 101 | 99 | $object->writeConfiguration( $conf, 'aimeos' ); |
@@ -200,15 +198,18 @@ discard block |
||
| 200 | 198 | $ctx->setProcess( new \Aimeos\MW\Process\None() ); |
| 201 | 199 | } |
| 202 | 200 | |
| 203 | - if( class_exists( '\TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory' ) ) // TYPO3 9+ |
|
| 201 | + if( class_exists( '\TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory' ) ) { |
|
| 202 | + // TYPO3 9+ |
|
| 204 | 203 | { |
| 205 | 204 | $factory = GeneralUtility::makeInstance( 'TYPO3\CMS\Core\Crypto\PasswordHashing\PasswordHashFactory' ); |
| 206 | - $ctx->setHasherTypo3( $factory->getDefaultHashInstance( 'FE' ) ); |
|
| 207 | 205 | } |
| 208 | - elseif( class_exists( '\TYPO3\CMS\Saltedpasswords\Salt\SaltFactory' ) ) // TYPO3 7/8 |
|
| 206 | + $ctx->setHasherTypo3( $factory->getDefaultHashInstance( 'FE' ) ); |
|
| 207 | + } elseif( class_exists( '\TYPO3\CMS\Saltedpasswords\Salt\SaltFactory' ) ) { |
|
| 208 | + // TYPO3 7/8 |
|
| 209 | 209 | { |
| 210 | 210 | $ctx->setHasherTypo3( \TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getSaltingInstance() ); |
| 211 | 211 | } |
| 212 | + } |
|
| 212 | 213 | |
| 213 | 214 | return $ctx; |
| 214 | 215 | } |
@@ -83,9 +83,12 @@ |
||
| 83 | 83 | { |
| 84 | 84 | $localeManager = \Aimeos\MShop::create( $context, 'locale' ); |
| 85 | 85 | |
| 86 | - try { |
|
| 86 | + try |
|
| 87 | + { |
|
| 87 | 88 | $localeItem = $localeManager->bootstrap( $site, '', '', false, null, true ); |
| 88 | - } catch( \Aimeos\MShop\Exception $e ) { |
|
| 89 | + } |
|
| 90 | + catch( \Aimeos\MShop\Exception $e ) |
|
| 91 | + { |
|
| 89 | 92 | $localeItem = $localeManager->createItem(); |
| 90 | 93 | } |
| 91 | 94 | |
@@ -37,9 +37,12 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function getAdditionalFields( array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject ) |
| 39 | 39 | { |
| 40 | - try { |
|
| 40 | + try |
|
| 41 | + { |
|
| 41 | 42 | return $this->getFields( $taskInfo, $task, $parentObject ); |
| 42 | - } catch( \Exception $e ) { |
|
| 43 | + } |
|
| 44 | + catch( \Exception $e ) |
|
| 45 | + { |
|
| 43 | 46 | $parentObject->addMessage( $e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR ); |
| 44 | 47 | } |
| 45 | 48 | |
@@ -72,9 +75,12 @@ discard block |
||
| 72 | 75 | */ |
| 73 | 76 | public function validateAdditionalFields( array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject ) |
| 74 | 77 | { |
| 75 | - try { |
|
| 78 | + try |
|
| 79 | + { |
|
| 76 | 80 | return $this->validateFields( $submittedData, $parentObject ); |
| 77 | - } catch( \Exception $e ) { |
|
| 81 | + } |
|
| 82 | + catch( \Exception $e ) |
|
| 83 | + { |
|
| 78 | 84 | $parentObject->addMessage( $e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR ); |
| 79 | 85 | } |
| 80 | 86 | |
@@ -71,9 +71,12 @@ |
||
| 71 | 71 | $task = reset( $task ); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - try { |
|
| 74 | + try |
|
| 75 | + { |
|
| 75 | 76 | $manager->migrate( $task ); |
| 76 | - } catch( \Throwable $t ) { |
|
| 77 | + } |
|
| 78 | + catch( \Throwable $t ) |
|
| 79 | + { |
|
| 77 | 80 | echo "\n" . $t->getMessage() . "\n" . $t->getTraceAsString() . "\n"; |
| 78 | 81 | } |
| 79 | 82 | } |
@@ -280,12 +280,10 @@ discard block |
||
| 280 | 280 | { |
| 281 | 281 | $context->setUserId( $GLOBALS['TSFE']->fe_user->user[$GLOBALS['TSFE']->fe_user->userid_column] ); |
| 282 | 282 | $context->setEditor( (string) $GLOBALS['TSFE']->fe_user->user['username'] ); |
| 283 | - } |
|
| 284 | - elseif( TYPO3_MODE === 'BE' && isset( $GLOBALS['BE_USER']->user['username'] ) ) |
|
| 283 | + } elseif( TYPO3_MODE === 'BE' && isset( $GLOBALS['BE_USER']->user['username'] ) ) |
|
| 285 | 284 | { |
| 286 | 285 | $context->setEditor( (string) $GLOBALS['BE_USER']->user['username'] ); |
| 287 | - } |
|
| 288 | - else |
|
| 286 | + } else |
|
| 289 | 287 | { |
| 290 | 288 | $context->setEditor( (string) GeneralUtility::getIndpEnv( 'REMOTE_ADDR' ) ); |
| 291 | 289 | } |
@@ -312,8 +310,7 @@ discard block |
||
| 312 | 310 | { |
| 313 | 311 | $ids = GeneralUtility::trimExplode( ',', $GLOBALS['TSFE']->fe_user->user['usergroup'] ); |
| 314 | 312 | $context->setGroupIds( $ids ); |
| 315 | - } |
|
| 316 | - elseif( TYPO3_MODE === 'BE' && $GLOBALS['BE_USER']->userGroups ) |
|
| 313 | + } elseif( TYPO3_MODE === 'BE' && $GLOBALS['BE_USER']->userGroups ) |
|
| 317 | 314 | { |
| 318 | 315 | $ids = array_keys( $GLOBALS['BE_USER']->userGroups ); |
| 319 | 316 | $context->setGroupIds( $ids ); |
@@ -77,13 +77,11 @@ discard block |
||
| 77 | 77 | $groups[] = $entry['title']; |
| 78 | 78 | } |
| 79 | 79 | $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $groups ); |
| 80 | - } |
|
| 81 | - else |
|
| 80 | + } else |
|
| 82 | 81 | { |
| 83 | 82 | $helper = new \Aimeos\MW\View\Helper\Access\All( $view ); |
| 84 | 83 | } |
| 85 | - } |
|
| 86 | - else |
|
| 84 | + } else |
|
| 87 | 85 | { |
| 88 | 86 | if( $GLOBALS['TSFE']->loginUser == 1 ) { |
| 89 | 87 | $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $GLOBALS['TSFE']->fe_user->groupData['title'] ); |
@@ -277,8 +275,7 @@ discard block |
||
| 277 | 275 | { |
| 278 | 276 | $i18n = \Aimeos\Aimeos\Base::getI18n( [$langid], $local ); |
| 279 | 277 | $translation = $i18n[$langid]; |
| 280 | - } |
|
| 281 | - else |
|
| 278 | + } else |
|
| 282 | 279 | { |
| 283 | 280 | $translation = new \Aimeos\MW\Translation\None( 'en' ); |
| 284 | 281 | } |