Project

General

Profile

Bug #24992 » 17529v2.diff

Administrator Admin, 2011-02-22 18:18

View differences:

t3lib/class.t3lib_befunc.php (working copy)
* @param string items-array value to match
* @return string Label for item entry
*/
public static function getLabelFromItemlist($table, $col, $key) {
public static function getLabelFromItemlist($table, $col, $key, $pid = 0) {
global $TCA;
// Load full TCA for $table
t3lib_div::loadTCA($table);
// Check, if there is an "items" array:
$row['pid'] = $pid;
if (isset($TCA[$table]['columns'][$col]['config']['itemsProcFunc'])) {
$TCA[$table]['columns'][$col]['config']['items'] = t3lib_TCEforms::procItems($TCA[$table]['columns'][$col]['config']['items'], $TCA[$table]['columns'][$col]['config']['itemsProcFunc'], $TCA[$table]['columns'][$col]['config'], $table, $row, $field);
}
// Check, if there is an "items" array:
if (is_array($TCA[$table]) && is_array($TCA[$table]['columns'][$col]) && is_array($TCA[$table]['columns'][$col]['config']['items'])) {
// Traverse the items-array...
foreach ($TCA[$table]['columns'][$col]['config']['items'] as $k => $v) {
t3lib/class.t3lib_positionmap.php (working copy)
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
}
return $this->printRecordMap($lines, $colPosArray);
return $this->printRecordMap($lines, $colPosArray, $pid);
}
/**
......
* @param array Column position array
* @return string HTML
*/
function printRecordMap($lines, $colPosArray) {
function printRecordMap($lines, $colPosArray, $pid = 0) {
$row1 = '';
$row2 = '';
$count = t3lib_div::intInRange(count($colPosArray), 1);
// Traverse the columns here:
foreach ($colPosArray as $kk => $vv) {
$row1 .= '<td align="center" width="' . round(100 / $count) . '%"><span class="uppercase"><strong>' .
$this->wrapColumnHeader($GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'colPos', $vv), 1), $vv) .
'</strong></span></td>';
$row2 .= '<td valign="top" nowrap="nowrap">' .
implode('<br />', $lines[$kk]) .
'</td>';
$backendLayout = t3lib_div::callUserFunction('EXT:cms/classes/class.tx_cms_backendlayout.php:tx_cms_BackendLayout->getSelectedBackendLayout', $pid, $this);
if (isset($backendLayout['__config']['backend_layout.'])) {
$table = '<div class="t3-gridContainer"><table border="0" cellspacing="1" cellpadding="4" width="100%" height="100%" id="typo3-ttContentList">';
$colCount = intval($backendLayout['__config']['backend_layout.']['colCount']);
$rowCount = intval($backendLayout['__config']['backend_layout.']['rowCount']);
$table .= '<colgroup>';
for ($i = 0; $i < $colCount; $i++) {
$table .= '<col style="width:' . (100 / $colCount) . '%"></col>';
}
$table .= '</colgroup>';
// cycle through rows
for ($row = 1; $row <= $rowCount; $row++) {
$rowConfig = $backendLayout['__config']['backend_layout.']['rows.'][$row . '.'];
if (!isset($rowConfig)) {
continue;
}
$table .= '<tr class="bgColor4">';
for ($col = 1; $col <= $colCount; $col++) {
$columnConfig = $rowConfig['columns.'][$col . '.'];
if (!isset($columnConfig)) {
continue;
}
// which tt_content colPos should be displayed inside this cell
$columnKey = intval($columnConfig['colPos']);
$colPosArrayKey = array_search(intval($columnConfig['colPos']), $colPosArray);
$head = $this->wrapColumnHeader($GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'colPos', $columnKey, $pid), 1), $columnKey);
// render the grid cell
$table .= '<td valign="top"' .
(isset($columnConfig['colspan']) ? ' colspan="' . $columnConfig['colspan'] . '"' : '') .
(isset($columnConfig['rowspan']) ? ' rowspan="' . $columnConfig['rowspan'] . '"' : '') .
' class="t3-gridCell t3-page-column t3-page-column-' . $columnKey .
(!isset($columnConfig['colPos']) ? ' t3-gridCell-unassigned' : '') .
((isset($columnConfig['colPos']) && ! $head) ? ' t3-gridCell-restricted' : '') .
(isset($columnConfig['colspan']) ? ' t3-gridCell-width' . $columnConfig['colspan'] : '') .
(isset($columnConfig['rowspan']) ? ' t3-gridCell-height' . $columnConfig['rowspan'] : '') . '">';
if (isset($columnConfig['colPos']) && $head) {
$table .= '<div class="t3-page-colHeader t3-row-header">'. $head . '</div>' . implode('<br />', $lines[$colPosArrayKey]);
} else if ($columnConfig['colPos']) {
$table .= $this->wrapColumnHeader($GLOBALS['LANG']->getLL('noAccess'), '', '');
} else {
$table .= $this->wrapColumnHeader($GLOBALS['LANG']->getLL('notAssigned'), '', '');
}
$table .= '</td>';
}
$table .= '</tr>';
}
$table .= '</table></div>';
} else {
// Traverse the columns here:
foreach ($colPosArray as $kk => $vv) {
$row1 .= '<td align="center" width="' . round(100 / $count) . '%"><div class="t3-page-colHeader t3-row-header">' .
$this->wrapColumnHeader($GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'colPos', $vv, $pid), 1), $vv) .
'</div></td>';
$row2 .= '<td valign="top" nowrap="nowrap">' .
implode('<br />', $lines[$kk]) .
'</td>';
}
$table = '
<!--
Map of records in columns:
-->
<table border="0" cellpadding="0" cellspacing="1" id="typo3-ttContentList">
<tr>' . $row1 . '</tr>
<tr>' . $row2 . '</tr>
</table>
';
}
$table = '
<!--
Map of records in columns:
-->
<table border="0" cellpadding="0" cellspacing="1" id="typo3-ttContentList">
<tr class="bgColor5">' . $row1 . '</tr>
<tr>' . $row2 . '</tr>
</table>
';
return $this->JSimgFunc('2') . $table;
}
typo3/move_el.php (working copy)
// Load SHARED page-TSconfig settings and retrieve column list from there, if applicable:
$modTSconfig_SHARED = t3lib_BEfunc::getModTSconfig($this->page_id,'mod.SHARED'); // SHARED page-TSconfig settings.
$colPosList = strcmp(trim($modTSconfig_SHARED['properties']['colPos_list']),'') ? trim($modTSconfig_SHARED['properties']['colPos_list']) : '1,0,2,3';
$colPosArray = t3lib_div::callUserFunction('EXT:cms/classes/class.tx_cms_backendlayout.php:tx_cms_BackendLayout->getColPosListItemsParsed', $this->page_id, $this);
foreach ($colPosArray as $colPos) {
$colPosList .= $colPosList != '' ? ','.$colPos[1] : $colPos[1];
}
$colPosList = implode(',',array_unique(t3lib_div::intExplode(',',$colPosList))); // Removing duplicates, if any
// Adding parent page-header and the content element columns from position-map:
$code=$hline.'<br />';
$code.=$posMap->printContentElementColumns($this->page_id,$this->moveUid,$colPosList,1,$this->R_URI);
typo3/sysext/cms/layout/class.tx_cms_layout.php (working copy)
$parser = t3lib_div::makeInstance('t3lib_TSparser');
$parser->parse($backendLayoutRecord['config']);
$grid .= '<div class="t3-gridContainer"><table border="0" cellspacing="1" cellpadding="4" width="100%" height="100%" class="t3-page-columns t3-gridTable">';
$grid = '<div class="t3-gridContainer"><table border="0" cellspacing="1" cellpadding="4" width="100%" height="100%" class="t3-page-columns t3-gridTable">';
// add colgroups
$colCount = intval($parser->setup['backend_layout.']['colCount']);
(2-2/2)