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 
00097 
00105     public function render()
00106     {
00107 
00108         if ( oxConfig::getParameter( 'showexceptionpage' ) == '1' ) {
00109             return 'message/exception.tpl';
00110         }
00111 
00112         $myConfig = $this->getConfig();
00113 
00114         $oRss = oxNew('oxrssfeed');
00115         if ($myConfig->getConfigParam( 'iTop5Mode' ) && $myConfig->getConfigParam( 'bl_rssTopShop' ) ) {
00116             $this->addRssFeed( $oRss->getTopInShopTitle(), $oRss->getTopInShopUrl(), 'topArticles' );
00117         }
00118         if ( $myConfig->getConfigParam( 'iNewestArticlesMode' ) && $myConfig->getConfigParam( 'bl_rssNewest' ) ) {
00119             $this->addRssFeed( $oRss->getNewestArticlesTitle(), $oRss->getNewestArticlesUrl(), 'newestArticles' );
00120         }
00121         if ( $myConfig->getConfigParam( 'bl_rssBargain' ) ) {
00122             $this->addRssFeed( $oRss->getBargainTitle(), $oRss->getBargainUrl(), 'bargainArticles' );
00123         }
00124 
00125         parent::render();
00126 
00127         return $this->_sThisTemplate;
00128     }
00129 
00141     protected function _prepareMetaDescription( $sMeta, $iLength = 1024, $blDescTag = false )
00142     {
00143         if ( !$sMeta &&
00144             $this->getConfig()->getConfigParam( 'bl_perfLoadAktion' ) &&
00145             $oArt = $this->getFirstArticle() ) {
00146             $oDescField = $oArt->getLongDescription();
00147             $sMeta = $oArt->oxarticles__oxtitle->value . ' - ' . $oDescField->value;
00148         }
00149         return parent::_prepareMetaDescription( $sMeta, $iLength, $blDescTag );
00150     }
00151 
00162     protected function _prepareMetaKeyword( $sKeywords, $blRemoveDuplicatedWords = true )
00163     {
00164         if ( !$sKeywords &&
00165             $this->getConfig()->getConfigParam( 'bl_perfLoadAktion' ) &&
00166             $oArt = $this->getFirstArticle() ) {
00167             $oDescField = $oArt->getLongDescription();
00168             $sKeywords = $oDescField->value;
00169         }
00170 
00171         return parent::_prepareMetaKeyword( $sKeywords, $blRemoveDuplicatedWords );
00172     }
00173 
00179     protected function _getLoadActionsParam()
00180     {
00181         if ( $this->_blLoadActions === null ) {
00182             $this->_blLoadActions = false;
00183             if ( $this->getConfig()->getConfigParam( 'bl_perfLoadAktion' ) ) {
00184                 $this->_blLoadActions = true;
00185             }
00186         }
00187         return $this->_blLoadActions;
00188     }
00189 
00195     public function getArticleList()
00196     {
00197         if ( $this->_aArticleList === null ) {
00198             $this->_aArticleList = array();
00199             if ( $this->_getLoadActionsParam() ) {
00200                 // start list
00201                 $oArtList = oxNew( 'oxarticlelist' );
00202                 $oArtList->loadActionArticles( 'OXSTART' );
00203                 if ( $oArtList->count() ) {
00204                     $this->_aArticleList = $oArtList;
00205                 }
00206             }
00207         }
00208         return $this->_aArticleList;
00209     }
00210 
00216     public function getTopArticleList()
00217     {
00218         if ( $this->_aTopArticleList === null ) {
00219             $this->_aTopArticleList = false;
00220             if ( $this->_getLoadActionsParam() ) {
00221                 // start list
00222                 $oArtList = oxNew( 'oxarticlelist' );
00223                 $oArtList->loadActionArticles( 'OXTOPSTART' );
00224                 if ( $oArtList->count() ) {
00225                     $this->_aTopArticleList = $oArtList;
00226                 }
00227             }
00228         }
00229         return $this->_aTopArticleList;
00230     }
00231 
00232 
00233 
00234 
00240     public function getNewestArticles()
00241     {
00242         if ( $this->_aNewArticleList === null ) {
00243             $this->_aNewArticleList = array();
00244             if ( $this->_getLoadActionsParam() ) {
00245                 // newest articles
00246                 $oArtList = oxNew( 'oxarticlelist' );
00247                 $oArtList->loadNewestArticles();
00248                 if ( $oArtList->count() ) {
00249                     $this->_aNewArticleList = $oArtList;
00250                 }
00251             }
00252         }
00253         return $this->_aNewArticleList;
00254     }
00255 
00261     public function getFirstArticle()
00262     {
00263         if ( $this->_oFirstArticle === null ) {
00264             $this->_oFirstArticle = false;
00265             if ( $this->_getLoadActionsParam() ) {
00266                 // top articles ( big one )
00267                 $oArtList = oxNew( 'oxarticlelist' );
00268                 $oArtList->loadActionArticles( 'OXFIRSTSTART' );
00269                 if ( $oArtList->count() ) {
00270                     $this->_oFirstArticle = $oArtList->current();
00271                 }
00272             }
00273         }
00274         return $this->_oFirstArticle;
00275     }
00276 
00282     public function getCatOfferArticle()
00283     {
00284         if ( $this->_oCatOfferArticle === null ) {
00285             $this->_oCatOfferArticle = false;
00286             if ( $oArtList = $this->getCatOfferArticleList() ) {
00287                 $this->_oCatOfferArticle = $oArtList->current();
00288             }
00289         }
00290         return $this->_oCatOfferArticle;
00291     }
00292 
00298     public function getCatOfferArticleList()
00299     {
00300         if ( $this->_oCatOfferArtList === null ) {
00301             $this->_oCatOfferArtList = array();
00302             if ( $this->_getLoadActionsParam() ) {
00303                 // "category offer" articles
00304                 $oArtList = oxNew( 'oxarticlelist' );
00305                 $oArtList->loadActionArticles( 'OXCATOFFER' );
00306                 if ( $oArtList->count() ) {
00307                     $this->_oCatOfferArtList = $oArtList;
00308                 }
00309             }
00310         }
00311         return $this->_oCatOfferArtList;
00312     }
00313 
00319     public function getTitleSuffix()
00320     {
00321         return $this->getConfig()->getActiveShop()->oxshops__oxstarttitle->value;
00322     }
00323 
00329     public function getCanonicalUrl()
00330     {
00331         if ( oxRegistry::getUtils()->seoIsActive() && ( $oViewConf = $this->getViewConfig() ) ) {
00332             return oxRegistry::get("oxUtilsUrl")->prepareCanonicalUrl( $oViewConf->getHomeLink() );
00333         }
00334     }
00335 
00336 
00342     public function getBanners()
00343     {
00344 
00345         $oBannerList = null;
00346 
00347         if ( $this->getConfig()->getConfigParam( 'bl_perfLoadAktion' ) ) {
00348         $oBannerList = oxNew( 'oxActionList' );
00349         $oBannerList->loadBanners();
00350         }
00351 
00352         return $oBannerList;
00353     }
00354 
00360     public function getManufacturerForSlider()
00361     {
00362 
00363         $oList = null;
00364 
00365         if ( $this->getConfig()->getConfigParam( 'bl_perfLoadAktion' ) ) {
00366             $oList = $this->getManufacturerlist();
00367         }
00368 
00369         return $oList;
00370     }
00371 
00372 }