protected function getWhiteAndBlackListsFromPageAndContentColumn($pageUid, $columnPosition, $relativeUid)
{
$whitelist = array();
$blacklist = array();
// if a Provider is registered for the "pages" table, try to get a Grid from it. If the Grid
// returned contains a Column which matches the desired colPos value, attempt to read a list
// of allowed/denied content element types from it.
$pageRecord = (array) $this->recordService->getSingle('pages', '*', $pageUid);
$pageProviders = $this->configurationService->resolveConfigurationProviders('pages', NULL, $pageRecord);
$this->appendToWhiteAndBlacklistFromProviders($pageProviders, $pageRecord, $whitelist, $blacklist, $columnPosition);
// Detect what was clicked in order to create the new content element; decide restrictions
// based on this. Returned parent UID and area name is either non-zero and string, or zero
// and NULL when record is NOT inserted as child.
list($parentRecordUid, $fluxAreaName) = $this->getAreaNameAndParentFromRelativeRecordOrDefaults($relativeUid);
// if these variables now indicate that we are inserting content elements into a Flux-enabled content
// area inside another content element, attempt to read allowed/denied content types from the
// Grid returned by the Provider that applies to the parent element's type and configuration
// (admitted, that's quite a mouthful - but it's not that different from reading the values from
// a page template like above; it's the same principle).
if (0 < $parentRecordUid && FALSE === empty($fluxAreaName)) {
$parentRecord = (array) $this->recordService->getSingle('tt_content', '*', $parentRecordUid);
$contentProviders = $this->configurationService->resolveConfigurationProviders('tt_content', NULL, $parentRecord);
$this->appendToWhiteAndBlacklistFromProviders($contentProviders, $parentRecord, $whitelist, $blacklist, NULL, $fluxAreaName);
}
// White/blacklist filtering. If whitelist contains elements, filter the list
// of possible types by whitelist first. Then apply the blacklist, removing
// any element types recorded herein.
$whitelist = array_unique($whitelist);
$blacklist = array_unique($blacklist);
return array($whitelist, $blacklist);
}