start.php

Go to the documentation of this file.
00001 <?php
00002 
00007 class Start extends oxUBase
00008 {
00009 
00015     protected $_sListDisplayType = null;
00016 
00022     protected $_sThisTemplate = 'page/shop/start.tpl';
00023 
00029     protected $_sMetaDescriptionIdent = 'oxstartmetadescription';
00030 
00036     protected $_sMetaKeywordsIdent = 'oxstartmetakeywords';
00037 
00043     protected $_blLoadActions = null;
00044 
00050     protected $_aTopArticleList = null;
00051 
00057     protected $_aNewArticleList = null;
00058 
00064     protected $_oFirstArticle = null;
00065 
00071     protected $_oCatOfferArticle = null;
00072 
00078     protected $_oCatOfferArtList = null;
00079 
00085     protected $_sTagCloud = null;
00086 
00092     protected $_blTop5Action = true;
00093 
00099     protected $_blBargainAction = true;
00100 
00101 
00109     public function render()
00110     {
00111 
00112         if (oxRegistry::getConfig()->getRequestParameter('showexceptionpage') == '1') {
00113             return 'message/exception.tpl';
00114         }
00115 
00116         $myConfig = $this->getConfig();
00117 
00118         $oRss = oxNew('oxrssfeed');
00119         if ($myConfig->getConfigParam('iTop5Mode') && $myConfig->getConfigParam('bl_rssTopShop')) {
00120             $this->addRssFeed($oRss->getTopInShopTitle(), $oRss->getTopInShopUrl(), 'topArticles');
00121         }
00122         if ($myConfig->getConfigParam('iNewestArticlesMode') && $myConfig->getConfigParam('bl_rssNewest')) {
00123             $this->addRssFeed($oRss->getNewestArticlesTitle(), $oRss->getNewestArticlesUrl(), 'newestArticles');
00124         }
00125         if ($myConfig->getConfigParam('bl_rssBargain')) {
00126             $this->addRssFeed($oRss->getBargainTitle(), $oRss->getBargainUrl(), 'bargainArticles');
00127         }
00128 
00129         parent::render();
00130 
00131         return $this->_sThisTemplate;
00132     }
00133 
00145     protected function _prepareMetaDescription($sMeta, $iLength = 1024, $blDescTag = false)
00146     {
00147         if (!$sMeta &&
00148             $this->getConfig()->getConfigParam('bl_perfLoadAktion') &&
00149             $oArt = $this->getFirstArticle()
00150         ) {
00151             $oDescField = $oArt->getLongDescription();
00152             $sMeta = $oArt->oxarticles__oxtitle->value . ' - ' . $oDescField->value;
00153         }
00154 
00155         return parent::_prepareMetaDescription($sMeta, $iLength, $blDescTag);
00156     }
00157 
00168     protected function _prepareMetaKeyword($sKeywords, $blRemoveDuplicatedWords = true)
00169     {
00170         if (!$sKeywords &&
00171             $this->getConfig()->getConfigParam('bl_perfLoadAktion') &&
00172             $oArt = $this->getFirstArticle()
00173         ) {
00174             $oDescField = $oArt->getLongDescription();
00175             $sKeywords = $oDescField->value;
00176         }
00177 
00178         return parent::_prepareMetaKeyword($sKeywords, $blRemoveDuplicatedWords);
00179     }
00180 
00186     protected function _getLoadActionsParam()
00187     {
00188         if ($this->_blLoadActions === null) {
00189             $this->_blLoadActions = false;
00190             if ($this->getConfig()->getConfigParam('bl_perfLoadAktion')) {
00191                 $this->_blLoadActions = true;
00192             }
00193         }
00194 
00195         return $this->_blLoadActions;
00196     }
00197 
00203     public function getArticleList()
00204     {
00205         if ($this->_aArticleList === null) {
00206             $this->_aArticleList = array();
00207             if ($this->_getLoadActionsParam()) {
00208                 // start list
00209                 $oArtList = oxNew('oxarticlelist');
00210                 $oArtList->loadActionArticles('OXSTART');
00211                 if ($oArtList->count()) {
00212                     $this->_aArticleList = $oArtList;
00213                 }
00214             }
00215         }
00216 
00217         return $this->_aArticleList;
00218     }
00219 
00225     public function getTopArticleList()
00226     {
00227         if ($this->_aTopArticleList === null) {
00228             $this->_aTopArticleList = false;
00229             if ($this->_getLoadActionsParam()) {
00230                 // start list
00231                 $oArtList = oxNew('oxarticlelist');
00232                 $oArtList->loadActionArticles('OXTOPSTART');
00233                 if ($oArtList->count()) {
00234                     $this->_aTopArticleList = $oArtList;
00235                 }
00236             }
00237         }
00238 
00239         return $this->_aTopArticleList;
00240     }
00241 
00242 
00248     public function getNewestArticles()
00249     {
00250         if ($this->_aNewArticleList === null) {
00251             $this->_aNewArticleList = array();
00252             if ($this->_getLoadActionsParam()) {
00253                 // newest articles
00254                 $oArtList = oxNew('oxarticlelist');
00255                 $oArtList->loadNewestArticles();
00256                 if ($oArtList->count()) {
00257                     $this->_aNewArticleList = $oArtList;
00258                 }
00259             }
00260         }
00261 
00262         return $this->_aNewArticleList;
00263     }
00264 
00270     public function getFirstArticle()
00271     {
00272         if ($this->_oFirstArticle === null) {
00273             $this->_oFirstArticle = false;
00274             if ($this->_getLoadActionsParam()) {
00275                 // top articles ( big one )
00276                 $oArtList = oxNew('oxarticlelist');
00277                 $oArtList->loadActionArticles('OXFIRSTSTART');
00278                 if ($oArtList->count()) {
00279                     $this->_oFirstArticle = $oArtList->current();
00280                 }
00281             }
00282         }
00283 
00284         return $this->_oFirstArticle;
00285     }
00286 
00292     public function getCatOfferArticle()
00293     {
00294         if ($this->_oCatOfferArticle === null) {
00295             $this->_oCatOfferArticle = false;
00296             if ($oArtList = $this->getCatOfferArticleList()) {
00297                 $this->_oCatOfferArticle = $oArtList->current();
00298             }
00299         }
00300 
00301         return $this->_oCatOfferArticle;
00302     }
00303 
00309     public function getCatOfferArticleList()
00310     {
00311         if ($this->_oCatOfferArtList === null) {
00312             $this->_oCatOfferArtList = array();
00313             if ($this->_getLoadActionsParam()) {
00314                 // "category offer" articles
00315                 $oArtList = oxNew('oxarticlelist');
00316                 $oArtList->loadActionArticles('OXCATOFFER');
00317                 if ($oArtList->count()) {
00318                     $this->_oCatOfferArtList = $oArtList;
00319                 }
00320             }
00321         }
00322 
00323         return $this->_oCatOfferArtList;
00324     }
00325 
00331     public function getTitleSuffix()
00332     {
00333         return $this->getConfig()->getActiveShop()->oxshops__oxstarttitle->value;
00334     }
00335 
00341     public function getCanonicalUrl()
00342     {
00343         if (oxRegistry::getUtils()->seoIsActive() && ($oViewConf = $this->getViewConfig())) {
00344             return oxRegistry::get("oxUtilsUrl")->prepareCanonicalUrl($oViewConf->getHomeLink());
00345         }
00346     }
00347 
00348 
00354     public function getBanners()
00355     {
00356 
00357         $oBannerList = null;
00358 
00359         if ($this->getConfig()->getConfigParam('bl_perfLoadAktion')) {
00360             $oBannerList = oxNew('oxActionList');
00361             $oBannerList->loadBanners();
00362         }
00363 
00364         return $oBannerList;
00365     }
00366 
00372     public function getManufacturerForSlider()
00373     {
00374 
00375         $oList = null;
00376 
00377         if ($this->getConfig()->getConfigParam('bl_perfLoadAktion')) {
00378             $oList = $this->getManufacturerlist();
00379         }
00380 
00381         return $oList;
00382     }
00383 }