Fixed bug #16226: Optimize stdWrap usage for TypoScript content element HRULER (Thank...
authorSteffen Kamper <info@sk-typo3.de>
Wed, 3 Nov 2010 18:55:43 +0000 (18:55 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Wed, 3 Nov 2010 18:55:43 +0000 (18:55 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9260 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/content/class.tslib_content_horizontalruler.php

index 42df893..e4cc703 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-11-03  Steffen Kamper  <steffen@typo3.org>
 
+       * Fixed bug #16226: Optimize stdWrap usage for TypoScript content element HRULER (Thanks to Jo Hasenau)
        * Fixed bug #15995: Bug: doktype limitation is not applied to alternative page languages (pages_language_overlay) (Thanks to Andreas Kiessling)
        * Fixed bug #16225: Disable draft workspace and migrate it to a real workspace (Thanks to Tolleiv Nietsch)
        * Added feature #16228: [Feature] TCA tree (Thanks to Steffen Ritter)
index dba04d4..f312e81 100644 (file)
@@ -42,28 +42,67 @@ class tslib_content_HorizontalRuler extends tslib_content_Abstract {
         * @return      string          Output
         */
        public function render($conf = array()) {
-               $lineThickness = t3lib_div::intInRange($this->cObj->stdWrap($conf['lineThickness'], $conf['lineThickness.']), 1, 50);
-               $lineColor = $conf['lineColor'] ? $conf['lineColor'] : 'black';
-               $spaceBefore = intval($conf['spaceLeft']);
-               $spaceAfter = intval($conf['spaceRight']);
-               $tableWidth = $conf['tableWidth'] ? $conf['tableWidth'] : '99%';
-               $content = '';
-
-               $content .= '<table border="0" cellspacing="0" cellpadding="0" width="' . htmlspecialchars($tableWidth) . '" summary=""><tr>';
+
+               $lineThickness = isset($conf['lineThickness.'])
+                       ? $this->cObj->stdWrap($conf['lineThickness'], $conf['lineThickness.'])
+                       : $conf['lineThickness'];
+               $lineThickness = t3lib_div::intInRange($lineThickness, 1, 50);
+
+               $lineColor = isset($conf['lineColor.'])
+                       ? $this->cObj->stdWrap($conf['lineColor'], $conf['lineColor.'])
+                       : $conf['lineColor'];
+               if(!$lineColor) {
+                       $lineColor = 'black';
+               }
+
+               $spaceBefore = isset($conf['spaceLeft.'])
+                       ? intval($this->cObj->stdWrap($conf['spaceLeft'], $conf['spaceLeft.']))
+                       : intval($conf['spaceLeft']);
+
+               $spaceAfter = isset($conf['spaceRight.'])
+                       ? intval($this->cObj->stdWrap($conf['spaceRight'], $conf['spaceRight.']))
+                       : intval($conf['spaceRight']);
+
+               $tableWidth = isset($conf['tableWidth.'])
+                       ? intval($this->cObj->stdWrap($conf['tableWidth'], $conf['tableWidth.']))
+                       : intval($conf['tableWidth']);
+               if(!$tableWidth) {
+                       $tableWidth = '99%';
+               }
+
+               $theValue = '';
+
+               $theValue .= '<table border="0" cellspacing="0" cellpadding="0"
+                       width="' . htmlspecialchars($tableWidth) . '"
+                       summary=""><tr>';
                if ($spaceBefore) {
-                       $content .= '<td width="1"><img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="' .
-                               $spaceBefore . '" height="1" alt="" title="" /></td>';
+                       $theValue .= '<td width="1">
+                               <img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif"
+                               width="' . $spaceBefore . '"
+                               height="1" alt="" title="" />
+                       </td>';
                }
-               $content .= '<td bgcolor="' . $lineColor . '"><img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="1" height="' .
-                       $lineThickness . '" alt="" title="" /></td>';
+               $theValue .= '<td bgcolor="' . $lineColor . '">
+                       <img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif"
+                       width="1"
+                       height="' . $lineThickness . '"
+                       alt="" title="" />
+               </td>';
                if ($spaceAfter) {
-                       $content .= '<td width="1"><img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="' .
-                               $spaceAfter . '" height="1" alt="" title="" /></td>';
+                       $theValue .= '<td width="1">
+                               <img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif"
+                               width="' . $spaceAfter . '"
+                               height="1" alt="" title="" />
+                       </td>';
                }
-               $content .= '</tr></table>';
+               $theValue .= '</tr></table>';
+
+               if (isset($conf['stdWrap.'])) {
+                       $theValue = $this->cObj->stdWrap($theValue, $conf['stdWrap.']);
+               }
+
+               return $theValue;
 
-               $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
-               return $content;
        }
 
 }