47 $this->initializeDataProviderCollection();
55 protected function initializeDataProviderCollection() {
58 'TYPO3\\CMS\\Backend\\View\\BackendLayout\\DataProviderCollection' 63 'TYPO3\\CMS\\Backend\\View\\BackendLayout\\DefaultDataProvider' 66 if (!empty(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'BackendLayoutDataProvider'])) {
67 $dataProviders = (array)
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'BackendLayoutDataProvider'];
68 foreach ($dataProviders as $identifier => $className) {
98 $pageId = $this->
determinePageId($parameters[
'table'], $parameters[
'row']);
104 ->setData($parameters[
'row'])
105 ->setTableName($parameters[
'table'])
106 ->setFieldName($parameters[
'field'])
107 ->setPageTsConfig($pageTsConfig);
110 foreach ($backendLayoutCollections as $backendLayoutCollection) {
111 $combinedIdentifierPrefix =
'';
112 if ($backendLayoutCollection->getIdentifier() !==
'default') {
113 $combinedIdentifierPrefix = $backendLayoutCollection->getIdentifier() .
'__';
116 foreach ($backendLayoutCollection->getAll() as $backendLayout) {
117 $combinedIdentifier = $combinedIdentifierPrefix . $backendLayout->getIdentifier();
119 if (in_array($combinedIdentifier, $identifiersToBeExcluded, TRUE)) {
123 $parameters[
'items'][] = array(
126 $backendLayout->getIconPath(),
142 if (strpos($data[
'uid'],
'NEW') === 0) {
145 if ($data[
'pid'] < 0) {
147 'pid', $tableName,
'uid=' . abs($data[
'pid'])
149 if ($existingElement !== NULL) {
150 $pageId = $existingElement[
'pid'];
153 $pageId = $data[
'pid'];
155 } elseif ($tableName ===
'pages') {
156 $pageId = $data[
'uid'];
158 $pageId = $data[
'pid'];
171 if (!isset($this->selectedCombinedIdentifier[$pageId])) {
172 $page = $this->
getPage($pageId);
173 $this->selectedCombinedIdentifier[$pageId] = (string) $page[
'backend_layout'];
175 if ($this->selectedCombinedIdentifier[$pageId] ===
'-1') {
177 $this->selectedCombinedIdentifier[$pageId] = FALSE;
178 } elseif ($this->selectedCombinedIdentifier[$pageId] ===
'' || $this->selectedCombinedIdentifier[$pageId] ===
'0') {
183 array_shift($rootLine);
184 array_pop($rootLine);
185 foreach ($rootLine as $rootLinePage) {
186 $this->selectedCombinedIdentifier[$pageId] = (string) $rootLinePage[
'backend_layout_next_level'];
187 if ($this->selectedCombinedIdentifier[$pageId] ===
'-1') {
189 $this->selectedCombinedIdentifier[$pageId] = FALSE;
191 } elseif ($this->selectedCombinedIdentifier[$pageId] !==
'' && $this->selectedCombinedIdentifier[$pageId] !==
'0') {
199 return $this->selectedCombinedIdentifier[$pageId];
209 $identifiersToBeExcluded = array();
219 return $identifiersToBeExcluded;
231 $pageId = $this->
determinePageId($parameters[
'table'], $parameters[
'row']);
233 if ($pageId !== NULL) {
246 $layout = $this->getSelectedBackendLayout($pageId);
247 if ($layout && $layout[
'__items']) {
248 $items = $layout[
'__items'];
259 public function getColPosListItemsParsed($id) {
261 $tcaConfig =
$GLOBALS[
'TCA'][
'tt_content'][
'columns'][
'colPos'][
'config'];
264 $tcaItems = $tcaConfig[
'items'];
265 $tcaItems = $tceForms->addItems($tcaItems, $tsConfig[
'properties'][
'addItems.']);
266 if (isset($tcaConfig[
'itemsProcFunc']) && $tcaConfig[
'itemsProcFunc']) {
270 foreach ($tcaItems as $key => $item) {
271 if ($item[1] == $removeId) {
272 unset($tcaItems[$key]);
285 public function getSelectedBackendLayout($pageId) {
286 if (isset($this->selectedBackendLayout[$pageId])) {
287 return $this->selectedBackendLayout[$pageId];
289 $backendLayoutData = NULL;
299 if (is_null($backendLayout)) {
304 if (!empty($backendLayout)) {
308 $conditionMatcher =
GeneralUtility::makeInstance(
'TYPO3\\CMS\\Backend\\Configuration\\TypoScript\\ConditionMatching\\ConditionMatcher');
309 $parser->parse($parser->checkIncludeLines($backendLayout->getConfiguration()), $conditionMatcher);
311 $backendLayoutData = array();
312 $backendLayoutData[
'config'] = $backendLayout->getConfiguration();
313 $backendLayoutData[
'__config'] = $parser->setup;
314 $backendLayoutData[
'__items'] = array();
315 $backendLayoutData[
'__colPosList'] = array();
318 if (!empty($backendLayoutData[
'__config'][
'backend_layout.'][
'rows.'])) {
319 foreach ($backendLayoutData[
'__config'][
'backend_layout.'][
'rows.'] as $row) {
320 if (!empty($row[
'columns.'])) {
321 foreach ($row[
'columns.'] as $column) {
322 $backendLayoutData[
'__items'][] = array(
327 $backendLayoutData[
'__colPosList'][] = $column[
'colPos'];
333 $this->selectedBackendLayout[$pageId] = $backendLayoutData;
336 return $backendLayoutData;
354 name = LLL:EXT:cms/locallang_ttc.xlf:colPos.I.0 358 name = LLL:EXT:cms/locallang_ttc.xlf:colPos.I.1 362 name = LLL:EXT:cms/locallang_ttc.xlf:colPos.I.2 366 name = LLL:EXT:cms/locallang_ttc.xlf:colPos.I.3 384 'uid, pid, backend_layout',
386 'uid=' . (
int)$pageId
407 'TYPO3\\CMS\\Backend\\View\\BackendLayout\\DataProviderContext'
static getModTSconfig($id, $TSref)
static getDefaultColumnLayout()
addColPosListLayoutItems($pageId, $items)
static BEgetRootLine($uid, $clause='', $workspaceOL=FALSE)
static getValueByPath(array $array, $path, $delimiter='/')
static isFirstPartOfStr($str, $partStr)
determinePageId($tableName, array $data)
static workspaceOL($table, &$row, $wsid=-99, $unsetMovePointers=FALSE)
getDataProviderCollection()
$selectedCombinedIdentifier
getSelectedCombinedIdentifier($pageId)
static makeInstance($className)
addBackendLayoutItems(array $parameters)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
getIdentifiersToBeExcluded(array $pageTSconfig)
setDataProviderCollection(BackendLayout\DataProviderCollection $dataProviderCollection)
createDataProviderContext()
static isValidPath(array $array, $path, $delimiter='/')
colPosListItemProcFunc(array $parameters)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static getPagesTSconfig($id, $rootLine=NULL, $returnPartArray=FALSE)