genexport_do.php

Go to the documentation of this file.
00001 <?php
00002 
00006 class GenExport_Do extends DynExportBase
00007 {
00013     public $sClassDo       = "genExport_do";
00014 
00020     public $sClassMain     = "genExport_main";
00021 
00027     public $sExportFileName = "genexport";
00028 
00033     protected $_sThisTemplate = "dynbase_do.tpl";
00034 
00042     public function nextTick( $iCnt )
00043     {
00044         $iExportedItems = $iCnt;
00045         $blContinue = false;
00046         if ( $oArticle = $this->getOneArticle( $iCnt, $blContinue ) ) {
00047             $myConfig = oxRegistry::getConfig();
00048             $oSmarty = oxRegistry::get("oxUtilsView")->getSmarty();
00049             $oSmarty->assign( "sCustomHeader", oxSession::getVar("sExportCustomHeader") );
00050             $oSmarty->assign_by_ref( "linenr", $iCnt );
00051             $oSmarty->assign_by_ref( "article", $oArticle );
00052             $oSmarty->assign( "spr", $myConfig->getConfigParam( 'sCSVSign' ) );
00053             $oSmarty->assign( "encl", $myConfig->getConfigParam( 'sGiCsvFieldEncloser' ) );
00054             $this->write( $oSmarty->fetch( "genexport.tpl", $this->getViewId() ) );
00055             return ++$iExportedItems;
00056         }
00057 
00058         return $blContinue;
00059     }
00060 
00068     public function write( $sLine )
00069     {
00070         $sLine = $this->removeSID( $sLine );
00071 
00072         $sLine = str_replace( array("\r\n","\n"), "", $sLine );
00073         $sLine = str_replace( "<br>", "\n", $sLine );
00074 
00075         fwrite( $this->fpFile, $sLine."\r\n");
00076     }
00077 
00078 }