Project

General

Profile

Bug #15522 ยป css_styled_content-imgtext-4.0-rc2.diff

Administrator Admin, 2006-03-27 16:10

View differences:

typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php 27 Mar 2006 14:04:06 -0000
// 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.']));
......
// 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.']));
......
} 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();
......
$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
......
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 = '';
}
......
$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.']);
}
typo3/sysext/css_styled_content/static/constants.txt 27 Mar 2006 14:04:06 -0000
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
......
# 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 =
......
# 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
typo3/sysext/css_styled_content/static/setup.txt 27 Mar 2006 14:04:06 -0000
bodyTag = <body style="margin:0; background:#fff;">
JSwindow.expand =
}
}
caption.1.wrapAlign >
......
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>
......
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>
......
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>
......
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>
......
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; }
......
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 */
    (1-1/1)