Commit f452e91e authored by Martin Kästner's avatar Martin Kästner Committed by Wouter Wolters
Browse files

[BUGFIX] Fix column layout for New Content Element wizard

If adding new content elements in Web>List with the CE wizard,
you get the old column layout & titles even if you have a complete
backend_layout working.

But for Moving Elements the Backend Layout is already correct.
Column titles are already in $tcaItems a few lines before
the lines in the patch for File PagePositionMap.php. Using this
values the backend_layout is correct in Web>List CE Wizard.

Resolves: #42457
Releases: master, 6.2
Change-Id: I5f57aeac493ec5db02aaa92bd9eab97390cdb967
Reviewed-on: http://review.typo3.org/16837


Tested-by: Stefan Froemken's avatarStefan Froemken <froemken@gmail.com>
Reviewed-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Tested-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
parent c6eb7676
......@@ -256,11 +256,12 @@ class NewContentElementController {
$this->content .= $this->doc->spacer(20);
// Select position
$code = $GLOBALS['LANG']->getLL('sel2', 1) . '<br /><br />';
// Load SHARED page-TSconfig settings and retrieve column list from there, if applicable:
$modTSconfig_SHARED = BackendUtility::getModTSconfig($this->id, 'mod.SHARED');
$colPosList = trim($modTSconfig_SHARED['properties']['colPos_list']) !== '' ? trim($modTSconfig_SHARED['properties']['colPos_list']) : '1,0,2,3';
$colPosList = implode(',', array_unique(GeneralUtility::intExplode(',', $colPosList)));
$colPosArray = GeneralUtility::callUserFunction('TYPO3\\CMS\\Backend\\View\\BackendLayoutView->getColPosListItemsParsed', $this->id, $this);
$colPosIds = array_column($colPosArray, 1);
// Removing duplicates, if any
$colPosList = implode(',', array_unique(array_map('intval', $colPosIds)));
// Finally, add the content of the column selector to the content:
$code .= $posMap->printContentElementColumns($this->id, 0, $colPosList, 1, $this->R_URI);
$this->content .= $this->doc->section($GLOBALS['LANG']->getLL('2_selectPosition'), $code, 0, 1);
......
......@@ -419,11 +419,9 @@ class PagePositionMap {
// Which tt_content colPos should be displayed inside this cell
$columnKey = (int)$columnConfig['colPos'];
$head = '';
$params = array();
$params['pid'] = $pid;
foreach ($tcaItems as $item) {
if ($item[1] == $columnKey) {
$head = $GLOBALS['LANG']->sL(BackendUtility::getLabelFromItemlist('tt_content', 'colPos', $columnKey, $params), TRUE);
$head = $GLOBALS['LANG']->sL($item[0], TRUE);
}
}
// Render the grid cell
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment