Fixed bug #16402: Optimize stdWrap usage for TypoScript content element SVG (Thanks...
authorSteffen Kamper <info@sk-typo3.de>
Mon, 27 Dec 2010 16:32:59 +0000 (16:32 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Mon, 27 Dec 2010 16:32:59 +0000 (16:32 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9914 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index 2406153..f8be6e5 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-12-27  Steffen Kamper  <steffen@typo3.org>
 
+       * Fixed bug #16402: Optimize stdWrap usage for TypoScript content element SVG (Thanks to Jo Hasenau)
        * Fixed bug #16386: Optimize stdWrap usage for TypoScript content elements PHP_SCRIPT_INT and PHP_SCRIPT_EXT (Thanks to Jo Hasenau)
        * Fixed bug #16404: Optimize stdWrap usage for TypoScript content element SWFOBJECT (Thanks to Jo Hasenau)
        * Fixed bug #16406: Optimize stdWrap usage for TypoScript content element SEARCHRESULT (Thanks to Jo Hasenau)
index c3367e7..a83d46f 100644 (file)
 class tslib_content_ScalableVectorGraphics extends tslib_content_Abstract {
 
        /**
-        * Rendering the cObject, RESTORE_REGISTER
-        * NOTICE: This cObject does NOT return any content since it just sets internal data based on the TypoScript properties.
+        * Rendering the cObject, SVG
         *
         * @param       array           Array of TypoScript properties
         * @return      string          Empty string (the cObject only sets internal data!)
         */
        public function render($conf = array()) {
-               $width = $conf['width'] ? $this->cObj->stdWrap($conf['width'], $conf['width.']) : 600;
-               $height = $conf['height'] ? $this->cObj->stdWrap($conf['height'], $conf['height.']) : 400;
+               $width = isset($conf['width.'])
+                        ? $this->cObj->stdWrap($conf['width'], $conf['width.'])
+                        : $conf['width'];
+               if(!$width) {
+                       $width = 600;
+               }
+               $height = isset($conf['height.'])
+                       ? $this->cObj->stdWrap($conf['height'], $conf['height.'])
+                       : $conf['height'];
+               if(!$height) {
+                       $height = 400;
+               }
+
+               $src = isset($conf['src.'])
+                       ? $this->cObj->stdWrap($conf['src'], $conf['src.'])
+                       : $conf['src'];
+               if(!$src) {
+                       $src = NULL;
+               }
+               $value = isset($conf['value.'])
+                       ? $this->cObj->stdWrap($conf['value'], $conf['value.'])
+                       : $conf['value'];
 
-               $src = $conf['src'] ? $this->cObj->stdWrap($conf['src'], $conf['src.']) : NULL;
-               $value = $this->cObj->stdWrap($conf['value'], $conf['value.']);
+               $noscript = isset($conf['noscript.'])
+                       ? $this->cObj->stdWrap($conf['noscript'], $conf['noscript.'])
+                       : $conf['noscript'];
 
                if ($src) {
                        $content = '
@@ -58,7 +78,7 @@ class tslib_content_ScalableVectorGraphics extends tslib_content_Abstract {
                                        <!--[if !IE]>-->
                                        <object data="' . $src . '" type="image/svg+xml" width="' . $width . '" height="' . $height . '">
                                        <!--<![endif]-->
-                                       ' . $this->cObj->stdWrap($conf['noscript'], $conf['noscript.']) . '
+                                       ' . $noscript . '
                                        </object>
 
                        ';
@@ -73,12 +93,16 @@ class tslib_content_ScalableVectorGraphics extends tslib_content_Abstract {
                                </svg>
                                </script>
                                <noscript>
-                       ' . $this->cObj->stdWrap($conf['noscript'], $conf['noscript.']) . '
+                       ' . $noscript . '
                                </noscript>
                        ';
                }
                $GLOBALS['TSFE']->getPageRenderer()->loadSvg();
 
+               if (isset($conf['stdWrap.'])) {
+                       $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
+               }
+
                return $content;
        }