<?php
/**
 * @author Carsten Rose <carsten.rose@math.uzh.ch>
 */

if (!defined('TYPO3_MODE')) {
    die ('Access denied.');
}

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    'IMATHUZH.' . $_EXTKEY,
    'Qfq',
    'QFQ Element',
    'EXT:qfq/ext_icon.png'
);

/*
 * The type name is generated by combining the extension key and plugin name, all lowercase and concatenated with `_'
 */

$GLOBALS['TCA']['tt_content']['palettes']['introheader']['showitem'] = 'header, CType';
$GLOBALS['TCA']['tt_content']['palettes']['startendtime']['showitem'] = 'starttime, endtime';
$GLOBALS['TCA']['tt_content']['palettes']['layoutpalette1']['showitem'] = 'colPos, header_position, sys_language_uid';
$GLOBALS['TCA']['tt_content']['palettes']['layoutpalette2']['showitem'] = 'layout, header_layout';
$GLOBALS['TCA']['tt_content']['palettes']['spacearound']['showitem'] = 'spaceBefore, spaceAfter';

$GLOBALS['TCA']['tt_content']['types']['qfq_qfq'] = array(
    'showitem' => '
        --div--;General,
          --palette--;;introheader,
          custom,
          bodytext;Code:;;nowrap,
        --div--;Access,
          hidden, fe_group, deleted, --palette--;;startendtime,
        --div--;Appearance,
          --palette--;;layoutpalette1,
          --palette--;;layoutpalette2,
          --palette--;;spacearound,
          linkToTop, section_frame, sectionIndex',
    'columnsOverrides' => [
        'bodytext' => [
            'config' => [
                'renderType' => 't3editor',
                'format' => 'sparql',
                'rows' => 100
            ]
        ]
    ]
);