oxcmp_news.php

Go to the documentation of this file.
00001 <?php
00002 
00008 class oxcmp_news extends oxView
00009 {
00010 
00016     protected $_blIsComponent = true;
00017 
00025     public function render()
00026     {
00027         parent::render();
00028 
00029         $myConfig = $this->getConfig();
00030         $oActView = $myConfig->getActiveView();
00031 
00032         // news loading is disabled
00033         if (!$myConfig->getConfigParam('bl_perfLoadNews') ||
00034             ($myConfig->getConfigParam('blDisableNavBars') &&
00035              $oActView->getIsOrderStep())
00036         ) {
00037             return;
00038         }
00039 
00040         // if news must be displayed only on start page ?
00041         if ($myConfig->getConfigParam('bl_perfLoadNewsOnlyStart') &&
00042             $oActView->getClassName() != "start"
00043         ) {
00044             return;
00045         }
00046 
00047         $iNewsToLoad = $myConfig->getConfigParam('sCntOfNewsLoaded');
00048         $iNewsToLoad = $iNewsToLoad ? $iNewsToLoad : 1;
00049 
00050         $oActNews = oxNew('oxnewslist');
00051         $oActNews->loadNews(0, $iNewsToLoad);
00052 
00053         return $oActNews;
00054     }
00055 }