Passed
Push — typo3_11 ( 38eed7...bd8716 )
by Torben
44:35
created

PiuserregPreviewRenderer::setCategorySettings()   A

Complexity

Conditions 4
Paths 5

Size

Total Lines 19
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 4
eloc 13
c 1
b 0
f 0
nc 5
nop 2
dl 0
loc 19
rs 9.8333
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Extension "sf_event_mgt" for TYPO3 CMS.
7
 *
8
 * For the full copyright and license information, please read the
9
 * LICENSE.txt file that was distributed with this source code.
10
 */
11
12
namespace DERHANSEN\SfEventMgt\Preview;
13
14
use TYPO3\CMS\Backend\View\BackendLayout\Grid\GridColumnItem;
15
use TYPO3\CMS\Core\Utility\GeneralUtility;
16
17
class PiuserregPreviewRenderer extends AbstractPluginPreviewRenderer
18
{
19
    public function renderPageModulePreviewContent(GridColumnItem $item): string
20
    {
21
        $data = [];
22
        $record = $item->getRecord();
23
        $flexFormData = GeneralUtility::xml2array($record['pi_flexform']);
24
        $pluginName = $this->getPluginName($record);
25
26
        $this->setPluginPidConfig($data, $flexFormData, 'registrationPid', 'sDEF');
27
        $this->setStoragePage($data, $flexFormData, 'settings.userRegistration.storagePage');
28
        $this->setOrderSettings(
29
            $data,
30
            $flexFormData,
31
            'settings.userRegistration.orderField',
32
            'settings.userRegistration.orderDirection'
33
        );
34
35
        return $this->renderAsTable($data, $pluginName);
36
    }
37
}
38