Exemple #1
0
 /**
  * Sets details locator data for articles that came from recommlist.
  *
  * Template variables:
  * <b>sSearchTitle</b>, <b>searchparamforhtml</b>
  *
  * @param oxubase   $oLocatorTarget oxubase object
  * @param oxarticle $oCurrArticle   current article
  *
  * @deprecated since v5.3 (2016-06-17); Listmania will be moved to an own module.
  */
 protected function _setRecommlistLocatorData($oLocatorTarget, $oCurrArticle)
 {
     if ($oRecommList = $oLocatorTarget->getActiveRecommList()) {
         // loading data for article navigation
         $oIdList = oxNew('oxArticleList');
         $oIdList->loadRecommArticleIds($oRecommList->getId(), null);
         //page number
         $iPage = $this->_findActPageNumber($oLocatorTarget->getActPage(), $oIdList, $oCurrArticle);
         $sSearchRecomm = oxRegistry::getConfig()->getRequestParameter('searchrecomm', true);
         if ($sSearchRecomm !== null) {
             $sSearchFormRecomm = oxRegistry::getConfig()->getRequestParameter('searchrecomm');
             $sSearchLinkRecomm = rawurlencode($sSearchRecomm);
             $sAddSearch = 'searchrecomm=' . $sSearchLinkRecomm;
         }
         // setting product position in list, amount of articles etc
         $oRecommList->iCntOfProd = $oIdList->count();
         $oRecommList->iProductPos = $this->_getProductPos($oCurrArticle, $oIdList, $oLocatorTarget);
         $blSeo = oxRegistry::getUtils()->seoIsActive();
         if ($blSeo && $iPage) {
             /** @var oxSeoEncoderRecomm $oSeoEncoderRecomm */
             $oSeoEncoderRecomm = oxRegistry::get("oxSeoEncoderRecomm");
             $oRecommList->toListLink = $oSeoEncoderRecomm->getRecommPageUrl($oRecommList, $iPage);
         } else {
             $oRecommList->toListLink = $this->_makeLink($oRecommList->getLink(), $this->_getPageNumber($iPage));
         }
         $oRecommList->toListLink = $this->_makeLink($oRecommList->toListLink, $sAddSearch);
         $sAdd = '';
         if (!$blSeo) {
             $sAdd = 'recommid=' . $oRecommList->getId() . '&amp;listtype=recommlist' . ($sAddSearch ? '&amp;' : '');
         }
         $sAdd .= $sAddSearch;
         $oNextProduct = $this->_oNextProduct;
         $oBackProduct = $this->_oBackProduct;
         $oRecommList->nextProductLink = $oNextProduct ? $this->_makeLink($oNextProduct->getLink(), $sAdd) : null;
         $oRecommList->prevProductLink = $oBackProduct ? $this->_makeLink($oBackProduct->getLink(), $sAdd) : null;
         $oLang = oxRegistry::getLang();
         $sTitle = $oLang->translateString('RECOMMLIST');
         if ($sSearchRecomm !== null) {
             $sTitle .= " / " . $oLang->translateString('RECOMMLIST_SEARCH') . ' "' . $sSearchFormRecomm . '"';
         }
         $oLocatorTarget->setSearchTitle($sTitle);
         $oLocatorTarget->setActiveCategory($oRecommList);
     }
 }