@@ -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 |