[TASK] Get rid of "clear.gif" usages
[Packages/TYPO3.CMS.git] / typo3 / sysext / compatibility6 / Classes / ContentObject / HorizontalRulerContentObject.php
1 <?php
2 namespace TYPO3\CMS\Compatibility6\ContentObject;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 /**
18 * Contains HRULER content object.
19 */
20 class HorizontalRulerContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractContentObject {
21
22 /**
23 * Rendering the cObject, HRULER
24 *
25 * @param array $conf Array of TypoScript properties
26 * @return string Output
27 */
28 public function render($conf = array()) {
29 $lineThickness = isset($conf['lineThickness.']) ? $this->cObj->stdWrap($conf['lineThickness'], $conf['lineThickness.']) : $conf['lineThickness'];
30 $lineThickness = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($lineThickness, 1, 50);
31 $lineColor = isset($conf['lineColor.']) ? $this->cObj->stdWrap($conf['lineColor'], $conf['lineColor.']) : $conf['lineColor'];
32 if (!$lineColor) {
33 $lineColor = 'black';
34 }
35 $spaceBefore = isset($conf['spaceLeft.']) ? (int)$this->cObj->stdWrap($conf['spaceLeft'], $conf['spaceLeft.']) : (int)$conf['spaceLeft'];
36 $spaceAfter = isset($conf['spaceRight.']) ? (int)$this->cObj->stdWrap($conf['spaceRight'], $conf['spaceRight.']) : (int)$conf['spaceRight'];
37 $tableWidth = isset($conf['tableWidth.']) ? (int)$this->cObj->stdWrap($conf['tableWidth'], $conf['tableWidth.']) : (int)$conf['tableWidth'];
38 if (!$tableWidth) {
39 $tableWidth = '99%';
40 }
41 $theValue = '';
42 $theValue .= '<table border="0" cellspacing="0" cellpadding="0"
43 width="' . htmlspecialchars($tableWidth) . '"
44 summary=""><tr>';
45 if ($spaceBefore) {
46 $theValue .= '<td width="1">
47 <span style="width: ' . $spaceBefore . 'px; height: 1px;"></span>
48 </td>';
49 }
50 $theValue .= '<td bgcolor="' . $lineColor . '">
51 <span style="width: 1px; height: ' . $lineThickness . 'px;"></span>
52 </td>';
53 if ($spaceAfter) {
54 $theValue .= '<td width="1">
55 <span style="width: ' . $spaceAfter . 'px; height: 1px;"></span>
56 </td>';
57 }
58 $theValue .= '</tr></table>';
59 if (isset($conf['stdWrap.'])) {
60 $theValue = $this->cObj->stdWrap($theValue, $conf['stdWrap.']);
61 }
62 return $theValue;
63 }
64
65 }