? diff
Index: typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php
===================================================================
RCS file: /cvsroot/typo3/TYPO3core/typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php,v
retrieving revision 1.5.2.7
diff -u -r1.5.2.7 class.tx_cssstyledcontent_pi1.php
--- typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php	22 Mar 2006 01:46:16 -0000	1.5.2.7
+++ typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php	27 Mar 2006 14:04:06 -0000
@@ -444,7 +444,7 @@
 			// Positioning
 		$position = $this->cObj->stdWrap($conf['textPos'], $conf['textPos.']);
 
-		$imagePosition = $position&7;	// 0,1,2 = center,left,right
+		$imagePosition = $position&7;	// 0,1,2 = center,right,left
 		$contentPosition = $position&24;	// 0,8,16,24 (above,below,intext,intext-wrap)
 		$align = $this->cObj->align[$imagePosition];
 		$textMargin = intval($this->cObj->stdWrap($conf['textMargin'],$conf['textMargin.']));
@@ -479,7 +479,6 @@
 
 			// Max Width
 		$maxW = intval($this->cObj->stdWrap($conf['maxW'], $conf['maxW.']));
-		$defaultW = intval($this->cObj->stdWrap($conf['defaultW'], $conf['defaultW.']));
 
 		if ($contentPosition>=16)	{	// in Text
 			$maxWInText = intval($this->cObj->stdWrap($conf['maxWInText'],$conf['maxWInText.']));
@@ -489,17 +488,10 @@
 			} else {
 				$maxW = $maxWInText;
 			}
-			$defaultW = intval($this->cObj->stdWrap($conf['defaultWInText'],$conf['defaultWInText.']));
-		}
-		if (!$defaultW)	{ $defaultW = $maxW; }
-
-			// Explicit setting in tt_content might override the maxW, if within the allowed limits
-		if ($this->cObj->data['imagewidth'] && $this->cObj->data['imagewidth'] <= $maxW)	{
-			$maxW = $this->cObj->data['imagewidth'];
 		}
 
 			// All columns have the same width:
-		$defaultColumnWidth = ceil(($maxW-$colspacing*($colCount-1)-$colCount*$border*$borderThickness*2)/$colCount);
+		$defaultColumnWidth = ceil(($maxW-$colspacing*($colCount-1)-$colCount*$border*($borderThickness+$borderSpace)*2)/$colCount);
 
 			// Specify the maximum width for each column
 		$columnWidths = array();
@@ -651,11 +643,8 @@
 			$imageRowsFinalWidths[floor($a/$colCount)] += $GLOBALS['TSFE']->lastImageInfo[0];
 		}
 			// How much space will the image-block occupy?
-		$imageBlockWidth = max($imageRowsFinalWidths)+ $colspacing*($colCount) + $colCount*$border*($borderSpace+$borderThickness)*2;
+		$imageBlockWidth = max($imageRowsFinalWidths)+ $colspacing*($colCount-1) + $colCount*$border*($borderSpace+$borderThickness)*2;
 		$GLOBALS['TSFE']->register['rowwidth'] = $imageBlockWidth;
-		foreach ($columnWidths as $a => $w)	{
-			$allColumnsWidth += $w + $colspacing + $border*($borderSpace+$borderThickness)*2;
-		}
 
 			// noRows is in fact just one ROW, with the amount of columns specified, where the images are placed in.
 			// noCols is just one COLUMN, each images placed side by side on each row
@@ -686,14 +675,26 @@
 		if ($noRows)	{ $separateRows = 0; }
 		if ($rowCount == 1)	{ $separateRows = 0; }
 
