OXID eShop CE  4.8.12
 All Classes Files Functions Variables Pages
news.php
Go to the documentation of this file.
1 <?php
2 
7 class News extends oxUBase
8 {
13  protected $_oNewsList = null;
18  protected $_sThisTemplate = 'page/info/news.tpl';
19 
24  protected $_blBargainAction = true;
25 
26 
31  protected $_oPageNavigation = null;
32 
37  protected $_iCntPages = null;
38 
44  public function getNews()
45  {
46  if ( $this->_oNewsList === null ) {
47  $this->_oNewsList = false;
48 
49  $iPerPage = (int) $this->getConfig()->getConfigParam( 'iNrofCatArticles' );
50  $iPerPage = $iPerPage ? $iPerPage : 10;
51 
52  $oActNews = oxNew( 'oxnewslist' );
53 
54  if ( $iCnt = $oActNews->getCount() ) {
55 
56  $this->_iCntPages = round( $iCnt / $iPerPage + 0.49 );
57 
58  $oActNews->loadNews( $this->getActPage() * $iPerPage, $iPerPage );
59  $this->_oNewsList = $oActNews;
60  }
61  }
62 
63  return $this->_oNewsList;
64  }
65 
66 
72  public function getBreadCrumb()
73  {
74  $aPaths = array();
75  $aPath = array();
76 
77  $aPath['title'] = oxRegistry::getLang()->translateString( 'LATEST_NEWS_AND_UPDATES_AT', oxRegistry::getLang()->getBaseLanguage(), false );
78  $aPath['link'] = $this->getLink();
79 
80  $aPaths[] = $aPath;
81 
82  return $aPaths;
83  }
84 
90  public function getPageNavigation()
91  {
92  if ( $this->_oPageNavigation === null ) {
93  $this->_oPageNavigation = false;
94  $this->_oPageNavigation = $this->generatePageNavigation();
95  }
96 
98  }
99 
100 }