@@ -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 ); |
@@ -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 | $this->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 | $this->addMessage( $e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR ); |
79 | 85 | } |
80 | 86 |
@@ -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 | $this->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 | $this->addMessage( $e->getMessage(), \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR ); |
79 | 85 | } |
80 | 86 |
@@ -83,13 +83,11 @@ discard block |
||
83 | 83 | $groups[] = $entry['title']; |
84 | 84 | } |
85 | 85 | $helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $groups ); |
86 | - } |
|
87 | - else |
|
86 | + } else |
|
88 | 87 | { |
89 | 88 | $helper = new \Aimeos\MW\View\Helper\Access\All( $view ); |
90 | 89 | } |
91 | - } |
|
92 | - else |
|
90 | + } else |
|
93 | 91 | { |
94 | 92 | $t3context = GeneralUtility::makeInstance( 'TYPO3\CMS\Core\Context\Context' ); |
95 | 93 | |
@@ -311,8 +309,7 @@ discard block |
||
311 | 309 | { |
312 | 310 | $i18n = \Aimeos\Aimeos\Base::getI18n( [$langid], $local ); |
313 | 311 | $translation = $i18n[$langid]; |
314 | - } |
|
315 | - else |
|
312 | + } else |
|
316 | 313 | { |
317 | 314 | $translation = new \Aimeos\MW\Translation\None( 'en' ); |
318 | 315 | } |
@@ -79,8 +79,7 @@ discard block |
||
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 | } |
@@ -158,13 +157,14 @@ discard block |
||
158 | 157 | { |
159 | 158 | \Composer\Factory::createHttpDownloader( $event->getIO(), $config ) |
160 | 159 | ->get( 'https://api.github.com/graphql', $options ); |
161 | - } |
|
162 | - else |
|
160 | + } else |
|
163 | 161 | { |
164 | 162 | \Composer\Factory::createRemoteFilesystem( $event->getIO(), $config ) |
165 | 163 | ->getContents( 'github.com', 'https://api.github.com/graphql', false, $options ); |
166 | 164 | } |
167 | 165 | } |
168 | - catch( \Exception $e ) {} |
|
166 | + catch( \Exception $e ) |
|
167 | + { |
|
168 | +} |
|
169 | 169 | } |
170 | 170 | } |
@@ -88,9 +88,12 @@ |
||
88 | 88 | { |
89 | 89 | $localeManager = \Aimeos\MShop::create( $context, 'locale' ); |
90 | 90 | |
91 | - try { |
|
91 | + try |
|
92 | + { |
|
92 | 93 | $localeItem = $localeManager->bootstrap( $site, '', '', false, null, true ); |
93 | - } catch( \Aimeos\MShop\Exception $e ) { |
|
94 | + } |
|
95 | + catch( \Aimeos\MShop\Exception $e ) |
|
96 | + { |
|
94 | 97 | $localeItem = $localeManager->create(); |
95 | 98 | } |
96 | 99 |
@@ -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 | $output->writeln( sprintf( "Error <error>%s</error> while initializing or updating the Aimeos database\n<debug>%s</debug>", $t->getMessage(), $t->getTraceAsString() ) ); |
78 | 81 | |
79 | 82 | return 1; |
@@ -7,8 +7,7 @@ |
||
7 | 7 | use Symfony\Component\DependencyInjection\Reference; |
8 | 8 | |
9 | 9 | |
10 | -return function( ContainerConfigurator $configurator, ContainerBuilder $containerBuilder ) |
|
11 | -{ |
|
10 | +return function( ContainerConfigurator $configurator, ContainerBuilder $containerBuilder ) { |
|
12 | 11 | $services = $configurator->services(); |
13 | 12 | |
14 | 13 | if( \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded( 'aimeos' ) ) |
@@ -1,61 +1,61 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | if (!defined('TYPO3_MODE')) { |
4 | - die('Access denied.'); |
|
4 | + die('Access denied.'); |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | $beUsersSiteFcn = function () { |
8 | - $table = 'mshop_locale_site'; |
|
9 | - $tableConnection = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
10 | - \TYPO3\CMS\Core\Database\ConnectionPool::class |
|
11 | - )->getConnectionForTable($table); |
|
12 | - |
|
13 | - $queryBuilder = $tableConnection->createQueryBuilder(); |
|
14 | - $list = [['', '']]; |
|
15 | - |
|
16 | - if (empty($tableConnection->getSchemaManager()->listTableColumns($table)) !== true) { |
|
17 | - $result = $queryBuilder->select('siteid', 'label', 'nleft', 'nright') |
|
18 | - ->from($table) |
|
19 | - ->orderBy('nleft') |
|
20 | - ->execute(); |
|
21 | - |
|
22 | - $parents = []; |
|
23 | - |
|
24 | - $fcn = function ($result, $parents, $right) use (&$fcn, &$list) { |
|
25 | - while ($row = $result->fetch()) { |
|
26 | - $list[] = [join(' > ', array_merge($parents, [$row['label']])), $row['siteid']]; |
|
27 | - |
|
28 | - if ($row['nright'] - $row['nleft'] > 1) { |
|
29 | - $fcn($result, array_merge($parents, [$row['label']]), $row['nright']); |
|
30 | - } |
|
31 | - |
|
32 | - if ($row['nright'] + 1 == $right) { |
|
33 | - return; |
|
34 | - } |
|
35 | - } |
|
36 | - }; |
|
37 | - |
|
38 | - while ($row = $result->fetch()) { |
|
39 | - $list[] = [$row['label'], $row['siteid']]; |
|
40 | - |
|
41 | - if ($row['nright'] - $row['nleft'] > 1) { |
|
42 | - $fcn($result, array_merge($parents, [$row['label']]), $row['nright']); |
|
43 | - } |
|
44 | - } |
|
45 | - } |
|
46 | - |
|
47 | - return $list; |
|
8 | + $table = 'mshop_locale_site'; |
|
9 | + $tableConnection = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
|
10 | + \TYPO3\CMS\Core\Database\ConnectionPool::class |
|
11 | + )->getConnectionForTable($table); |
|
12 | + |
|
13 | + $queryBuilder = $tableConnection->createQueryBuilder(); |
|
14 | + $list = [['', '']]; |
|
15 | + |
|
16 | + if (empty($tableConnection->getSchemaManager()->listTableColumns($table)) !== true) { |
|
17 | + $result = $queryBuilder->select('siteid', 'label', 'nleft', 'nright') |
|
18 | + ->from($table) |
|
19 | + ->orderBy('nleft') |
|
20 | + ->execute(); |
|
21 | + |
|
22 | + $parents = []; |
|
23 | + |
|
24 | + $fcn = function ($result, $parents, $right) use (&$fcn, &$list) { |
|
25 | + while ($row = $result->fetch()) { |
|
26 | + $list[] = [join(' > ', array_merge($parents, [$row['label']])), $row['siteid']]; |
|
27 | + |
|
28 | + if ($row['nright'] - $row['nleft'] > 1) { |
|
29 | + $fcn($result, array_merge($parents, [$row['label']]), $row['nright']); |
|
30 | + } |
|
31 | + |
|
32 | + if ($row['nright'] + 1 == $right) { |
|
33 | + return; |
|
34 | + } |
|
35 | + } |
|
36 | + }; |
|
37 | + |
|
38 | + while ($row = $result->fetch()) { |
|
39 | + $list[] = [$row['label'], $row['siteid']]; |
|
40 | + |
|
41 | + if ($row['nright'] - $row['nleft'] > 1) { |
|
42 | + $fcn($result, array_merge($parents, [$row['label']]), $row['nright']); |
|
43 | + } |
|
44 | + } |
|
45 | + } |
|
46 | + |
|
47 | + return $list; |
|
48 | 48 | }; |
49 | 49 | |
50 | 50 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('be_users', [ |
51 | - 'siteid' => [ |
|
52 | - 'label' => 'LLL:EXT:aimeos/Resources/Private/Language/admin.xlf:be_users_site.title', |
|
53 | - 'config' => [ |
|
54 | - 'type' => 'select', |
|
55 | - 'renderType' => 'selectSingle', |
|
56 | - 'items' => $beUsersSiteFcn(), |
|
57 | - ] |
|
58 | - ] |
|
51 | + 'siteid' => [ |
|
52 | + 'label' => 'LLL:EXT:aimeos/Resources/Private/Language/admin.xlf:be_users_site.title', |
|
53 | + 'config' => [ |
|
54 | + 'type' => 'select', |
|
55 | + 'renderType' => 'selectSingle', |
|
56 | + 'items' => $beUsersSiteFcn(), |
|
57 | + ] |
|
58 | + ] |
|
59 | 59 | ]); |
60 | 60 | |
61 | 61 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('be_users', 'siteid', '', 'after:password'); |
@@ -1,45 +1,45 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('TYPO3_MODE')) { |
|
4 | - die('Access denied.'); |
|
3 | +if( !defined( 'TYPO3_MODE' ) ) { |
|
4 | + die( 'Access denied.' ); |
|
5 | 5 | } |
6 | 6 | |
7 | -$beUsersSiteFcn = function () { |
|
7 | +$beUsersSiteFcn = function() { |
|
8 | 8 | $table = 'mshop_locale_site'; |
9 | 9 | $tableConnection = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( |
10 | 10 | \TYPO3\CMS\Core\Database\ConnectionPool::class |
11 | - )->getConnectionForTable($table); |
|
11 | + )->getConnectionForTable( $table ); |
|
12 | 12 | |
13 | 13 | $queryBuilder = $tableConnection->createQueryBuilder(); |
14 | 14 | $list = [['', '']]; |
15 | 15 | |
16 | - if (empty($tableConnection->getSchemaManager()->listTableColumns($table)) !== true) { |
|
17 | - $result = $queryBuilder->select('siteid', 'label', 'nleft', 'nright') |
|
18 | - ->from($table) |
|
19 | - ->orderBy('nleft') |
|
16 | + if( empty( $tableConnection->getSchemaManager()->listTableColumns( $table ) ) !== true ) { |
|
17 | + $result = $queryBuilder->select( 'siteid', 'label', 'nleft', 'nright' ) |
|
18 | + ->from( $table ) |
|
19 | + ->orderBy( 'nleft' ) |
|
20 | 20 | ->execute(); |
21 | 21 | |
22 | 22 | $parents = []; |
23 | 23 | |
24 | - $fcn = function ($result, $parents, $right) use (&$fcn, &$list) { |
|
25 | - while ($row = $result->fetch()) { |
|
26 | - $list[] = [join(' > ', array_merge($parents, [$row['label']])), $row['siteid']]; |
|
24 | + $fcn = function( $result, $parents, $right ) use ( &$fcn, &$list ) { |
|
25 | + while( $row = $result->fetch() ) { |
|
26 | + $list[] = [join( ' > ', array_merge( $parents, [$row['label']] ) ), $row['siteid']]; |
|
27 | 27 | |
28 | - if ($row['nright'] - $row['nleft'] > 1) { |
|
29 | - $fcn($result, array_merge($parents, [$row['label']]), $row['nright']); |
|
28 | + if( $row['nright'] - $row['nleft'] > 1 ) { |
|
29 | + $fcn( $result, array_merge( $parents, [$row['label']] ), $row['nright'] ); |
|
30 | 30 | } |
31 | 31 | |
32 | - if ($row['nright'] + 1 == $right) { |
|
32 | + if( $row['nright'] + 1 == $right ) { |
|
33 | 33 | return; |
34 | 34 | } |
35 | 35 | } |
36 | 36 | }; |
37 | 37 | |
38 | - while ($row = $result->fetch()) { |
|
38 | + while( $row = $result->fetch() ) { |
|
39 | 39 | $list[] = [$row['label'], $row['siteid']]; |
40 | 40 | |
41 | - if ($row['nright'] - $row['nleft'] > 1) { |
|
42 | - $fcn($result, array_merge($parents, [$row['label']]), $row['nright']); |
|
41 | + if( $row['nright'] - $row['nleft'] > 1 ) { |
|
42 | + $fcn( $result, array_merge( $parents, [$row['label']] ), $row['nright'] ); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | return $list; |
48 | 48 | }; |
49 | 49 | |
50 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('be_users', [ |
|
50 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns( 'be_users', [ |
|
51 | 51 | 'siteid' => [ |
52 | 52 | 'label' => 'LLL:EXT:aimeos/Resources/Private/Language/admin.xlf:be_users_site.title', |
53 | 53 | 'config' => [ |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | 'items' => $beUsersSiteFcn(), |
57 | 57 | ] |
58 | 58 | ] |
59 | -]); |
|
59 | +] ); |
|
60 | 60 | |
61 | -\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('be_users', 'siteid', '', 'after:password'); |
|
61 | +\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes( 'be_users', 'siteid', '', 'after:password' ); |
|
62 | 62 |