start.php

Go to the documentation of this file.
00001 <?php
00002 
00007 class Start extends oxUBase
00008 {
00014     protected $_sListDisplayType = null;
00015 
00020     protected $_sThisTemplate = 'page/shop/start.tpl';
00021 
00027     protected $_sMetaDescriptionIdent = 'oxstartmetadescription';
00028 
00034     protected $_sMetaKeywordsIdent = 'oxstartmetakeywords';
00035 
00041     protected $_blLoadActions = null;
00042 
00048     protected $_aTopArticleList = null;
00049 
00055     protected $_aNewArticleList = null;
00056 
00062     protected $_oFirstArticle = null;
00063 
00069     protected $_oCatOfferArticle = null;
00070 
00076     protected $_oCatOfferArtList = null;
00077 
00083     protected $_sTagCloud = null;
00084 
00089     protected $_blTop5Action = true;
00090 
00095     protected $_blBargainAction = true;
00096 
00104     public function render()
00105     {
00106         if ( oxConfig::getParameter( 'showexceptionpage' ) == '1' ) {
00107             return 'message/exception.tpl';
00108         }
00109 
00110         $myConfig = $this->getConfig();
00111 
00112         $oRss = oxNew('oxrssfeed');
00113         if ($myConfig->getConfigParam( 'iTop5Mode' ) && $myConfig->getConfigParam( 'bl_rssTopShop' ) ) {
00114             $this->addRssFeed( $oRss->getTopInShopTitle(), $oRss->getTopInShopUrl(), 'topArticles' );
00115         }
00116         if ( $myConfig->getConfigParam( 'iNewestArticlesMode' ) && $myConfig->getConfigParam( 'bl_rssNewest' ) ) {
00117             $this->addRssFeed( $oRss->getNewestArticlesTitle(), $oRss->getNewestArticlesUrl(), 'newestArticles' );
00118         }
00119         if ( $myConfig->getConfigParam( 'bl_rssBargain' ) ) {
00120             $this->addRssFeed( $oRss->getBargainTitle(), $oRss->getBargainUrl(), 'bargainArticles' );
00121         }
00122 
00123         parent::render();
00124 
00125         return $this->_sThisTemplate;
00126     }
00127 
00139     protected function _prepareMetaDescription( $sMeta, $iLength = 1024, $blDescTag = false )
00140     {
00141         if ( !$sMeta &&
00142             $this->getConfig()->getConfigParam( 'bl_perfLoadAktion' ) &&
00143             $oArt = $this->getFirstArticle() ) {
00144             $oDescField = $oArt->getArticleLongDesc();
00145             $sMeta = $oArt->oxarticles__oxtitle->value . ' - ' . $oDescField->value;
00146         }
00147         return parent::_prepareMetaDescription( $sMeta, $iLength, $blDescTag );
00148     }
00149 
00160     protected function _prepareMetaKeyword( $sKeywords, $blRemoveDuplicatedWords = true )
00161     {
00162         if ( !$sKeywords &&
00163             $this->getConfig()->getConfigParam( 'bl_perfLoadAktion' ) &&
00164             $oArt = $this->getFirstArticle() ) {
00165             $oDescField = $oArt->getArticleLongDesc();
00166             $sKeywords = $oDescField->value;
00167         }
00168 
00169         return parent::_prepareMetaKeyword( $sKeywords, $blRemoveDuplicatedWords );
00170     }
00171 
00177     protected function _getLoadActionsParam()
00178     {
00179         if ( $this->_blLoadActions === null ) {
00180             $this->_blLoadActions = false;
00181             if ( $this->getConfig()->getConfigParam( 'bl_perfLoadAktion' ) ) {
00182                 $this->_blLoadActions = true;
00183             }
00184         }
00185         return $this->_blLoadActions;
00186     }
00187 
00193     public function getArticleList()
00194     {
00195         if ( $this->_aArticleList === null ) {
00196             $this->_aArticleList = array();
00197             if ( $this->_getLoadActionsParam() ) {
00198                 // start list
00199                 $oArtList = oxNew( 'oxarticlelist' );
00200                 $oArtList->loadAktionArticles( 'OXSTART' );
00201                 if ( $oArtList->count() ) {
00202                     $this->_aArticleList = $oArtList;
00203                 }
00204             }
00205         }
00206         return $this->_aArticleList;
00207     }
00208 
00214     public function getTopArticleList()
00215     {
00216         if ( $this->_aTopArticleList === null ) {
00217             $this->_aTopArticleList = false;
00218             if ( $this->_getLoadActionsParam() ) {
00219                 // start list
00220                 $oArtList = oxNew( 'oxarticlelist' );
00221                 $oArtList->loadAktionArticles( 'OXTOPSTART' );
00222                 if ( $oArtList->count() ) {
00223                     $this->_aTopArticleList = $oArtList;
00224                 }
00225             }
00226         }
00227         return $this->_aTopArticleList;
00228     }
00229 
00230 
00231 
00232 
00238     public function getNewestArticles()
00239     {
00240         if ( $this->_aNewArticleList === null ) {
00241             $this->_aNewArticleList = array();
00242             if ( $this->_getLoadActionsParam() ) {
00243                 // newest articles
00244                 $oArtList = oxNew( 'oxarticlelist' );
00245                 $oArtList->loadNewestArticles();
00246                 if ( $oArtList->count() ) {
00247                     $this->_aNewArticleList = $oArtList;
00248                 }
00249             }
00250         }
00251         return $this->_aNewArticleList;
00252     }
00253 
00259     public function getFirstArticle()
00260     {
00261         if ( $this->_oFirstArticle === null ) {
00262             $this->_oFirstArticle = false;
00263             if ( $this->_getLoadActionsParam() ) {
00264                 // top articles ( big one )
00265                 $oArtList = oxNew( 'oxarticlelist' );
00266                 $oArtList->loadAktionArticles( 'OXFIRSTSTART' );
00267                 if ( $oArtList->count() ) {
00268                     $this->_oFirstArticle = $oArtList->current();
00269                 }
00270             }
00271         }
00272         return $this->_oFirstArticle;
00273     }
00274 
00280     public function getCatOfferArticle()
00281     {
00282         if ( $this->_oCatOfferArticle === null ) {
00283             $this->_oCatOfferArticle = false;
00284             if ( $oArtList = $this->getCatOfferArticleList() ) {
00285                 $this->_oCatOfferArticle = $oArtList->current();
00286             }
00287         }
00288         return $this->_oCatOfferArticle;
00289     }
00290 
00296     public function getCatOfferArticleList()
00297     {
00298         if ( $this->_oCatOfferArtList === null ) {
00299             $this->_oCatOfferArtList = array();
00300             if ( $this->_getLoadActionsParam() ) {
00301                 // "category offer" articles
00302                 $oArtList = oxNew( 'oxarticlelist' );
00303                 $oArtList->loadAktionArticles( 'OXCATOFFER' );
00304                 if ( $oArtList->count() ) {
00305                     $this->_oCatOfferArtList = $oArtList;
00306                 }
00307             }
00308         }
00309         return $this->_oCatOfferArtList;
00310     }
00311 
00317     public function getTagCloudManager()
00318     {
00319         return oxNew( "oxTagCloud" );
00320     }
00321 
00327     public function isMoreTagsVisible()
00328     {
00329         return true;
00330     }
00331 
00337     public function getTitleSuffix()
00338     {
00339         return $this->getConfig()->getActiveShop()->oxshops__oxstarttitle->value;
00340     }
00341 
00347     public function getCanonicalUrl()
00348     {
00349         if ( oxUtils::getInstance()->seoIsActive() && ( $oViewConf = $this->getViewConfig() ) ) {
00350             return oxUtilsUrl::getInstance()->prepareCanonicalUrl( $oViewConf->getHomeLink() );
00351         }
00352     }
00353 
00354 
00360     public function getBanners()
00361     {
00362 
00363         $oBannerList = null;
00364 
00365         if ( $this->getConfig()->getConfigParam( 'bl_perfLoadAktion' ) ) {
00366         $oBannerList = oxNew( 'oxActionList' );
00367         $oBannerList->loadBanners();
00368         }
00369 
00370         return $oBannerList;
00371     }
00372 
00378     public function getManufacturerForSlider()
00379     {
00380 
00381         $oList = null;
00382 
00383         if ( $this->getConfig()->getConfigParam( 'bl_perfLoadAktion' ) ) {
00384             $oList = $this->getManufacturerlist();
00385         }
00386 
00387         return $oList;
00388     }
00389 
00390 }