OXID eShop CE  4.10.2
 All Classes Namespaces Files Functions Variables Pages
news.php
Go to the documentation of this file.
1 <?php
2 
9 class News extends oxUBase
10 {
11 
17  protected $_oNewsList = null;
23  protected $_sThisTemplate = 'page/info/news.tpl';
24 
30  protected $_blBargainAction = true;
31 
32 
38  protected $_oPageNavigation = null;
39 
45  protected $_iCntPages = null;
46 
52  public function getNews()
53  {
54  if ($this->_oNewsList === null) {
55  $this->_oNewsList = false;
56 
57  $iPerPage = (int) $this->getConfig()->getConfigParam('iNrofCatArticles');
58  $iPerPage = $iPerPage ? $iPerPage : 10;
59 
60  $oActNews = oxNew('oxnewslist');
61 
62  if ($iCnt = $oActNews->getCount()) {
63 
64  $this->_iCntPages = round($iCnt / $iPerPage + 0.49);
65 
66  $oActNews->loadNews($this->getActPage() * $iPerPage, $iPerPage);
67  $this->_oNewsList = $oActNews;
68  }
69  }
70 
71  return $this->_oNewsList;
72  }
73 
74 
80  public function getBreadCrumb()
81  {
82  $aPaths = array();
83  $aPath = array();
84 
85  $oLang = oxRegistry::getLang();
86  $iBaseLanguage = $oLang->getBaseLanguage();
87  $sTranslatedString = $oLang->translateString('LATEST_NEWS_AND_UPDATES_AT', $iBaseLanguage, false);
88 
89  $aPath['title'] = $sTranslatedString . ' ' . $this->getConfig()->getActiveShop()->oxshops__oxname->value;
90  $aPath['link'] = $this->getLink();
91 
92  $aPaths[] = $aPath;
93 
94  return $aPaths;
95  }
96 
102  public function getPageNavigation()
103  {
104  if ($this->_oPageNavigation === null) {
105  $this->_oPageNavigation = false;
106  $this->_oPageNavigation = $this->generatePageNavigation();
107  }
108 
110  }
111 
117  public function getTitle()
118  {
119  $oLang = oxRegistry::getLang();
120  $iBaseLanguage = $oLang->getBaseLanguage();
121  $sTranslatedString = $oLang->translateString('LATEST_NEWS_AND_UPDATES_AT', $iBaseLanguage, false);
122 
123  return $sTranslatedString . ' ' . $this->getConfig()->getActiveShop()->oxshops__oxname->value;
124  }
125 }