Project

General

Profile

Bug #17107 » 5186_4.3.alpha1.patch

Administrator Admin, 2008-12-22 23:31

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 all columns having 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) {
// 1:1-proportion, all columns have the same width.
// 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) {
$columnWidths[$a] = $defaultColumnWidth - 1;
$allColumnsWidthOverrun--;
} else {
$columnWidths[$a] = $defaultColumnWidth;
}
}
} else {
// We need another proportion
(6-6/12)