public function checkForAllowedCTypes(array &$items, $pageId, $pageColumn, $gridContainerId, $gridColumn)
    {
        $allowed = [];
        $disallowed = [];
        if ((int)$pageColumn >= 0 || (int)$pageColumn === -2) {
            $column = $pageColumn ? $pageColumn : 0;
            $layout = $this->getSelectedBackendLayout($pageId);
        } else {
            $this->init($pageId);
            $column = $gridColumn ? (int)$gridColumn : 0;
            $gridElement = $this->layoutSetup->cacheCurrentParent($gridContainerId, true);
            $layout = $this->layoutSetup->getLayoutSetup($gridElement['tx_gridelements_backend_layout']);
        }
        if (!empty($layout)) {
            if (is_array($layout['allowed']) && is_array($layout['allowed'][$column]) && !empty($layout['allowed'][$column]['CType'])) {
                $allowed = $layout['allowed'][$column]['CType'];
            }
            if (is_array($layout['disallowed']) && is_array($layout['disallowed'][$column]) && !empty($layout['disallowed'][$column]['CType'])) {
                $disallowed = $layout['disallowed'][$column]['CType'];
            }
        }
        if (isset($layout) &&  (!empty($allowed) || !empty($disallowed))) {
            foreach ($items as $key => $item) {
                if ((
                        !empty($allowed) &&
                        !isset($allowed['*']) &&
                        !isset($allowed[$item[1]])
                    ) ||
                    (
                        !empty($disallowed) &&
                        (
                            isset($disallowed['*']) ||
                            isset($disallowed[$item[1]])
                        )
                    )) {
                    unset($items[$key]);
                }
            }
        }
    }
public function checkForAllowedCTypes(array &$items, $pageId, $pageColumn, $gridContainerId, $gridColumn)
    {
        $allowed = [];
        $disallowed = [];
        if ((int)$pageColumn >= 0 || (int)$pageColumn === -2) {
            $column = $pageColumn ? $pageColumn : 0;
            $layout = $this->getSelectedBackendLayout($pageId);
        } else {
            $this->init($pageId);
            $column = $gridColumn ? (int)$gridColumn : 0;
            $gridElement = $this->layoutSetup->cacheCurrentParent($gridContainerId, true);
            $layout = $this->layoutSetup->getLayoutSetup($gridElement['tx_gridelements_backend_layout']);
        }
        if (!empty($layout)) {
            if (is_array($layout['allowed']) && is_array($layout['allowed'][$column]) && !empty($layout['allowed'][$column]['CType'])) {
                $allowed = $layout['allowed'][$column]['CType'];
            }
            if (is_array($layout['disallowed']) && is_array($layout['disallowed'][$column]) && !empty($layout['disallowed'][$column]['CType'])) {
                $disallowed = $layout['disallowed'][$column]['CType'];
            }
        }
        if (isset($layout) &&  (!empty($allowed) || !empty($disallowed))) {
            foreach ($items as $key => $item) {
                if ((
                        !empty($allowed) &&
                        !isset($allowed['*']) &&
                        !isset($allowed[$item[1]])
                    ) ||
                    (
                        !empty($disallowed) &&
                        (
                            isset($disallowed['*']) ||
                            isset($disallowed[$item[1]])
                        )
                    )) {
                    unset($items[$key]);
                }
            }
        }
    }
public function checkForAllowedCTypes ( array & $ items , $ pageId , $ pageColumn , $ gridContainerId , $ gridColumn ) { $ allowed = [ ] ; $ disallowed = [ ] ; if ( ( int ) $ pageColumn >= 0 || ( int ) $ pageColumn === - 2 ) { $ column = $ pageColumn ? $ pageColumn : 0 ; $ layout = $ this -> getSelectedBackendLayout ( $ pageId ) ; } else { $ this -> init ( $ pageId ) ; $ column = $ gridColumn ? ( int ) $ gridColumn : 0 ; $ gridElement = $ this -> layoutSetup -> cacheCurrentParent ( $ gridContainerId , true ) ; $ layout = $ this -> layoutSetup -> getLayoutSetup ( $ gridElement [ 'tx_gridelements_backend_layout' ] ) ; } if ( ! empty ( $ layout ) ) { if ( is_array ( $ layout [ 'allowed' ] ) && is_array ( $ layout [ 'allowed' ] [ $ column ] ) && ! empty ( $ layout [ 'allowed' ] [ $ column ] [ 'CType' ] ) ) { $ allowed = $ layout [ 'allowed' ] [ $ column ] [ 'CType' ] ; } if ( is_array ( $ layout [ 'disallowed' ] ) && is_array ( $ layout [ 'disallowed' ] [ $ column ] ) && ! empty ( $ layout [ 'disallowed' ] [ $ column ] [ 'CType' ] ) ) { $ disallowed = $ layout [ 'disallowed' ] [ $ column ] [ 'CType' ] ; } } if ( isset ( $ layout ) && ( ! empty ( $ allowed ) || ! empty ( $ disallowed ) ) ) { foreach ( $ items as $ key => $ item ) { if ( ( ! empty ( $ allowed ) && ! isset ( $ allowed [ '*' ] ) && ! isset ( $ allowed [ $ item [ 1 ] ] ) ) || ( ! empty ( $ disallowed ) && ( isset ( $ disallowed [ '*' ] ) || isset ( $ disallowed [ $ item [ 1 ] ] ) ) ) ) { unset ( $ items [ $ key ] ) ; } } } }
Checks if a CType is allowed in this particular page or grid column - only this one column defines the allowed CTypes regardless of any parent column

@param array $items The items of the current CType list
@param int $pageId The id of the page we are currently working on
@param int $pageColumn The page column the element is a child of
@param int $gridContainerId The ID of the current container
@param int $gridColumn The grid column the element is a child of
Checks if a CType is allowed in this particular page or grid column - only this one column defines the allowed CTypes regardless of any parent column