oxseoencoderrecomm.php

Go to the documentation of this file.
00001 <?php
00002 
00007 class oxSeoEncoderRecomm extends oxSeoEncoder
00008 {
00009 
00018     public function getRecommUri($oRecomm, $iLang = null)
00019     {
00020         if (!($sSeoUrl = $this->_loadFromDb('dynamic', $oRecomm->getId(), $iLang))) {
00021             $myConfig = $this->getConfig();
00022 
00023             // fetching part of base url
00024             $sSeoUrl = $this->_getStaticUri(
00025                 $oRecomm->getBaseStdLink($iLang, false),
00026                 $myConfig->getShopId(),
00027                 $iLang
00028             )
00029             . $this->_prepareTitle($oRecomm->oxrecommlists__oxtitle->value, false, $iLang);
00030 
00031             // creating unique
00032             $sSeoUrl = $this->_processSeoUrl($sSeoUrl, $oRecomm->getId(), $iLang);
00033 
00034             // inserting
00035             $this->_saveToDb('dynamic', $oRecomm->getId(), $oRecomm->getBaseStdLink($iLang), $sSeoUrl, $iLang, $myConfig->getShopId());
00036         }
00037 
00038         return $sSeoUrl;
00039     }
00040 
00049     public function getRecommUrl($oRecomm, $iLang = null)
00050     {
00051         if (!isset($iLang)) {
00052             $iLang = oxRegistry::getLang()->getBaseLanguage();
00053         }
00054 
00055         return $this->_getFullUrl($this->getRecommUri($oRecomm, $iLang), $iLang);
00056     }
00057 
00068     public function getRecommPageUrl($oRecomm, $iPage, $iLang = null, $blFixed = false)
00069     {
00070         if (!isset($iLang)) {
00071             $iLang = oxRegistry::getLang()->getBaseLanguage();
00072         }
00073         $sStdUrl = $oRecomm->getBaseStdLink($iLang) . '&amp;pgNr=' . $iPage;
00074         $sParams = (int) ($iPage + 1);
00075 
00076         $sStdUrl = $this->_trimUrl($sStdUrl, $iLang);
00077         $sSeoUrl = $this->getRecommUri($oRecomm, $iLang) . $sParams . "/";
00078 
00079         return $this->_getFullUrl($this->_getPageUri($oRecomm, 'dynamic', $sStdUrl, $sSeoUrl, $sParams, $iLang, $blFixed), $iLang);
00080     }
00081 }