OXID eShop CE  4.8.10
 All Classes Files Functions Variables Pages
dynexportbase.php
Go to the documentation of this file.
1 <?php
2 
6 DEFINE("ERR_SUCCESS", -2);
7 DEFINE("ERR_GENERAL", -1);
8 DEFINE("ERR_FILEIO", 1);
9 
16 {
22  public $sClassDo = "";
23 
29  public $sClassMain = "";
30 
36  public $sExportPath = "export/";
37 
43  public $sExportFileType = "txt";
44 
50  public $sExportFileName = "dynexport";
51 
57  public $fpFile = null;
58 
65  public $iExportPerTick = 30;
66 
72  protected $_iExportPerTick = null;
73 
79  protected $_sFilePath = null;
80 
86  protected $_aExportResultset = array();
87 
93  protected $_sThisTemplate = "dynexportbase.tpl";
94 
100  protected $_aCatLvlCache = null;
101 
107  public function __construct()
108  {
110 
111  // set generic frame template
112  $this->_sFilePath = $this->getConfig()->getConfigParam( 'sShopDir' ) . "/". $this->sExportPath . $this->sExportFileName . "." . $this->sExportFileType;
113  }
114 
121  public function render()
122  {
123  parent::render();
124 
125  // assign all member variables to template
126  $aClassVars = get_object_vars( $this );
127  while ( list( $name, $value ) = each( $aClassVars ) ) {
128  $this->_aViewData[$name] = $value;
129  }
130 
131  $this->_aViewData['sOutputFile'] = $this->_sFilePath;
132  $this->_aViewData['sDownloadFile'] = $this->getConfig()->getConfigParam( 'sShopURL' ) . $this->sExportPath . $this->sExportFileName . "." . $this->sExportFileType;
133 
134  return $this->_sThisTemplate;
135  }
136 
142  public function createMainExportView()
143  {
144  // parent categorie tree
145  $this->_aViewData["cattree"] = oxNew( "oxCategoryList" );
146  $this->_aViewData["cattree"]->loadList();
147 
148  $oLangObj = oxNew( 'oxLang' );
149  $aLangs = $oLangObj->getLanguageArray();
150  foreach ( $aLangs as $id => $language) {
151  $language->selected = ($id == $this->_iEditLang);
152  $this->_aViewData["aLangs"][$id] = clone $language;
153  }
154  }
155 
161  public function start()
162  {
163  // delete file, if its already there
164  $this->fpFile = @fopen( $this->_sFilePath, "w" );
165  if ( !isset( $this->fpFile ) || !$this->fpFile ) {
166  // we do have an error !
167  $this->stop( ERR_FILEIO );
168  } else {
169  $this->_aViewData['refresh'] = 0;
170  $this->_aViewData['iStart'] = 0;
171  fclose( $this->fpFile );
172 
173  // prepare it
174  $iEnd = $this->prepareExport();
175  oxSession::setVar( "iEnd", $iEnd );
176  $this->_aViewData['iEnd'] = $iEnd;
177  }
178  }
179 
187  public function stop( $iError = 0 )
188  {
189  if ( $iError ) {
190  $this->_aViewData['iError'] = $iError;
191  }
192 
193  // delete temporary heap table
194  oxDb::getDb()->execute( "drop TABLE if exists ". $this->_getHeapTableName() );
195  }
196 
204  public function nextTick( $iCnt)
205  {
206  return false;
207  }
208 
216  public function write( $sLine )
217  {
218  $sLine = $this->removeSID( $sLine );
219  $sLine = str_replace( array("\r\n","\n"), "", $sLine);
220  fwrite( $this->fpFile, $sLine."\r\n");
221  }
222 
228  public function run()
229  {
230  $blContinue = true;
231  $iExportedItems = 0;
232 
233  $this->fpFile = @fopen( $this->_sFilePath, "a");
234  if ( !isset( $this->fpFile) || !$this->fpFile) {
235  // we do have an error !
236  $this->stop( ERR_FILEIO);
237  } else {
238  // file is open
239  $iStart = oxConfig::getParameter("iStart");
240  // load from session
241  $this->_aExportResultset = oxConfig::getParameter( "aExportResultset");
243  for ( $i = $iStart; $i < $iStart + $iExportPerTick; $i++) {
244  if ( ( $iExportedItems = $this->nextTick( $i ) ) === false ) {
245  // end reached
246  $this->stop( ERR_SUCCESS);
247  $blContinue = false;
248  break;
249  }
250  }
251  if ( $blContinue) {
252  // make ticker continue
253  $this->_aViewData['refresh'] = 0;
254  $this->_aViewData['iStart'] = $i;
255  $this->_aViewData['iExpItems'] = $iExportedItems;
256  }
257  fclose( $this->fpFile);
258  }
259  }
260 
266  public function getExportPerTick()
267  {
268  if ( $this->_iExportPerTick === null ) {
269  $this->_iExportPerTick = (int) oxRegistry::getConfig()->getConfigParam("iExportNrofLines");
270  if ( !$this->_iExportPerTick ) {
271  $this->_iExportPerTick = $this->iExportPerTick;
272  }
273  }
274  return $this->_iExportPerTick;
275  }
276 
284  public function setExportPerTick( $iCount )
285  {
286  $this->_iExportPerTick = $iCount;
287  }
288 
296  public function removeSid( $sInput )
297  {
298  $sSid = $this->getSession()->getId();
299 
300  // remove sid from link
301  $sOutput = str_replace( "sid={$sSid}/", "", $sInput);
302  $sOutput = str_replace( "sid/{$sSid}/", "", $sOutput);
303  $sOutput = str_replace( "sid={$sSid}&amp;", "", $sOutput);
304  $sOutput = str_replace( "sid={$sSid}&", "", $sOutput);
305  $sOutput = str_replace( "sid={$sSid}", "", $sOutput);
306 
307  return $sOutput;
308  }
309 
319  public function shrink( $sInput, $iMaxSize, $blRemoveNewline = true )
320  {
321  if ( $blRemoveNewline ) {
322  $sInput = str_replace( "\r\n", " ", $sInput );
323  $sInput = str_replace( "\n", " ", $sInput );
324  }
325 
326  $sInput = str_replace( "\t", " ", $sInput );
327 
328  // remove html entities, remove html tags
329  $sInput = $this->_unHTMLEntities( strip_tags( $sInput ) );
330 
331  $oStr = getStr();
332  if ( $oStr->strlen( $sInput ) > $iMaxSize - 3 ) {
333  $sInput = $oStr->substr( $sInput, 0, $iMaxSize - 5 ) . "...";
334  }
335 
336  return $sInput;
337  }
338 
347  public function getCategoryString( $oArticle, $sSeparator = "/" )
348  {
349  $sCatStr = '';
350 
351  $sLang = oxRegistry::getLang()->getBaseLanguage();
352  $oDB = oxDb::getDb();
353 
354  $sCatView = getViewName( 'oxcategories', $sLang );
355  $sO2CView = getViewName( 'oxobject2category', $sLang );
356 
357  //selecting category
358  $sQ = "select $sCatView.oxleft, $sCatView.oxright, $sCatView.oxrootid from $sO2CView as oxobject2category left join $sCatView on $sCatView.oxid = oxobject2category.oxcatnid ";
359  $sQ .= "where oxobject2category.oxobjectid=".$oDB->quote( $oArticle->getId() )." and $sCatView.oxactive = 1 order by oxobject2category.oxtime ";
360 
361  $oRs = $oDB->execute( $sQ );
362  if ( $oRs != false && $oRs->recordCount() > 0 ) {
363  $sLeft = $oRs->fields[0];
364  $sRight = $oRs->fields[1];
365  $sRootId = $oRs->fields[2];
366 
367  //selecting all parent category titles
368  $sQ = "select oxtitle from $sCatView where oxright >= {$sRight} and oxleft <= {$sLeft} and oxrootid = '{$sRootId}' order by oxleft ";
369 
370  $oRs = $oDB->execute( $sQ );
371  if ( $oRs != false && $oRs->recordCount() > 0 ) {
372  while ( !$oRs->EOF ) {
373  if ( $sCatStr ) {
374  $sCatStr .= $sSeparator;
375  }
376  $sCatStr .= $oRs->fields[0];
377  $oRs->moveNext();
378  }
379  }
380  }
381 
382  return $sCatStr;
383  }
384 
392  public function getDefaultCategoryString( $oArticle )
393  {
394  $sLang = oxRegistry::getLang()->getBaseLanguage();
395  $oDB = oxDb::getDb();
396 
397  $sCatView = getViewName( 'oxcategories', $sLang );
398  $sO2CView = getViewName( 'oxobject2category', $sLang );
399 
400  //selecting category
401  $sQ = "select $sCatView.oxtitle from $sO2CView as oxobject2category left join $sCatView on $sCatView.oxid = oxobject2category.oxcatnid ";
402  $sQ .= "where oxobject2category.oxobjectid=".$oDB->quote( $oArticle->getId() )." and $sCatView.oxactive = 1 order by oxobject2category.oxtime ";
403 
404  return $oDB->getOne( $sQ);
405  }
406 
414  public function prepareCSV( $sInput )
415  {
416  $sInput = oxRegistry::get("oxUtilsString")->prepareCSVField( $sInput );
417  return str_replace( array( "&nbsp;", "&euro;", "|" ), array( " ", "", "" ), $sInput );
418  }
419 
427  public function prepareXML( $sInput )
428  {
429  $sOutput = str_replace( "&", "&amp;", $sInput );
430  $sOutput = str_replace( "\"", "&quot;", $sOutput );
431  $sOutput = str_replace( ">", "&gt;", $sOutput );
432  $sOutput = str_replace( "<", "&lt;", $sOutput );
433  $sOutput = str_replace( "'", "&apos;", $sOutput );
434 
435  return $sOutput;
436  }
437 
445  public function getDeepestCategoryPath( $oArticle )
446  {
447  return $this->_findDeepestCatPath( $oArticle );
448  }
449 
455  public function prepareExport()
456  {
457  $oDB = oxDb::getDb();
458  $sHeapTable = $this->_getHeapTableName();
459 
460  // #1070 Saulius 2005.11.28
461  // check mySQL version
462  $oRs = $oDB->execute( "SHOW VARIABLES LIKE 'version'" );
463  $sTableCharset = $this->_generateTableCharSet( $oRs->fields[1] );
464 
465  // create heap table
466  if ( !( $this->_createHeapTable( $sHeapTable, $sTableCharset ) ) ) {
467  // error
468  oxRegistry::getUtils()->showMessageAndExit( "Could not create HEAP Table {$sHeapTable}\n<br>" );
469  }
470 
471  $sCatAdd = $this->_getCatAdd( oxConfig::getParameter( "acat" ) );
472  if ( !$this->_insertArticles( $sHeapTable, $sCatAdd ) ) {
473  oxRegistry::getUtils()->showMessageAndExit( "Could not insert Articles in Table {$sHeapTable}\n<br>" );
474  }
475 
476  $this->_removeParentArticles( $sHeapTable );
477  $this->_setSessionParams();
478 
479  // get total cnt
480  return $oDB->getOne( "select count(*) from {$sHeapTable}" );
481  }
482 
491  public function getOneArticle( $iCnt, & $blContinue )
492  {
493  $myConfig = $this->getConfig();
494 
495  //[Alfonsas 2006-05-31] setting specific parameter
496  //to be checked in oxarticle.php init() method
497  $myConfig->setConfigParam( 'blExport', true );
498  $blContinue = false;
499 
500  if ( ( $oArticle = $this->_initArticle( $this->_getHeapTableName(), $iCnt, $blContinue ) ) ) {
501  $blContinue = true;
502  $oArticle = $this->_setCampaignDetailLink( $oArticle );
503  }
504 
505  //[Alfonsas 2006-05-31] unsetting specific parameter
506  //to be checked in oxarticle.php init() method
507  $myConfig->setConfigParam( 'blExport', false );
508 
509  return $oArticle;
510  }
511 
520  public function assureContent( $sInput, $sReplace = null)
521  {
522  $oStr = getStr();
523  if ( !$oStr->strlen( $sInput ) ) {
524  if ( !isset( $sReplace ) || !$oStr->strlen( $sReplace ) ) {
525  $sReplace = "-";
526  }
527  $sInput = $sReplace;
528  }
529  return $sInput;
530  }
531 
540  protected function _unHtmlEntities( $sInput )
541  {
542  $aTransTbl = array_flip( get_html_translation_table( HTML_ENTITIES ) );
543  return strtr( $sInput, $aTransTbl );
544  }
545 
551  protected function _getHeapTableName()
552  {
553  // table name must not start with any digit
554  return "tmp_".str_replace( "0", "", md5( $this->getSession()->getId() ) );
555  }
556 
564  protected function _generateTableCharSet( $sMysqlVersion )
565  {
566  $sTableCharset = "";
567 
568  //if MySQL >= 4.1.0 set charsets and collations
569  if ( version_compare( $sMysqlVersion, '4.1.0', '>=' ) > 0 ) {
570  $oDB = oxDb::getDb( oxDB::FETCH_MODE_ASSOC );
571  $oRs = $oDB->execute( "SHOW FULL COLUMNS FROM `oxarticles` WHERE field like 'OXID'" );
572  if ( isset( $oRs->fields['Collation'] ) && ( $sMysqlCollation = $oRs->fields['Collation'] ) ) {
573  $oRs = $oDB->execute( "SHOW COLLATION LIKE '{$sMysqlCollation}'" );
574  if ( isset( $oRs->fields['Charset'] ) && ( $sMysqlCharacterSet = $oRs->fields['Charset'] ) ) {
575  $sTableCharset = "DEFAULT CHARACTER SET {$sMysqlCharacterSet} COLLATE {$sMysqlCollation}";
576  }
577  }
578 
579  }
580  return $sTableCharset;
581  }
582 
591  protected function _createHeapTable( $sHeapTable, $sTableCharset )
592  {
593  $blDone = false;
594 
595  $oDB = oxDb::getDb();
596  $sQ = "CREATE TABLE IF NOT EXISTS {$sHeapTable} ( `oxid` CHAR(32) NOT NULL default '' ) ENGINE=InnoDB {$sTableCharset}";
597  if ( ( $oDB->execute( $sQ ) ) !== false ) {
598  $blDone = true;
599  $oDB->execute( "TRUNCATE TABLE {$sHeapTable}" );
600  }
601 
602  return $blDone;
603  }
604 
612  protected function _getCatAdd( $aChosenCat )
613  {
614  $sCatAdd = null;
615  if ( is_array( $aChosenCat ) && count( $aChosenCat ) ) {
616  $oDB = oxDb::getDb();
617  $sCatAdd = " and ( ";
618  $blSep = false;
619  foreach ( $aChosenCat as $sCat ) {
620  if ( $blSep ) {
621  $sCatAdd .= " or ";
622  }
623  $sCatAdd .= "oxobject2category.oxcatnid = ".$oDB->quote( $sCat );
624  $blSep = true;
625  }
626  $sCatAdd .= ")";
627  }
628  return $sCatAdd;
629  }
630 
639  protected function _insertArticles( $sHeapTable, $sCatAdd )
640  {
641  $oDB = oxDb::getDb();
642 
643  $iExpLang = oxConfig::getParameter( "iExportLanguage" );
644  if (!isset($iExpLang)) {
645  $iExpLang = oxSession::getVar( "iExportLanguage" );
646  }
647 
648  $oArticle = oxNew( 'oxarticle' );
649  $oArticle->setLanguage( $iExpLang );
650 
651  $sO2CView = getViewName( 'oxobject2category', $iExpLang );
652  $sArticleTable = getViewName( "oxarticles", $iExpLang );
653 
654  $sSelect = "insert into {$sHeapTable} select {$sArticleTable}.oxid from {$sArticleTable}, {$sO2CView} as oxobject2category where ";
655  $sSelect .= $oArticle->getSqlActiveSnippet();
656 
657  if ( ! oxConfig::getParameter( "blExportVars" ) ) {
658  $sSelect .= " and {$sArticleTable}.oxid = oxobject2category.oxobjectid and {$sArticleTable}.oxparentid = '' ";
659  } else {
660  $sSelect .= " and ( {$sArticleTable}.oxid = oxobject2category.oxobjectid or {$sArticleTable}.oxparentid = oxobject2category.oxobjectid ) ";
661  }
662 
663  $sSearchString = oxConfig::getParameter( "search" );
664  if ( isset( $sSearchString ) ) {
665  $sSelect .= "and ( {$sArticleTable}.OXTITLE like ".$oDB->quote( "%{$sSearchString}%" );
666  $sSelect .= " or {$sArticleTable}.OXSHORTDESC like ".$oDB->quote( "%$sSearchString%" );
667  $sSelect .= " or {$sArticleTable}.oxsearchkeys like ".$oDB->quote( "%$sSearchString%" ) ." ) ";
668  }
669 
670  if ( $sCatAdd ) {
671  $sSelect .= $sCatAdd;
672  }
673 
674  if ( !$sCatAdd ) {
675  $sShopID = $this->getConfig()->getShopId();
676  $sSelect .= " and {$sArticleTable}.oxshopid = '$sShopID' ";
677  }
678 
679  // add minimum stock value
680  if ( $this->getConfig()->getConfigParam( 'blUseStock' ) && ( $dMinStock = oxConfig::getParameter( "sExportMinStock" ) ) ) {
681  $dMinStock = str_replace( array( ";", " ", "/", "'"), "", $dMinStock );
682  $sSelect .= " and {$sArticleTable}.oxstock >= ".$oDB->quote( $dMinStock );
683  }
684 
685  $sSelect .= " group by {$sArticleTable}.oxid";
686 
687  return $oDB->execute( $sSelect ) ? true : false;
688  }
689 
697  protected function _removeParentArticles( $sHeapTable )
698  {
699  if ( !( oxConfig::getParameter( "blExportMainVars" ) ) ) {
700 
701  $oDB = oxDb::getDb();
702  $sArticleTable = getViewName('oxarticles');
703 
704  // we need to remove again parent articles so that we only have the variants itself
705  $sQ = "select $sHeapTable.oxid from $sHeapTable, $sArticleTable where
706  $sHeapTable.oxid = $sArticleTable.oxparentid group by $sHeapTable.oxid";
707 
708  $oRs = $oDB->execute( $sQ );
709  $sDel = "delete from $sHeapTable where oxid in ( ";
710  $blSep = false;
711  if ($oRs != false && $oRs->recordCount() > 0) {
712  while ( !$oRs->EOF ) {
713  if ( $blSep ) {
714  $sDel .= ",";
715  }
716  $sDel .= $oDB->quote( $oRs->fields[0] );
717  $blSep = true;
718  $oRs->moveNext();
719  }
720  }
721  $sDel .= " )";
722  $oDB->execute( $sDel );
723  }
724  }
725 
732  protected function _setSessionParams()
733  {
734  // reset it from session
735  oxSession::deleteVar( "sExportDelCost" );
736  $dDelCost = oxConfig::getParameter( "sExportDelCost");
737  if ( isset( $dDelCost ) ) {
738  $dDelCost = str_replace( array( ";", " ", "/", "'"), "", $dDelCost );
739  $dDelCost = str_replace( ",", ".", $dDelCost );
740  oxSession::setVar( "sExportDelCost", $dDelCost );
741  }
742 
743  oxSession::deleteVar( "sExportMinPrice" );
744  $dMinPrice = oxConfig::getParameter( "sExportMinPrice" );
745  if ( isset( $dMinPrice ) ) {
746  $dMinPrice = str_replace( array( ";", " ", "/", "'"), "", $dMinPrice);
747  $dMinPrice = str_replace( ",", ".", $dMinPrice);
748  oxSession::setVar( "sExportMinPrice", $dMinPrice);
749  }
750 
751  // #827
752  oxSession::deleteVar( "sExportCampaign" );
753  $sCampaign = oxConfig::getParameter( "sExportCampaign" );
754  if ( isset( $sCampaign ) ) {
755  $sCampaign = str_replace( array( ";", " ", "/", "'"), "", $sCampaign );
756  oxSession::setVar( "sExportCampaign", $sCampaign );
757  }
758 
759  // reset it from session
760  oxSession::deleteVar("blAppendCatToCampaign" );
761  // now retrieve it from get or post.
762  $blAppendCatToCampaign = oxConfig::getParameter( "blAppendCatToCampaign" );
763  if ( $blAppendCatToCampaign ) {
764  oxSession::setVar( "blAppendCatToCampaign", $blAppendCatToCampaign );
765  }
766 
767  // reset it from session
768  oxSession::deleteVar("iExportLanguage" );
769  oxSession::setVar( "iExportLanguage", oxConfig::getParameter( "iExportLanguage" ) );
770 
771  //setting the custom header
772  oxSession::setVar("sExportCustomHeader", oxConfig::getParameter( "sExportCustomHeader" ));
773  }
774 
780  protected function _loadRootCats()
781  {
782  if ( $this->_aCatLvlCache === null ) {
783  $this->_aCatLvlCache = array();
784 
785  $sCatView = getViewName('oxcategories');
786  $oDb = oxDb::getDb();
787 
788  // Load all root cat's == all trees
789  $sSQL = "select oxid from $sCatView where oxparentid = 'oxrootid'";
790  $oRs = $oDb->execute( $sSQL);
791  if ( $oRs != false && $oRs->recordCount() > 0 ) {
792  while ( !$oRs->EOF ) {
793  // now load each tree
794  $sSQL = "SELECT s.oxid, s.oxtitle,
795  s.oxparentid, count( * ) AS LEVEL FROM $sCatView v,
796  $sCatView s WHERE s.oxrootid = '".$oRs->fields[0]."' and
797  v.oxrootid='".$oRs->fields[0]."' and s.oxleft BETWEEN
798  v.oxleft AND v.oxright AND s.oxhidden = '0' GROUP BY s.oxleft order by level";
799 
800  $oRs2 = $oDb->Execute( $sSQL );
801  if ( $oRs2 != false && $oRs2->recordCount() > 0 ) {
802  while ( !$oRs2->EOF ) {
803  // store it
804  $oCat = new stdClass();
805  $oCat->_sOXID = $oRs2->fields[0];
806  $oCat->oxtitle = $oRs2->fields[1];
807  $oCat->oxparentid = $oRs2->fields[2];
808  $oCat->ilevel = $oRs2->fields[3];
809  $this->_aCatLvlCache[$oCat->_sOXID] = $oCat;
810 
811  $oRs2->moveNext();
812  }
813  }
814  $oRs->moveNext();
815  }
816  }
817  }
818 
819  return $this->_aCatLvlCache;
820  }
821 
829  protected function _findDeepestCatPath( $oArticle )
830  {
831  $sRet = "";
832 
833  // find deepest
834  $aIds = $oArticle->getCategoryIds();
835  if ( is_array( $aIds ) && count( $aIds ) ) {
836  if ( $aCatLvlCache = $this->_loadRootCats() ) {
837  $sIdMax = null;
838  $dMaxLvl = 0;
839  foreach ( $aIds as $sCatId ) {
840  if ( $dMaxLvl < $aCatLvlCache[$sCatId]->ilevel ) {
841  $dMaxLvl = $aCatLvlCache[$sCatId]->ilevel;
842  $sIdMax = $sCatId;
843  $sRet = $aCatLvlCache[$sCatId]->oxtitle;
844  }
845  }
846 
847  // endless
848  for ( ;; ) {
849  if ( !isset( $aCatLvlCache[$sIdMax]->oxparentid ) || $aCatLvlCache[$sIdMax]->oxparentid == "oxrootid" ) {
850  break;
851  }
852  $sIdMax = $aCatLvlCache[$sIdMax]->oxparentid;
853  $sRet = $aCatLvlCache[$sIdMax]->oxtitle."/".$sRet;
854  }
855  }
856  }
857  return $sRet;
858  }
859 
869  protected function _initArticle( $sHeapTable, $iCnt, & $blContinue )
870  {
871 
872 
873  $oRs = oxDb::getDb()->selectLimit( "select oxid from $sHeapTable", 1, $iCnt );
874  if ( $oRs != false && $oRs->recordCount() > 0 ) {
875  $oArticle = oxNew( 'oxarticle' );
876  $oArticle->setLoadParentData( true );
877 
878  $oArticle->setLanguage( oxSession::getVar( "iExportLanguage" ) );
879 
880  if ( $oArticle->load( $oRs->fields[0] ) ) {
881  // if article exists, do not stop export
882  $blContinue = true;
883  // check price
884  $dMinPrice = oxConfig::getParameter( "sExportMinPrice" );
885  if ( !isset( $dMinPrice ) || ( isset( $dMinPrice ) && ( $oArticle->getPrice()->getBruttoPrice() >= $dMinPrice ) ) ) {
886 
887  //Saulius: variant title added
888  $sTitle = $oArticle->oxarticles__oxvarselect->value ? " " .$oArticle->oxarticles__oxvarselect->value : "";
889  $oArticle->oxarticles__oxtitle->setValue( $oArticle->oxarticles__oxtitle->value . $sTitle );
890 
891 
892  return $oArticle;
893  }
894  }
895  }
896  }
897 
905  protected function _setCampaignDetailLink( $oArticle )
906  {
907  // #827
908  if ( $sCampaign = oxConfig::getParameter( "sExportCampaign" ) ) {
909  // modify detaillink
910  //#1166R - pangora - campaign
911  $oArticle->appendLink( "campaign={$sCampaign}" );
912 
913  if ( oxConfig::getParameter( "blAppendCatToCampaign") &&
914  ( $sCat = $this->getCategoryString( $oArticle ) ) ) {
915  $oArticle->appendLink( "/$sCat" );
916  }
917  }
918  return $oArticle;
919  }
920 
926  public function getViewId()
927  {
928  return 'dyn_interface';
929  }
930 }
931