OXID eShop CE  4.9.7
 All Classes Files Functions Variables Pages
oxcmp_news.php
Go to the documentation of this file.
1 <?php
2 
8 class oxcmp_news extends oxView
9 {
10 
16  protected $_blIsComponent = true;
17 
25  public function render()
26  {
28 
29  $myConfig = $this->getConfig();
30  $oActView = $myConfig->getActiveView();
31 
32  // news loading is disabled
33  if (!$myConfig->getConfigParam('bl_perfLoadNews') ||
34  ($myConfig->getConfigParam('blDisableNavBars') &&
35  $oActView->getIsOrderStep())
36  ) {
37  return;
38  }
39 
40  // if news must be displayed only on start page ?
41  if ($myConfig->getConfigParam('bl_perfLoadNewsOnlyStart') &&
42  $oActView->getClassName() != "start"
43  ) {
44  return;
45  }
46 
47  $iNewsToLoad = $myConfig->getConfigParam('sCntOfNewsLoaded');
48  $iNewsToLoad = $iNewsToLoad ? $iNewsToLoad : 1;
49 
50  $oActNews = oxNew('oxnewslist');
51  $oActNews->loadNews(0, $iNewsToLoad);
52 
53  return $oActNews;
54  }
55 }