news.php

Go to the documentation of this file.
00001 <?php
00002 
00007 class News extends oxUBase
00008 {
00013     protected $_oNewsList = null;
00018     protected $_sThisTemplate = 'page/info/news.tpl';
00019 
00024     protected $_blBargainAction = true;
00025 
00026 
00031     protected $_oPageNavigation = null;
00032 
00037     protected $_iCntPages = null;
00038 
00044     public function getNews()
00045     {
00046         if ( $this->_oNewsList === null ) {
00047             $this->_oNewsList = false;
00048 
00049             $iPerPage = (int) $this->getConfig()->getConfigParam( 'iNrofCatArticles' );
00050             $iPerPage = $iPerPage ? $iPerPage : 10;
00051 
00052             $oActNews = oxNew( 'oxnewslist' );
00053 
00054             if ( $iCnt = $oActNews->getCount() ) {
00055 
00056                  $this->_iCntPages = round( $iCnt / $iPerPage + 0.49 );
00057 
00058                  $oActNews->loadNews( $this->getActPage() * $iPerPage, $iPerPage );
00059                  $this->_oNewsList = $oActNews;
00060             }
00061         }
00062 
00063         return $this->_oNewsList;
00064     }
00065 
00066 
00072     public function getBreadCrumb()
00073     {
00074         $aPaths = array();
00075         $aPath  = array();
00076 
00077         $aPath['title'] = oxRegistry::getLang()->translateString( 'LATEST_NEWS_AND_UPDATES_AT', oxRegistry::getLang()->getBaseLanguage(), false );
00078         $aPath['link']  = $this->getLink();
00079 
00080         $aPaths[] = $aPath;
00081 
00082         return $aPaths;
00083     }
00084 
00090     public function getPageNavigation()
00091     {
00092         if ( $this->_oPageNavigation === null ) {
00093             $this->_oPageNavigation = false;
00094             $this->_oPageNavigation = $this->generatePageNavigation();
00095         }
00096 
00097         return $this->_oPageNavigation;
00098     }
00099 
00100 }