news.php

Go to the documentation of this file.
00001 <?php
00002 
00007 class News extends oxUBase
00008 {
00009 
00015     protected $_oNewsList = null;
00021     protected $_sThisTemplate = 'page/info/news.tpl';
00022 
00028     protected $_blBargainAction = true;
00029 
00030 
00036     protected $_oPageNavigation = null;
00037 
00043     protected $_iCntPages = null;
00044 
00050     public function getNews()
00051     {
00052         if ($this->_oNewsList === null) {
00053             $this->_oNewsList = false;
00054 
00055             $iPerPage = (int) $this->getConfig()->getConfigParam('iNrofCatArticles');
00056             $iPerPage = $iPerPage ? $iPerPage : 10;
00057 
00058             $oActNews = oxNew('oxnewslist');
00059 
00060             if ($iCnt = $oActNews->getCount()) {
00061 
00062                 $this->_iCntPages = round($iCnt / $iPerPage + 0.49);
00063 
00064                 $oActNews->loadNews($this->getActPage() * $iPerPage, $iPerPage);
00065                 $this->_oNewsList = $oActNews;
00066             }
00067         }
00068 
00069         return $this->_oNewsList;
00070     }
00071 
00072 
00078     public function getBreadCrumb()
00079     {
00080         $aPaths = array();
00081         $aPath = array();
00082 
00083         $oLang = oxRegistry::getLang();
00084         $iBaseLanguage = $oLang->getBaseLanguage();
00085         $sTranslatedString = $oLang->translateString('LATEST_NEWS_AND_UPDATES_AT', $iBaseLanguage, false);
00086 
00087         $aPath['title'] = $sTranslatedString . ' ' . $this->getConfig()->getActiveShop()->oxshops__oxname->value;
00088         $aPath['link'] = $this->getLink();
00089 
00090         $aPaths[] = $aPath;
00091 
00092         return $aPaths;
00093     }
00094 
00100     public function getPageNavigation()
00101     {
00102         if ($this->_oPageNavigation === null) {
00103             $this->_oPageNavigation = false;
00104             $this->_oPageNavigation = $this->generatePageNavigation();
00105         }
00106 
00107         return $this->_oPageNavigation;
00108     }
00109 
00115     public function getTitle()
00116     {
00117         $oLang = oxRegistry::getLang();
00118         $iBaseLanguage = $oLang->getBaseLanguage();
00119         $sTranslatedString = $oLang->translateString('LATEST_NEWS_AND_UPDATES_AT', $iBaseLanguage, false);
00120 
00121         return $sTranslatedString . ' ' . $this->getConfig()->getActiveShop()->oxshops__oxname->value;
00122     }
00123 }