+			// Apply optionSplit to the list of classes that we want to add to each image
+		$addClassesImage = $conf['addClassesImage'];
+		if ($conf['addClassesImage.'])	{
+			$addClassesImage = $this->cObj->stdWrap($addClassesImageConf, $conf['addClassesImage.']);
+		}
+		$addClassesImageConf = $GLOBALS['TSFE']->tmpl->splitConfArray(array('addClassesImage' => $addClassesImage), $colCount);
+
 			// Render the images
 		$images = '';
 		for ($c = 0; $c < $imageWrapCols; $c++)	{
-			$GLOBALS['TSFE']->register['columnwidth'] = $columnWidths[$c] + $colspacing + $border*($borderSpace+$borderThickness)*2;
+			$tmpColspacing = $colspacing;
+			if (($c==$imageWrapCols-1 && $imagePosition==2) || ($c==0 && $imagePosition==1)) {
+				$tmpColspacing = 0;
+			}
+			$GLOBALS['TSFE']->register['columnwidth'] = $columnWidths[$c] + $tmpColspacing + $border*($borderSpace+$borderThickness)*2;
 			$thisImages = '';
 			$allRows = '';
 			for ($i = $c; $i<count($imgsTag); $i=$i+$imageWrapCols)	{
-				if ($separateRows && $i%$colCount == 0) {
+				$colPos = $i%$colCount;
+				if ($separateRows && $colPos == 0) {
 					$thisRow = '';
 				}
 
@@ -717,13 +718,18 @@
 					$thisImage .= $this->cObj->netprintApplication_offsiteLinkWrap($thisImage, $origImages[$i], $conf['netprintApplicationLink.']);
 				}
 				$thisImage = $this->cObj->stdWrap($thisImage, $conf['oneImageStdWrap.']);
+				$classes = '';
+				if ($addClassesImageConf[$colPos]['addClassesImage'])	{
+					$classes = ' ' . $addClassesImageConf[$colPos]['addClassesImage'];
+				}
+				$thisImage = str_replace('###CLASSES###', $classes, $thisImage);
 
 				if ($separateRows)	{
 					$thisRow .= $thisImage;
 				} else {
 					$allRows .= $thisImage;
 				}
-				if ($separateRows && ($i%$colCount == ($colCount-1) || $i+1==count($imgsTag)))	{
+				if ($separateRows && ($colPos == ($colCount-1) || $i+1==count($imgsTag)))	{
 					// Close this row at the end (colCount), or the last row at the final end
 					$allRows .= $this->cObj->stdWrap($thisRow, $conf['imageRowStdWrap.']);
 				}
Index: typo3/sysext/css_styled_content/static/constants.txt
===================================================================
RCS file: /cvsroot/typo3/TYPO3core/typo3/sysext/css_styled_content/static/constants.txt,v
retrieving revision 1.2.2.2
diff -u -r1.2.2.2 constants.txt
--- typo3/sysext/css_styled_content/static/constants.txt	8 Mar 2006 01:33:45 -0000	1.2.2.2
+++ typo3/sysext/css_styled_content/static/constants.txt	27 Mar 2006 14:04:06 -0000
@@ -40,7 +40,7 @@
   colSpace = 10
     # cat=content/cImage/x; type=int[0-100]; label= Advanced, Row space: Vertical distance between images in a block in content elements of type "Image" or "Text w/Image".
   rowSpace = 10
-    # cat=content/cImage/x; type=int[0-100]; label= Advanced, Margin to text: Horizontal distance between an imageblock and text in content elements of type "Image" or "Text w/Image".
+    # cat=content/cImage/x; type=int[0-100]; label= Advanced, Margin to text: Horizontal distance between an imageblock and text in content elements of type "Text w/Image".
   textMargin = 10
   linkWrap.width = 800m
   linkWrap.height = 600m
@@ -103,9 +103,6 @@
     # cat=content/cImage/b2; type=int+; label= Max Image Width (Text): Same as above, but this is the maximum width when text is wrapped around an imageblock. Default is 50% of the normal Max Image Width.
   maxWInText =
     # cat=content/cImage/c1; type=int+; label= Default Image Width: This indicates that default number of pixels (width) a block of images inserted as content will consume, if the user didn't specify otherwise in the content object.
-  defaultW =
-    # cat=content/cImage/c2; type=int+; label= Default Image Width (In Text): Same as above, but this is the default width when text is wrapped around an imageblock. Default is 50% of the normal Default Image Width.
-  defaultWInText =
   linkWrap.width = 800m
   linkWrap.height = 600m
   linkWrap.effects =
@@ -127,6 +124,8 @@
 
     # cat=content/cImage/g1; type=int[0-100]; label= Column space: Horizontal distance between images in a block in content elements of type "Image" or "Text w/Image". If you change this manually in your CSS, you need to adjust this setting acordingly
   colSpace = 10
+    # cat=content/cImage/g2; type=int[0-100]; label= Advanced, Margin to text: Horizontal distance between an imageblock and text in content elements of type "Text w/Image".
+  textMargin = 10
 
     # cat=content/cImage/i1; type=color; label= Image border, color: Bordercolor of images in content elements when "Border"-option for element is set.
   borderColor = black
Index: typo3/sysext/css_styled_content/static/setup.txt
===================================================================
RCS file: /cvsroot/typo3/TYPO3core/typo3/sysext/css_styled_content/static/setup.txt,v
retrieving revision 1.5.2.6
diff -u -r1.5.2.6 setup.txt
--- typo3/sysext/css_styled_content/static/setup.txt	20 Mar 2006 14:08:50 -0000	1.5.2.6
+++ typo3/sysext/css_styled_content/static/setup.txt	27 Mar 2006 14:04:06 -0000
@@ -1240,7 +1240,6 @@
 			bodyTag = <body style="margin:0; background:#fff;">
 			JSwindow.expand =
 		}
-
 	}
 
 	caption.1.wrapAlign >
@@ -1248,11 +1247,16 @@
 
 	captionAlign.field = imagecaption_position
 
-	defaultW = {$styles.content.imgtext.defaultW}
-	defaultWInText = {$styles.content.imgtext.defaultWInText}
 	borderSpace = {$styles.content.imgtext.borderSpace}
 	separateRows = {$styles.content.imgtext.separateRows}
 	addClasses =
+	addClassesImage =
+	addClassesImage.ifEmpty = csc-textpic-firstcol csc-textpic-lastcol
+	addClassesImage.override = csc-textpic-firstcol |*| |*| csc-textpic-lastcol
+	addClassesImage.override.if {
+		isGreaterThan.field = imagecols
+		value = 1
+	}
 
 	#
 	imageStdWrap.dataWrap = <div class="csc-textpic-imagewrap" style="width:{register:totalwidth}px;"> | </div>
@@ -1302,7 +1306,7 @@
 		dl {
 			imageRowStdWrap.dataWrap = <div class="csc-textpic-imagerow" style="width:{register:rowwidth}px;"> | </div>
 			noRowsStdWrap.wrap =
-			oneImageStdWrap.dataWrap = <dl class="csc-textpic-image" style="width:{register:imagespace}px;"> | </dl>
+			oneImageStdWrap.dataWrap = <dl class="csc-textpic-image###CLASSES###" style="width:{register:imagespace}px;"> | </dl>
 			imgTagStdWrap.wrap = <dt> | </dt>
 			editIconsStdWrap.wrap = <dd> | </dd>
 			caption.wrap = <dd class="csc-textpic-caption"> | </dd>
@@ -1310,7 +1314,7 @@
 		ul {
 			imageRowStdWrap.dataWrap = <div class="csc-textpic-imagerow" style="width:{register:rowwidth}px;"><ul> | </ul></div>
 			noRowsStdWrap.wrap = <ul> | </ul>
-			oneImageStdWrap.dataWrap = <li class="csc-textpic-image" style="width:{register:imagespace}px;"> | </li>
+			oneImageStdWrap.dataWrap = <li class="csc-textpic-image###CLASSES###" style="width:{register:imagespace}px;"> | </li>
 			imgTagStdWrap.wrap =
 			editIconsStdWrap.wrap = <div> | </div>
 			caption.wrap = <div class="csc-textpic-caption"> | </div>
@@ -1318,7 +1322,7 @@
 		div {
 			imageRowStdWrap.dataWrap = <div class="csc-textpic-imagerow" style="width:{register:rowwidth}px;"> | </div>
 			noRowsStdWrap.wrap =
-			oneImageStdWrap.dataWrap = <div class="csc-textpic-image" style="width:{register:imagespace}px;"> | </div>
+			oneImageStdWrap.dataWrap = <div class="csc-textpic-image###CLASSES###" style="width:{register:imagespace}px;"> | </div>
 			imgTagStdWrap.wrap = <div> | </div>
 			editIconsStdWrap.wrap = <div> | </div>
 			caption.wrap = <div class="csc-textpic-caption"> | </div>
@@ -1345,7 +1349,6 @@
 
 plugin.tx_cssstyledcontent._CSS_DEFAULT_STYLE (
 	/* Captions */
-	P.csc-caption { margin: 0; }
 	DIV.csc-textpic-caption-c .csc-textpic-caption { text-align: center; }
 	DIV.csc-textpic-caption-r .csc-textpic-caption { text-align: right; }
 	DIV.csc-textpic-caption-l .csc-textpic-caption { text-align: left; }
@@ -1413,6 +1416,20 @@
 	DIV.csc-textpic-equalheight DIV.csc-textpic-imagerow { margin-bottom: 5px; display: block; }
 	DIV.csc-textpic DIV.csc-textpic-imagerow { clear: both; }
 
+	/* No margins around the whole image-block */
+	DIV.csc-textpic DIV.csc-textpic-imagewrap .csc-textpic-firstcol { margin-left: 0px !important; }
+	DIV.csc-textpic DIV.csc-textpic-imagewrap .csc-textpic-lastcol { margin-right: 0px !important; }
+
+	/* Add margin from image-block to text (in case of "Text w/ images") */
+	DIV.csc-textpic-intext-left DIV.csc-textpic-imagewrap,
+	DIV.csc-textpic-intext-left-nowrap DIV.csc-textpic-imagewrap {
+		margin-right: {$styles.content.imgtext.textMargin}px !important;
+	}
+	DIV.csc-textpic-intext-right DIV.csc-textpic-imagewrap,
+	DIV.csc-textpic-intext-right-nowrap DIV.csc-textpic-imagewrap {
+		margin-left: {$styles.content.imgtext.textMargin}px !important;
+	}
+
 	/* Positioning of images: */
 
 	/* Above */
