oxcmp_news.php

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