OXID eShop CE  4.9.10
 All Classes Files Functions Variables Pages
news.php
Go to the documentation of this file.
1 <?php
2 
7 class News extends oxUBase
8 {
9 
15  protected $_oNewsList = null;
21  protected $_sThisTemplate = 'page/info/news.tpl';
22 
28  protected $_blBargainAction = true;
29 
30 
36  protected $_oPageNavigation = null;
37 
43  protected $_iCntPages = null;
44 
50  public function getNews()
51  {
52  if ($this->_oNewsList === null) {
53  $this->_oNewsList = false;
54 
55  $iPerPage = (int) $this->getConfig()->getConfigParam('iNrofCatArticles');
56  $iPerPage = $iPerPage ? $iPerPage : 10;
57 
58  $oActNews = oxNew('oxnewslist');
59 
60  if ($iCnt = $oActNews->getCount()) {
61 
62  $this->_iCntPages = round($iCnt / $iPerPage + 0.49);
63 
64  $oActNews->loadNews($this->getActPage() * $iPerPage, $iPerPage);
65  $this->_oNewsList = $oActNews;
66  }
67  }
68 
69  return $this->_oNewsList;
70  }
71 
72 
78  public function getBreadCrumb()
79  {
80  $aPaths = array();
81  $aPath = array();
82 
83  $oLang = oxRegistry::getLang();
84  $iBaseLanguage = $oLang->getBaseLanguage();
85  $sTranslatedString = $oLang->translateString('LATEST_NEWS_AND_UPDATES_AT', $iBaseLanguage, false);
86 
87  $aPath['title'] = $sTranslatedString . ' ' . $this->getConfig()->getActiveShop()->oxshops__oxname->value;
88  $aPath['link'] = $this->getLink();
89 
90  $aPaths[] = $aPath;
91 
92  return $aPaths;
93  }
94 
100  public function getPageNavigation()
101  {
102  if ($this->_oPageNavigation === null) {
103  $this->_oPageNavigation = false;
104  $this->_oPageNavigation = $this->generatePageNavigation();
105  }
106 
108  }
109 
115  public function getTitle()
116  {
117  $oLang = oxRegistry::getLang();
118  $iBaseLanguage = $oLang->getBaseLanguage();
119  $sTranslatedString = $oLang->translateString('LATEST_NEWS_AND_UPDATES_AT', $iBaseLanguage, false);
120 
121  return $sTranslatedString . ' ' . $this->getConfig()->getActiveShop()->oxshops__oxname->value;
122  }
123 }