TYPO3 CMS  TYPO3_6-2
ImageTextContentObject.php
Go to the documentation of this file.
1 <?php
3 
23 
30  public function render($conf = array()) {
31  $content = '';
32  if (isset($conf['text.'])) {
33  $text = $this->cObj->cObjGet($conf['text.'], 'text.');
34  // this gets the surrounding content
35  $content .= $this->cObj->stdWrap($text, $conf['text.']);
36  }
37  $imgList = isset($conf['imgList.']) ? trim($this->cObj->stdWrap($conf['imgList'], $conf['imgList.'])) : trim($conf['imgList']);
38  if ($imgList) {
39  $imgs = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $imgList, TRUE);
40  $imgStart = isset($conf['imgStart.']) ? (int)$this->cObj->stdWrap($conf['imgStart'], $conf['imgStart.']) : (int)$conf['imgStart'];
41  $imgCount = count($imgs) - $imgStart;
42  $imgMax = isset($conf['imgMax.']) ? (int)$this->cObj->stdWrap($conf['imgMax'], $conf['imgMax.']) : (int)$conf['imgMax'];
43  if ($imgMax) {
44  // Reduces the number of images.
45  $imgCount = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($imgCount, 0, $imgMax);
46  }
47  $imgPath = isset($conf['imgPath.']) ? $this->cObj->stdWrap($conf['imgPath'], $conf['imgPath.']) : $conf['imgPath'];
48  // initialisation
49  $caption = '';
50  $captionArray = array();
51  if (!$conf['captionSplit'] && !$conf['imageTextSplit'] && isset($conf['caption.'])) {
52  $caption = $this->cObj->cObjGet($conf['caption.'], 'caption.');
53  // Global caption, no splitting
54  $caption = $this->cObj->stdWrap($caption, $conf['caption.']);
55  }
56  if ($conf['captionSplit'] && $conf['captionSplit.']['cObject']) {
57  $legacyCaptionSplit = 1;
58  $capSplit = isset($conf['captionSplit.']['token.']) ? $this->cObj->stdWrap($conf['captionSplit.']['token'], $conf['captionSplit.']['token.']) : $conf['captionSplit.']['token'];
59  if (!$capSplit) {
60  $capSplit = LF;
61  }
62  $captionArray = explode($capSplit, $this->cObj->cObjGetSingle($conf['captionSplit.']['cObject'], $conf['captionSplit.']['cObject.'], 'captionSplit.cObject'));
63  foreach ($captionArray as $ca_key => $ca_val) {
64  $captionArray[$ca_key] = isset($conf['captionSplit.']['stdWrap.']) ? $this->cObj->stdWrap(trim($captionArray[$ca_key]), $conf['captionSplit.']['stdWrap.']) : trim($captionArray[$ca_key]);
65  }
66  }
67  $tablecode = '';
68  $position = isset($conf['textPos.']) ? $this->cObj->stdWrap($conf['textPos'], $conf['textPos.']) : $conf['textPos'];
69  $tmppos = $position & 7;
70  $contentPosition = $position & 24;
71  $align = $this->cObj->align[$tmppos];
72  $cap = $caption ? 1 : 0;
73  $txtMarg = isset($conf['textMargin.']) ? (int)$this->cObj->stdWrap($conf['textMargin'], $conf['textMargin.']) : (int)$conf['textMargin'];
74  if (!$conf['textMargin_outOfText'] && $contentPosition < 16) {
75  $txtMarg = 0;
76  }
77  $cols = isset($conf['cols.']) ? (int)$this->cObj->stdWrap($conf['cols'], $conf['cols.']) : (int)$conf['cols'];
78  $rows = isset($conf['rows.']) ? (int)$this->cObj->stdWrap($conf['rows'], $conf['rows.']) : (int)$conf['rows'];
79  $colspacing = isset($conf['colSpace.']) ? (int)$this->cObj->stdWrap($conf['colSpace'], $conf['colSpace.']) : (int)$conf['colSpace'];
80  $rowspacing = isset($conf['rowSpace.']) ? (int)$this->cObj->stdWrap($conf['rowSpace'], $conf['rowSpace.']) : (int)$conf['rowSpace'];
81  $border = isset($conf['border.']) ? (int)$this->cObj->stdWrap($conf['border'], $conf['border.']) : (int)$conf['border'];
82  $border = $border ? 1 : 0;
83  if ($border) {
84  $borderColor = isset($conf['borderCol.']) ? $this->cObj->stdWrap($conf['borderCol'], $conf['borderCol.']) : $conf['borderCol'];
85  if (!$borderColor) {
86  $borderColor = 'black';
87  }
88  $borderThickness = isset($conf['borderThick.']) ? (int)$this->cObj->stdWrap($conf['borderThick'], $conf['borderThick.']) : (int)$conf['borderThick'];
89  if (!$borderThickness) {
90  $borderThickness = 'black';
91  }
92  }
93  $caption_align = isset($conf['captionAlign.']) ? $this->cObj->stdWrap($conf['captionAlign'], $conf['captionAlign.']) : $conf['captionAlign'];
94  if (!$caption_align) {
95  $caption_align = $align;
96  }
97  // Generate cols
98  $colCount = $cols > 1 ? $cols : 1;
99  if ($colCount > $imgCount) {
100  $colCount = $imgCount;
101  }
102  $rowCount = $colCount > 1 ? ceil($imgCount / $colCount) : $imgCount;
103  // Generate rows
104  if ($rows > 1) {
105  $rowCount = $rows;
106  if ($rowCount > $imgCount) {
107  $rowCount = $imgCount;
108  }
109  $colCount = $rowCount > 1 ? ceil($imgCount / $rowCount) : $imgCount;
110  }
111  // Max Width
112  $colRelations = isset($conf['colRelations.']) ? trim($this->cObj->stdWrap($conf['colRelations'], $conf['colRelations.'])) : trim($conf['colRelations']);
113  $maxW = isset($conf['maxW.']) ? (int)$this->cObj->stdWrap($conf['maxW'], $conf['maxW.']) : (int)$conf['maxW'];
114  $maxWInText = isset($conf['maxWInText.']) ? (int)$this->cObj->stdWrap($conf['maxWInText'], $conf['maxWInText.']) : (int)$conf['maxWInText'];
115  // If maxWInText is not set, it's calculated to the 50 % of the max...
116  if (!$maxWInText) {
117  $maxWInText = round($maxW / 2);
118  }
119  // inText
120  if ($maxWInText && $contentPosition >= 16) {
121  $maxW = $maxWInText;
122  }
123  // If there is a max width and if colCount is greater than column
124  if ($maxW && $colCount > 0) {
125  $maxW = ceil(($maxW - $colspacing * ($colCount - 1) - $colCount * $border * $borderThickness * 2) / $colCount);
126  }
127  // Create the relation between rows
128  $colMaxW = array();
129  if ($colRelations) {
130  $rel_parts = explode(':', $colRelations);
131  $rel_total = 0;
132  for ($a = 0; $a < $colCount; $a++) {
133  $rel_parts[$a] = (int)$rel_parts[$a];
134  $rel_total += $rel_parts[$a];
135  }
136  if ($rel_total) {
137  for ($a = 0; $a < $colCount; $a++) {
138  $colMaxW[$a] = round($maxW * $colCount / $rel_total * $rel_parts[$a]);
139  }
140  // The difference in size between the largest and smalles must be within a factor of ten.
141  if (min($colMaxW) <= 0 || max($rel_parts) / min($rel_parts) > 10) {
142  $colMaxW = array();
143  }
144  }
145  }
146  $image_compression = isset($conf['image_compression.']) ? (int)$this->cObj->stdWrap($conf['image_compression'], $conf['image_compression.']) : (int)$conf['image_compression'];
147  $image_effects = isset($conf['image_effects.']) ? (int)$this->cObj->stdWrap($conf['image_effects'], $conf['image_effects.']) : (int)$conf['image_effects'];
148  $image_frames = isset($conf['image_frames.']['key.']) ? (int)$this->cObj->stdWrap($conf['image_frames.']['key'], $conf['image_frames.']['key.']) : (int)$conf['image_frames.']['key'];
149  // Fetches pictures
150  $splitArr = array();
151  $splitArr['imgObjNum'] = $conf['imgObjNum'];
152  $splitArr = $GLOBALS['TSFE']->tmpl->splitConfArray($splitArr, $imgCount);
153  // EqualHeight
154  $equalHeight = isset($conf['equalH.']) ? (int)$this->cObj->stdWrap($conf['equalH'], $conf['equalH.']) : (int)$conf['equalH'];
155  // Initiate gifbuilder object in order to get dimensions AND calculate the imageWidth's
156  if ($equalHeight) {
157  $gifCreator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Imaging\\GifBuilder');
158  $gifCreator->init();
159  $relations = array();
160  $relations_cols = array();
161  $totalMaxW = $maxW * $colCount;
162  for ($a = 0; $a < $imgCount; $a++) {
163  $imgKey = $a + $imgStart;
164  $imgInfo = $gifCreator->getImageDimensions($imgPath . $imgs[$imgKey]);
165  // relationship between the original height and the wished height
166  $relations[$a] = $imgInfo[1] / $equalHeight;
167  // if relations is zero, then the addition of this value is omitted as
168  // the image is not expected to display because of some error.
169  if ($relations[$a]) {
170  // Counts the total width of the row with the new height taken into consideration.
171  $relations_cols[floor($a / $colCount)] += $imgInfo[0] / $relations[$a];
172  }
173  }
174  }
175  // Contains the width of every image row
176  $imageRowsFinalWidths = array();
177  $imageRowsMaxHeights = array();
178  $imgsTag = array();
179  $origImages = array();
180  for ($a = 0; $a < $imgCount; $a++) {
181  $GLOBALS['TSFE']->register['IMAGE_NUM'] = $a;
182  $GLOBALS['TSFE']->register['IMAGE_NUM_CURRENT'] = $a;
183  $imgKey = $a + $imgStart;
184  if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($imgs[$imgKey])) {
185  $this->setCurrentFileInContentObjectRenderer(intval($imgs[$imgKey]));
186  }
187  $totalImagePath = $imgPath . $imgs[$imgKey];
188  $this->cObj->data[$this->cObj->currentValKey] = $totalImagePath;
189  $imgObjNum = (int)$splitArr[$a]['imgObjNum'];
190  $imgConf = $conf[$imgObjNum . '.'];
191  if ($equalHeight) {
192  $scale = 1;
193  if ($totalMaxW) {
194  $rowTotalMaxW = $relations_cols[floor($a / $colCount)];
195  if ($rowTotalMaxW > $totalMaxW) {
196  $scale = $rowTotalMaxW / $totalMaxW;
197  }
198  }
199  // Transfer info to the imageObject. Please note, that
200  $imgConf['file.']['height'] = round($equalHeight / $scale);
201  unset($imgConf['file.']['width'], $imgConf['file.']['maxW'], $imgConf['file.']['maxH'], $imgConf['file.']['minW'], $imgConf['file.']['minH'], $imgConf['file.']['width.'], $imgConf['file.']['maxW.'], $imgConf['file.']['maxH.'], $imgConf['file.']['minW.'], $imgConf['file.']['minH.']);
202  // Setting this to zero, so that it doesn't disturb
203  $maxW = 0;
204  }
205  if ($maxW) {
206  if (count($colMaxW)) {
207  $imgConf['file.']['maxW'] = $colMaxW[$a % $colCount];
208  } else {
209  $imgConf['file.']['maxW'] = $maxW;
210  }
211  }
212  // Image Object supplied:
213  if (is_array($imgConf)) {
214  if ($this->cObj->image_effects[$image_effects]) {
215  $imgConf['file.']['params'] .= ' ' . $this->cObj->image_effects[$image_effects];
216  }
217  if ($image_frames) {
218  if (is_array($conf['image_frames.'][$image_frames . '.'])) {
219  $imgConf['file.']['m.'] = $conf['image_frames.'][$image_frames . '.'];
220  }
221  }
222  if ($image_compression && $imgConf['file'] != 'GIFBUILDER') {
223  if ($image_compression == 1) {
224  $tempImport = $imgConf['file.']['import'];
225  $tempImport_dot = $imgConf['file.']['import.'];
226  unset($imgConf['file.']);
227  $imgConf['file.']['import'] = $tempImport;
228  $imgConf['file.']['import.'] = $tempImport_dot;
229  } elseif (isset($this->cObj->image_compression[$image_compression])) {
230  $imgConf['file.']['params'] .= ' ' . $this->cObj->image_compression[$image_compression]['params'];
231  $imgConf['file.']['ext'] = $this->cObj->image_compression[$image_compression]['ext'];
232  unset($imgConf['file.']['ext.']);
233  }
234  }
235  // "alt", "title" and "longdesc" attributes:
236  if (!strlen($imgConf['altText']) && !is_array($imgConf['altText.'])) {
237  $imgConf['altText'] = $conf['altText'];
238  $imgConf['altText.'] = $conf['altText.'];
239  }
240  if (!strlen($imgConf['titleText']) && !is_array($imgConf['titleText.'])) {
241  $imgConf['titleText'] = $conf['titleText'];
242  $imgConf['titleText.'] = $conf['titleText.'];
243  }
244  if (!strlen($imgConf['longdescURL']) && !is_array($imgConf['longdescURL.'])) {
245  $imgConf['longdescURL'] = $conf['longdescURL'];
246  $imgConf['longdescURL.'] = $conf['longdescURL.'];
247  }
248  } else {
249  $imgConf = array(
250  'altText' => $conf['altText'],
251  'titleText' => $conf['titleText'],
252  'longdescURL' => $conf['longdescURL'],
253  'file' => $totalImagePath
254  );
255  }
256  $imgsTag[$imgKey] = $this->cObj->IMAGE($imgConf);
257  // Store the original filepath
258  $origImages[$imgKey] = $GLOBALS['TSFE']->lastImageInfo;
259  $imageRowsFinalWidths[floor($a / $colCount)] += $GLOBALS['TSFE']->lastImageInfo[0];
260  if ($GLOBALS['TSFE']->lastImageInfo[1] > $imageRowsMaxHeights[floor($a / $colCount)]) {
261  $imageRowsMaxHeights[floor($a / $colCount)] = $GLOBALS['TSFE']->lastImageInfo[1];
262  }
263  }
264  // Calculating the tableWidth:
265  // TableWidth problems: It creates problems if the pictures are NOT as wide as the tableWidth.
266  $tableWidth = max($imageRowsFinalWidths) + $colspacing * ($colCount - 1) + $colCount * $border * $borderThickness * 2;
267  // Make table for pictures
268  $index = ($imgIndex = $imgStart);
269  $noRows = isset($conf['noRows.']) ? $this->cObj->stdWrap($conf['noRows'], $conf['noRows.']) : $conf['noRows'];
270  $noCols = isset($conf['noCols.']) ? $this->cObj->stdWrap($conf['noCols'], $conf['noCols.']) : $conf['noCols'];
271  if ($noRows) {
272  $noCols = 0;
273  }
274  // noRows overrides noCols. They cannot exist at the same time.
275  if ($equalHeight) {
276  $noCols = 1;
277  $noRows = 0;
278  }
279  $rowCount_temp = 1;
280  $colCount_temp = $colCount;
281  if ($noRows) {
282  $rowCount_temp = $rowCount;
283  $rowCount = 1;
284  }
285  if ($noCols) {
286  $colCount = 1;
287  }
288  // col- and rowspans calculated
289  $colspan = $colspacing ? $colCount * 2 - 1 : $colCount;
290  $rowspan = ($rowspacing ? $rowCount * 2 - 1 : $rowCount) + $cap;
291  // Edit icons:
292  if (!is_array($conf['editIcons.'])) {
293  $conf['editIcons.'] = array();
294  }
295  $editIconsHTML = $conf['editIcons'] && $GLOBALS['TSFE']->beUserLogin ? $this->cObj->editIcons('', $conf['editIcons'], $conf['editIcons.']) : '';
296  // Strech out table:
297  $tablecode = '';
298  $flag = 0;
299  $noStretchAndMarginCells = isset($conf['noStretchAndMarginCells.']) ? $this->cObj->stdWrap($conf['noStretchAndMarginCells'], $conf['noStretchAndMarginCells.']) : $conf['noStretchAndMarginCells'];
300  if ($noStretchAndMarginCells != 1) {
301  $tablecode .= '<tr>';
302  if ($txtMarg && $align == 'right') {
303  // If right aligned, the textborder is added on the right side
304  $tablecode .= '<td rowspan="' . ($rowspan + 1) . '" valign="top"><img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="' . $txtMarg . '" height="1" alt="" title="" />' . ($editIconsHTML ? '<br />' . $editIconsHTML : '') . '</td>';
305  $editIconsHTML = '';
306  $flag = 1;
307  }
308  $tablecode .= '<td colspan="' . $colspan . '"><img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="' . $tableWidth . '" height="1" alt="" /></td>';
309  if ($txtMarg && $align == 'left') {
310  // If left aligned, the textborder is added on the left side
311  $tablecode .= '<td rowspan="' . ($rowspan + 1) . '" valign="top"><img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="' . $txtMarg . '" height="1" alt="" title="" />' . ($editIconsHTML ? '<br />' . $editIconsHTML : '') . '</td>';
312  $editIconsHTML = '';
313  $flag = 1;
314  }
315  if ($flag) {
316  $tableWidth += $txtMarg + 1;
317  }
318  $tablecode .= '</tr>';
319  }
320  // draw table
321  // Looping through rows. If 'noRows' is set, this is '1 time', but $rowCount_temp will hold the actual number of rows!
322  for ($c = 0; $c < $rowCount; $c++) {
323  // If this is NOT the first time in the loop AND if space is required, a row-spacer is added. In case of "noRows" rowspacing is done further down.
324  if ($c && $rowspacing) {
325  $tablecode .= '<tr><td colspan="' . $colspan . '"><img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="1" height="' . $rowspacing . '"' . $this->cObj->getBorderAttr(' border="0"') . ' alt="" title="" /></td></tr>';
326  }
327  // starting row
328  $tablecode .= '<tr>';
329  // Looping through the columns
330  for ($b = 0; $b < $colCount_temp; $b++) {
331  // If this is NOT the first iteration AND if column space is required. In case of "noCols", the space is done without a separate cell.
332  if ($b && $colspacing) {
333  if (!$noCols) {
334  $tablecode .= '<td><img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="' . $colspacing . '" height="1"' . $this->cObj->getBorderAttr(' border="0"') . ' alt="" title="" /></td>';
335  } else {
336  $colSpacer = '<img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="' . ($border ? $colspacing - 6 : $colspacing) . '" height="' . ($imageRowsMaxHeights[$c] + ($border ? $borderThickness * 2 : 0)) . '"' . $this->cObj->getBorderAttr(' border="0"') . ' align="' . ($border ? 'left' : 'top') . '" alt="" title="" />';
337  $colSpacer = '<td valign="top">' . $colSpacer . '</td>';
338  // added 160301, needed for the new "noCols"-table...
339  $tablecode .= $colSpacer;
340  }
341  }
342  if (!$noCols || $noCols && !$b) {
343  // starting the cell. If "noCols" this cell will hold all images in the row, otherwise only a single image.
344  $tablecode .= '<td valign="top">';
345  if ($noCols) {
346  $tablecode .= '<table width="' . $imageRowsFinalWidths[$c] . '" border="0" cellpadding="0" cellspacing="0"><tr>';
347  }
348  }
349  // Looping through the rows IF "noRows" is set. "noRows" means that the rows of images is not rendered
350  // by physical table rows but images are all in one column and spaced apart with clear-gifs. This loop is
351  // only one time if "noRows" is not set.
352  for ($a = 0; $a < $rowCount_temp; $a++) {
353  // register previous imgIndex
354  $GLOBALS['TSFE']->register['IMAGE_NUM'] = $imgIndex;
355  $imgIndex = $index + $a * $colCount_temp;
356  $GLOBALS['TSFE']->register['IMAGE_NUM_CURRENT'] = $imgIndex;
357  if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($imgs[$imgIndex])) {
358  $this->setCurrentFileInContentObjectRenderer(intval($imgs[$imgIndex]));
359  }
360  if ($imgsTag[$imgIndex]) {
361  // Puts distance between the images IF "noRows" is set and this is the first iteration of the loop
362  if ($rowspacing && $noRows && $a) {
363  $tablecode .= '<img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="1" height="' . $rowspacing . '" alt="" title="" /><br />';
364  }
365  if ($legacyCaptionSplit) {
366  $thisCaption = $captionArray[$imgIndex];
367  } elseif (($conf['captionSplit'] || $conf['imageTextSplit']) && isset($conf['caption.'])) {
368  $thisCaption = $this->cObj->cObjGet($conf['caption.'], 'caption.');
369  $thisCaption = $this->cObj->stdWrap($thisCaption, $conf['caption.']);
370  }
371  $imageHTML = $imgsTag[$imgIndex] . '<br />';
372  // this is necessary if the tablerows are supposed to space properly together! "noRows" is excluded because else the images "layer" together.
373  $Talign = !trim($thisCaption) && !$noRows ? ' align="left"' : '';
374  if ($border) {
375  $imageHTML = '<table border="0" cellpadding="' . $borderThickness . '" cellspacing="0" bgcolor="' . $borderColor . '"' . $Talign . '><tr><td>' . $imageHTML . '</td></tr></table>';
376  }
377  $imageHTML .= $editIconsHTML;
378  $editIconsHTML = '';
379  // Adds caption.
380  $imageHTML .= $thisCaption;
381  if ($noCols) {
382  $imageHTML = '<td valign="top">' . $imageHTML . '</td>';
383  }
384  // If noCols, put in table cell.
385  $tablecode .= $imageHTML;
386  }
387  }
388  $index++;
389  if (!$noCols || $noCols && $b + 1 == $colCount_temp) {
390  if ($noCols) {
391  $tablecode .= '</tr></table>';
392  }
393  // In case of "noCols" we must finish the table that surrounds the images in the row.
394  $tablecode .= '</td>';
395  }
396  }
397  // ending row
398  $tablecode .= '</tr>';
399  }
400  if ($c) {
401  switch ($contentPosition) {
402  case '0':
403 
404  case '8':
405  // below
406  switch ($align) {
407  case 'center':
408  $table_align = 'margin-left: auto; margin-right: auto';
409  break;
410  case 'right':
411  $table_align = 'margin-left: auto; margin-right: 0px';
412  break;
413  default:
414  // Most of all: left
415  $table_align = 'margin-left: 0px; margin-right: auto';
416  }
417  $table_align = 'style="' . $table_align . '"';
418  break;
419  case '16':
420  // in text
421  $table_align = 'align="' . $align . '"';
422  break;
423  default:
424  $table_align = '';
425  }
426  // Table-tag is inserted
427  $tablecode = '<table' . ($tableWidth ? ' width="' . $tableWidth . '"' : '') . ' border="0" cellspacing="0" cellpadding="0" ' . $table_align . ' class="imgtext-table">' . $tablecode;
428  // If this value is not long since reset.
429  if ($editIconsHTML) {
430  $tablecode .= '<tr><td colspan="' . $colspan . '">' . $editIconsHTML . '</td></tr>';
431  $editIconsHTML = '';
432  }
433  if ($cap) {
434  $tablecode .= '<tr><td colspan="' . $colspan . '" align="' . $caption_align . '">' . $caption . '</td></tr>';
435  }
436  $tablecode .= '</table>';
437  if (isset($conf['tableStdWrap.'])) {
438  $tablecode = $this->cObj->stdWrap($tablecode, $conf['tableStdWrap.']);
439  }
440  }
441  $spaceBelowAbove = isset($conf['spaceBelowAbove.']) ? (int)$this->cObj->stdWrap($conf['spaceBelowAbove'], $conf['spaceBelowAbove.']) : (int)$conf['spaceBelowAbove'];
442  switch ($contentPosition) {
443  case '0':
444  // above
445  $output = '<div style="text-align:' . $align . ';">' . $tablecode . '</div>' . $this->cObj->wrapSpace($content, ($spaceBelowAbove . '|0'));
446  break;
447  case '8':
448  // below
449  $output = $this->cObj->wrapSpace($content, ('0|' . $spaceBelowAbove)) . '<div style="text-align:' . $align . ';">' . $tablecode . '</div>';
450  break;
451  case '16':
452  // in text
453  $output = $tablecode . $content;
454  break;
455  case '24':
456  // in text, no wrap
457  $theResult = '';
458  $theResult .= '<table border="0" cellspacing="0" cellpadding="0" class="imgtext-nowrap"><tr>';
459  if ($align == 'right') {
460  $theResult .= '<td valign="top">' . $content . '</td><td valign="top">' . $tablecode . '</td>';
461  } else {
462  $theResult .= '<td valign="top">' . $tablecode . '</td><td valign="top">' . $content . '</td>';
463  }
464  $theResult .= '</tr></table>';
465  $output = $theResult;
466  break;
467  }
468  } else {
469  $output = $content;
470  }
471  if (isset($conf['stdWrap.'])) {
472  $output = $this->cObj->stdWrap($output, $conf['stdWrap.']);
473  }
474  return $output;
475  }
476 
486  protected function setCurrentFileInContentObjectRenderer($fileUid) {
487  $imageFile = $this->fileFactory->getFileReferenceObject($fileUid);
488  $this->cObj->setCurrentFile($imageFile);
489  }
490 }
static forceIntegerInRange($theInt, $min, $max=2000000000, $defaultValue=0)
Definition: MathUtility.php:32
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]