• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FluidTYPO3 / flux / 30000959906

23 Jul 2026 10:52AM UTC coverage: 89.162% (-3.5%) from 92.657%
30000959906

push

github

NamelessCoder
[TER] 12.0.0

6228 of 6985 relevant lines covered (89.16%)

40.84 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.45
/Classes/Integration/HookSubscribers/ColumnPositionItems.php
1
<?php
2

3
namespace FluidTYPO3\Flux\Integration\HookSubscribers;
4

5
/*
6
 * This file is part of the FluidTYPO3/Flux project under GPLv2 or later.
7
 *
8
 * For the full copyright and license information, please read the
9
 * LICENSE.md file that was distributed with this source code.
10
 */
11

12
use FluidTYPO3\Flux\Provider\Interfaces\GridProviderInterface;
13
use FluidTYPO3\Flux\Provider\ProviderResolver;
14
use FluidTYPO3\Flux\Service\WorkspacesAwareRecordService;
15
use FluidTYPO3\Flux\Utility\ColumnNumberUtility;
16

17
class ColumnPositionItems
18
{
19
    private WorkspacesAwareRecordService $recordService;
20
    private ProviderResolver $providerResolver;
21

22
    public function __construct(WorkspacesAwareRecordService $recordService, ProviderResolver $providerResolver)
23
    {
24
        $this->recordService = $recordService;
16✔
25
        $this->providerResolver = $providerResolver;
16✔
26
    }
27

28
    /**
29
     * Gets colPos items to be shown in the forms engine.
30
     * This method is called as "itemsProcFunc" with the accordant context
31
     * for tt_content.colPos.
32
     */
33
    public function colPosListItemProcFunc(array &$parameters): void
34
    {
35
        if (!isset($parameters['row']['colPos']) || ((string) $parameters['row']['colPos']) === '') {
16✔
36
            return;
×
37
        }
38
        $parentRecordUid = ColumnNumberUtility::calculateParentUid($parameters['row']['colPos']);
16✔
39
        $parentRecord = $this->recordService->getSingle('tt_content', '*', $parentRecordUid);
16✔
40
        $provider = $this->providerResolver->resolvePrimaryConfigurationProvider('tt_content', null, $parentRecord);
16✔
41
        if ($parentRecord && $provider instanceof GridProviderInterface) {
16✔
42
            $grid = $provider->getGrid($parentRecord);
4✔
43
            $parameters['items'][] = [
4✔
44
                'label' => 'LLL:EXT:flux/Resources/Private/Language/locallang.xlf:flux.backendLayout.columnsInParent',
4✔
45
                'value' => '--div--',
4✔
46
            ];
4✔
47
            foreach ($grid->getRows() as $row) {
4✔
48
                foreach ($row->getColumns() as $column) {
4✔
49
                    $parameters['items'][] = [
4✔
50
                        'label' => $column->getLabel(),
4✔
51
                        'value' => ColumnNumberUtility::calculateColumnNumberForParentAndColumn(
4✔
52
                            $parentRecordUid,
4✔
53
                            $column->getColumnPosition()
4✔
54
                        ),
4✔
55
                    ];
4✔
56
                }
57
            }
58
        }
59
    }
60
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc