public function render()
    {
        $table = $this->arguments['table'];
        $type = $this->arguments['type'];

        if (empty($GLOBALS['TCA'][$table])) {
            return [];
        }

        $fields = [];
        if ($type === 'Tab') {
            $fields = $this->fieldHelper->getFieldsByType($type, $table);
        } else {
            if (in_array($table, ['tt_content', 'pages'])) {
                foreach ($GLOBALS['TCA'][$table]['columns'] as $tcaField => $tcaConfig) {
                    if ($table === 'tt_content' || ($table === 'pages' && strpos($tcaField, 'tx_mask_') === 0)) {
                        $fieldType = $this->fieldHelper->getFormType($tcaField, '', $table);
                        if (($fieldType === $type || ($fieldType === 'Text' && $type === 'Richtext'))
                            && !in_array($tcaField, self::$forbiddenFields, true)
                        ) {
                            $fields[] = [
                                'field' => $tcaField,
                                'label' => $tcaConfig['label'],
                            ];
                        }
                    }
                }
            }
        }
        return $fields;
    }