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

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

index 9863fce..01819b5 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-12-27  Steffen Kamper  <steffen@typo3.org>
 
+       * Fixed bug #16406: Optimize stdWrap usage for TypoScript content element SEARCHRESULT (Thanks to Jo Hasenau)
        * Fixed bug #16385: Optimize stdWrap usage for TypoScript content element PHP_SCRIPT (Thanks to Jo Hasenau)
 
 2010-12-27  Jeff Segars  <jeff@webempoweredchurch.org>
index d8315b0..2b719ec 100644 (file)
@@ -121,14 +121,20 @@ class tslib_content_SearchResult extends tslib_content_Abstract {
 
                                // range
                        $spointer = intval(t3lib_div::_GP('spointer'));
-                       if (isset($conf['range'])) {
-                               $theRange = intval($conf['range']);
+                       $range = isset($conf['range.'])
+                               ? $this->cObj->stdWrap($conf['range'], $conf['range.'])
+                               : $conf['range'];
+                       if ($range) {
+                               $theRange = intval($range);
                        } else {
                                $theRange = 20;
                        }
 
                                // Order By:
-                       if (!$conf['noOrderBy']) {
+                       $noOrderBy = isset($conf['noOrderBy.'])
+                               ? $this->cObj->stdWrap($conf['noOrderBy'], $conf['noOrderBy.'])
+                               : $conf['noOrderBy'];
+                       if (!$noOrderBy) {
                                $search->queryParts['ORDERBY'] = 'pages.lastUpdated, pages.tstamp';
                        }
 
@@ -143,9 +149,14 @@ class tslib_content_SearchResult extends tslib_content_Abstract {
                                $rangeLow = t3lib_div::intInRange($spointer + 1, 1, $total);
                                $rangeHigh = t3lib_div::intInRange($spointer + $theRange, 1, $total);
                                        // prev/next url:
+
+                               $target = isset($conf['target.'])
+                                       ? $this->cObj->stdWrap($conf['target'], $conf['target.'])
+                                       : $conf['target'];
+
                                $LD = $GLOBALS['TSFE']->tmpl->linkData(
                                        $GLOBALS['TSFE']->page,
-                                       $conf['target'],
+                                       $target,
                                        1,
                                        '',
                                        '',
@@ -194,7 +205,10 @@ class tslib_content_SearchResult extends tslib_content_Abstract {
                                        $cObj->start($row);
                                        $renderCode .= $cObj->cObjGetSingle($conf['renderObj'], $conf['renderObj.'], 'renderObj');
                                }
-                               $theValue .= $this->cObj->wrap($renderCode, $conf['renderWrap']);
+                               $renderWrap = isset($conf['renderWrap.'])
+                                       ? $this->cObj->stdWrap($conf['renderWrap'], $conf['renderWrap.'])
+                                       : $conf['renderWrap'];
+                               $theValue .= $this->cObj->wrap($renderCode, $renderWrap);
                                $theValue = str_replace('###RESULT###', $theValue, $result);
                        } else {
                                $theValue = $this->cObj->cObjGetSingle($conf['noResultObj'], $conf['noResultObj.'], 'noResultObj');
@@ -204,14 +218,20 @@ class tslib_content_SearchResult extends tslib_content_Abstract {
 
                                // wrapping
                        $content = $theValue;
-                       if ($conf['wrap']) {
-                               $content = $this->cObj->wrap($content, $conf['wrap']);
+
+                       $wrap = isset($conf['wrap.'])
+                               ? $this->cObj->stdWrap( $conf['wrap'], $conf['wrap.'])
+                               :  $conf['wrap'];
+                       if ($wrap) {
+                               $content = $this->cObj->wrap($content, $wrap);
                        }
-                       if ($conf['stdWrap.']) {
+
+                       if (isset($conf['stdWrap.'])) {
                                $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
                        }
                                // returning
                        $GLOBALS['TSFE']->set_no_cache();
+
                        return $content;
                }
        }