Fixed bug #16199: Optimize stdWrap usage for TypoScript content element HMENU (Thanks...
authorSteffen Kamper <info@sk-typo3.de>
Thu, 4 Nov 2010 00:17:06 +0000 (00:17 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Thu, 4 Nov 2010 00:17:06 +0000 (00:17 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9264 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index da509f4..8d1a1fb 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-11-03  Steffen Kamper  <steffen@typo3.org>
 
+       * Fixed bug #16199: Optimize stdWrap usage for TypoScript content element HMENU (Thanks to Jo Hasenau)
        * Fixed bug #16189: Optimize stdWrap usage for TypoScript content element CLEARGIF (Thanks to Jo Hasenau)
        * Fixed bug #16217: Regression : Typoscript "required" did not work anymore (Thanks to Jo Hasenau)
        * Fixed bug #16227: Optimize stdWrap usage for TypoScript content element HTML (Thanks to Jo Hasenau)
index 3d2f8fb..4832f4c 100644 (file)
@@ -42,13 +42,19 @@ class tslib_content_HierarchicalMenu extends tslib_content_Abstract {
         * @return      string          Output
         */
        public function render($conf = array()) {
-               $content = '';
+
+               $theValue = '';
+
                if ($this->cObj->checkIf($conf['if.'])) {
+
                        $cls = strtolower($conf[1]);
+
                        if (t3lib_div::inList($GLOBALS['TSFE']->tmpl->menuclasses, $cls)) {
-                               if ($conf['special.']['value.']) {
+
+                               if (isset($conf['special.']['value.'])) {
                                        $conf['special.']['value'] = $this->cObj->stdWrap($conf['special.']['value'], $conf['special.']['value.']);
                                }
+
                                $GLOBALS['TSFE']->register['count_HMENU']++;
                                $GLOBALS['TSFE']->register['count_HMENU_MENUOBJ'] = 0;
                                $GLOBALS['TSFE']->applicationData['GMENU_LAYERS']['WMid'] = array();
@@ -58,14 +64,26 @@ class tslib_content_HierarchicalMenu extends tslib_content_Abstract {
                                $menu->parent_cObj = $this->cObj;
                                $menu->start($GLOBALS['TSFE']->tmpl, $GLOBALS['TSFE']->sys_page, '', $conf, 1);
                                $menu->makeMenu();
-                               $content .= $menu->writeMenu();
+
+                               $theValue .= $menu->writeMenu();
+
                        }
-                       if ($conf['wrap'])
-                               $content = $this->cObj->wrap($content, $conf['wrap']);
-                       if ($conf['stdWrap.'])
-                               $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
+
+                       $wrap =  isset($conf['wrap.'])
+                               ? $this->cObj->stdWrap($conf['wrap'], $conf['wrap.'])
+                               : $conf['wrap'];
+                       if ($wrap) {
+                               $theValue = $this->cObj->wrap($theValue, $wrap);
+                       }
+
+                       if (isset($conf['stdWrap.'])) {
+                               $theValue = $this->cObj->stdWrap($theValue, $conf['stdWrap.']);
+                       }
+
                }
-               return $content;
+
+               return $theValue;
+
        }
 
 }
@@ -75,4 +93,4 @@ if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/conte
        include_once ($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['tslib/content/class.tslib_content_hierarchicalmenu.php']);
 }
 
-?>
\ No newline at end of file
+?>