Project

General

Profile

Bug #17107 » 0005186_4.4trunk-rev6782.patch

Administrator Admin, 2010-01-16 19:00

View differences:

typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php (working copy)
}
}
// All columns have the same width:
$defaultColumnWidth = ceil(($maxW-$colspacing*($colCount-1)-$colCount*$border*($borderThickness+$borderSpace)*2)/$colCount);
// Base value of a single column, assuming that all columns have the same width.
$defaultColumnWidth = ceil(($maxW - $colspacing * ($colCount - 1) - $colCount * $border * ($borderThickness + $borderSpace) * 2) / $colCount);
// Specify the maximum width for each column
// Collect the maximum width for each column
$columnWidths = array();
$colRelations = trim($this->cObj->stdWrap($conf['colRelations'],$conf['colRelations.']));
if (!$colRelations) {
// Default 1:1-proportion, all columns same width
for ($a=0;$a<$colCount;$a++) {
$columnWidths[$a] = $defaultColumnWidth;
$colRelations = trim($this->cObj->stdWrap($conf['colRelations'], $conf['colRelations.']));
if (!$colRelations) {
// All columns have the same width ("1:1"-proportion)
// Since the base value of a single column is ceiled, the sum of all columns may overrun maxW
$allColumnsWidthOverrun = ($colCount - ($maxW - $colspacing * ($colCount - 1) - $colCount * $border * ($borderThickness + $borderSpace) * 2) % $colCount) % $colCount;
// reduceIterator is set to 2 if reducing every second column's width by 1 is sufficient to get rid of the overrun
$reduceIterator = ($allColumnsWidthOverrun * 2 <= $colCount) ? 2 : 1;
for ($a = 0; $a < $colCount; $a++) {
if ($allColumnsWidthOverrun > 0 && $a % $reduceIterator == 0) {
// Reduce width of column to get rid of the overrun
$columnWidths[$a] = $defaultColumnWidth - 1;
$allColumnsWidthOverrun--;
} else {
$columnWidths[$a] = $defaultColumnWidth;
}
}
} else {
// We need another proportion
(7-7/12)