public function setPageTca($tca)
    {
        $fieldHelper = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('MASK\\Mask\\Helper\\FieldHelper');
        $prependTabs = "--div--;Content-Fields,";
        if ($tca) {
            $i = 0;
            foreach ($tca as $fieldKey => $config) {
                // no information about which element this field is for at this point
                $elements = $fieldHelper->getElementsWhichUseField($fieldKey, "pages");
                $element = $elements[0];

                // check if this field is of type tab
                $formType = $fieldHelper->getFormType($fieldKey, $element["key"], "pages");
                if ($formType == "Tab") {
                    $label = $fieldHelper->getLabel($element["key"], $fieldKey, "pages");
                    // if a tab is in the first position then change the name of the general tab
                    if ($i === 0) {
                        $prependTabs = '--div--;' . $label . ",";
                    } else {
                        // otherwise just add new tab
                        $fieldArray[] = '--div--;' . $label;
                    }
                } else {
                    $fieldArray[] = $fieldKey;
                }
                $i++;
            }
        }

        if (!empty($fieldArray)) {
            $pageFieldString = $prependTabs . implode(",", $fieldArray);
        } else {
            $pageFieldString = $prependTabs;
        }

        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', $pageFieldString);
    }
public function setPageTca($tca)
    {
        $fieldHelper = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('MASK\\Mask\\Helper\\FieldHelper');
        $prependTabs = "--div--;Content-Fields,";
        if ($tca) {
            $i = 0;
            foreach ($tca as $fieldKey => $config) {
                // no information about which element this field is for at this point
                $elements = $fieldHelper->getElementsWhichUseField($fieldKey, "pages");
                $element = $elements[0];

                // check if this field is of type tab
                $formType = $fieldHelper->getFormType($fieldKey, $element["key"], "pages");
                if ($formType == "Tab") {
                    $label = $fieldHelper->getLabel($element["key"], $fieldKey, "pages");
                    // if a tab is in the first position then change the name of the general tab
                    if ($i === 0) {
                        $prependTabs = '--div--;' . $label . ",";
                    } else {
                        // otherwise just add new tab
                        $fieldArray[] = '--div--;' . $label;
                    }
                } else {
                    $fieldArray[] = $fieldKey;
                }
                $i++;
            }
        }

        if (!empty($fieldArray)) {
            $pageFieldString = $prependTabs . implode(",", $fieldArray);
        } else {
            $pageFieldString = $prependTabs;
        }

        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', $pageFieldString);
    }
public function setPageTca ( $ tca ) { $ fieldHelper = \ TYPO3 \ CMS \ Core \ Utility \ GeneralUtility :: makeInstance ( 'MASK\\Mask\\Helper\\FieldHelper' ) ; $ prependTabs = "--div--;Content-Fields," ; if ( $ tca ) { $ i = 0 ; foreach ( $ tca as $ fieldKey => $ config ) { // no information about which element this field is for at this point $ elements = $ fieldHelper -> getElementsWhichUseField ( $ fieldKey , "pages" ) ; $ element = $ elements [ 0 ] ; // check if this field is of type tab $ formType = $ fieldHelper -> getFormType ( $ fieldKey , $ element [ "key" ] , "pages" ) ; if ( $ formType == "Tab" ) { $ label = $ fieldHelper -> getLabel ( $ element [ "key" ] , $ fieldKey , "pages" ) ; // if a tab is in the first position then change the name of the general tab if ( $ i === 0 ) { $ prependTabs = '--div--;' . $ label . "," ; } else { // otherwise just add new tab $ fieldArray [ ] = '--div--;' . $ label ; } } else { $ fieldArray [ ] = $ fieldKey ; } $ i ++ ; } } if ( ! empty ( $ fieldArray ) ) { $ pageFieldString = $ prependTabs . implode ( "," , $ fieldArray ) ; } else { $ pageFieldString = $ prependTabs ; } \ TYPO3 \ CMS \ Core \ Utility \ ExtensionManagementUtility :: addToAllTCAtypes ( 'pages' , $ pageFieldString ) ; }
Generates and sets the tca for all the extended pages

@param array $tca
@author Benjamin Butschell <bb@webprofil.at>
Generates and sets the tca for all the extended pages