OXID eShop CE  4.10.8
 All Classes Namespaces 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 
17 {
18 
24  public $sClassDo = "";
25 
31  public $sClassMain = "";
32 
38  public $sExportPath = "export/";
39 
45  public $sExportFileType = "txt";
46 
52  public $sExportFileName = "dynexport";
53 
59  public $fpFile = null;
60 
67  public $iExportPerTick = 30;
68 
74  protected $_iExportPerTick = null;
75 
81  protected $_sFilePath = null;
82 
88  protected $_aExportResultset = array();
89 
95  protected $_sThisTemplate = "dynexportbase.tpl";
96 
102  protected $_aCatLvlCache = null;
103 
109  public function __construct()
110  {
112 
113  // set generic frame template
114  $this->_sFilePath = $this->getConfig()->getConfigParam('sShopDir') . "/" . $this->sExportPath . $this->sExportFileName . "." . $this->sExportFileType;
115  }
116 
123  public function render()
124  {
125  parent::render();
126 
127  // assign all member variables to template
128  $aClassVars = get_object_vars($this);
129  while (list($name, $value) = each($aClassVars)) {
130  $this->_aViewData[$name] = $value;
131  }
132 
133  $this->_aViewData['sOutputFile'] = $this->_sFilePath;
134  $this->_aViewData['sDownloadFile'] = $this->getConfig()->getConfigParam('sShopURL') . $this->sExportPath . $this->sExportFileName . "." . $this->sExportFileType;
135 
136  return $this->_sThisTemplate;
137  }
138 
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 
159  public function start()
160  {
161  // delete file, if its already there
162  $this->fpFile = @fopen($this->_sFilePath, "w");
163  if (!isset($this->fpFile) || !$this->fpFile) {
164  // we do have an error !
165  $this->stop(ERR_FILEIO);
166  } else {
167  $this->_aViewData['refresh'] = 0;
168  $this->_aViewData['iStart'] = 0;
169  fclose($this->fpFile);
170 
171  // prepare it
172  $iEnd = $this->prepareExport();
173  oxRegistry::getSession()->setVariable("iEnd", $iEnd);
174  $this->_aViewData['iEnd'] = $iEnd;
175  }
176  }
177 
183  public function stop($iError = 0)
184  {
185  if ($iError) {
186  $this->_aViewData['iError'] = $iError;
187  }
188 
189  // delete temporary heap table
190  oxDb::getDb()->execute("drop TABLE if exists " . $this->_getHeapTableName());
191  }
192 
200  public function nextTick($iCnt)
201  {
202  return false;
203  }
204 
210  public function write($sLine)
211  {
212  $sLine = $this->removeSID($sLine);
213  $sLine = str_replace(array("\r\n", "\n"), "", $sLine);
214  fwrite($this->fpFile, $sLine . "\r\n");
215  }
216 
220  public function run()
221  {
222  $blContinue = true;
223  $iExportedItems = 0;
224 
225  $this->fpFile = @fopen($this->_sFilePath, "a");
226  if (!isset($this->fpFile) || !$this->fpFile) {
227  // we do have an error !
228  $this->stop(ERR_FILEIO);
229  } else {
230  // file is open
231  $iStart = oxRegistry::getConfig()->getRequestParameter("iStart");
232  // load from session
233  $this->_aExportResultset = oxRegistry::getConfig()->getRequestParameter("aExportResultset");
235  for ($i = $iStart; $i < $iStart + $iExportPerTick; $i++) {
236  if (($iExportedItems = $this->nextTick($i)) === false) {
237  // end reached
238  $this->stop(ERR_SUCCESS);
239  $blContinue = false;
240  break;
241  }
242  }
243  if ($blContinue) {
244  // make ticker continue
245  $this->_aViewData['refresh'] = 0;
246  $this->_aViewData['iStart'] = $i;
247  $this->_aViewData['iExpItems'] = $iExportedItems;
248  }
249  fclose($this->fpFile);
250  }
251  }
252 
258  public function getExportPerTick()
259  {
260  if ($this->_iExportPerTick === null) {
261  $this->_iExportPerTick = (int) oxRegistry::getConfig()->getConfigParam("iExportNrofLines");
262  if (!$this->_iExportPerTick) {
263  $this->_iExportPerTick = $this->iExportPerTick;
264  }
265  }
266 
267  return $this->_iExportPerTick;
268  }
269 
275  public function setExportPerTick($iCount)
276  {
277  $this->_iExportPerTick = $iCount;
278  }
279 
287  public function removeSid($sInput)
288  {
289  $sSid = $this->getSession()->getId();
290 
291  // remove sid from link
292  $sOutput = str_replace("sid={$sSid}/", "", $sInput);
293  $sOutput = str_replace("sid/{$sSid}/", "", $sOutput);
294  $sOutput = str_replace("sid={$sSid}&amp;", "", $sOutput);
295  $sOutput = str_replace("sid={$sSid}&", "", $sOutput);
296  $sOutput = str_replace("sid={$sSid}", "", $sOutput);
297 
298  return $sOutput;
299  }
300 
310  public function shrink($sInput, $iMaxSize, $blRemoveNewline = true)
311  {
312  if ($blRemoveNewline) {
313  $sInput = str_replace("\r\n", " ", $sInput);
314  $sInput = str_replace("\n", " ", $sInput);
315  }
316 
317  $sInput = str_replace("\t", " ", $sInput);
318 
319  // remove html entities, remove html tags
320  $sInput = $this->_unHTMLEntities(strip_tags($sInput));
321 
322  $oStr = getStr();
323  if ($oStr->strlen($sInput) > $iMaxSize - 3) {
324  $sInput = $oStr->substr($sInput, 0, $iMaxSize - 5) . "...";
325  }
326 
327  return $sInput;
328  }
329 
338  public function getCategoryString($oArticle, $sSeparator = "/")
339  {
340  $sCatStr = '';
341 
342  $sLang = oxRegistry::getLang()->getBaseLanguage();
343  $oDB = oxDb::getDb();
344 
345  $sCatView = getViewName('oxcategories', $sLang);
346  $sO2CView = getViewName('oxobject2category', $sLang);
347 
348  //selecting category
349  $sQ = "select $sCatView.oxleft, $sCatView.oxright, $sCatView.oxrootid from $sO2CView as oxobject2category left join $sCatView on $sCatView.oxid = oxobject2category.oxcatnid ";
350  $sQ .= "where oxobject2category.oxobjectid=" . $oDB->quote($oArticle->getId()) . " and $sCatView.oxactive = 1 order by oxobject2category.oxtime ";
351 
352  $oRs = $oDB->execute($sQ);
353  if ($oRs != false && $oRs->recordCount() > 0) {
354  $sLeft = $oRs->fields[0];
355  $sRight = $oRs->fields[1];
356  $sRootId = $oRs->fields[2];
357 
358  //selecting all parent category titles
359  $sQ = "select oxtitle from $sCatView where oxright >= {$sRight} and oxleft <= {$sLeft} and oxrootid = '{$sRootId}' order by oxleft ";
360 
361  $oRs = $oDB->execute($sQ);
362  if ($oRs != false && $oRs->recordCount() > 0) {
363  while (!$oRs->EOF) {
364  if ($sCatStr) {
365  $sCatStr .= $sSeparator;
366  }
367  $sCatStr .= $oRs->fields[0];
368  $oRs->moveNext();
369  }
370  }
371  }
372 
373  return $sCatStr;
374  }
375 
383  public function getDefaultCategoryString($oArticle)
384  {
385  $sLang = oxRegistry::getLang()->getBaseLanguage();
386  $oDB = oxDb::getDb();
387 
388  $sCatView = getViewName('oxcategories', $sLang);
389  $sO2CView = getViewName('oxobject2category', $sLang);
390 
391  //selecting category
392  $sQ = "select $sCatView.oxtitle from $sO2CView as oxobject2category left join $sCatView on $sCatView.oxid = oxobject2category.oxcatnid ";
393  $sQ .= "where oxobject2category.oxobjectid=" . $oDB->quote($oArticle->getId()) . " and $sCatView.oxactive = 1 order by oxobject2category.oxtime ";
394 
395  return $oDB->getOne($sQ);
396  }
397 
405  public function prepareCSV($sInput)
406  {
407  $sInput = oxRegistry::get("oxUtilsString")->prepareCSVField($sInput);
408 
409  return str_replace(array("&nbsp;", "&euro;", "|"), array(" ", "", ""), $sInput);
410  }
411 
419  public function prepareXML($sInput)
420  {
421  $sOutput = str_replace("&", "&amp;", $sInput);
422  $sOutput = str_replace("\"", "&quot;", $sOutput);
423  $sOutput = str_replace(">", "&gt;", $sOutput);
424  $sOutput = str_replace("<", "&lt;", $sOutput);
425  $sOutput = str_replace("'", "&apos;", $sOutput);
426 
427  return $sOutput;
428  }
429 
437  public function getDeepestCategoryPath($oArticle)
438  {
439  return $this->_findDeepestCatPath($oArticle);
440  }
441 
447  public function prepareExport()
448  {
449  $oDB = oxDb::getDb();
450  $sHeapTable = $this->_getHeapTableName();
451 
452  // #1070 Saulius 2005.11.28
453  // check mySQL version
454  $oRs = $oDB->execute("SHOW VARIABLES LIKE 'version'");
455  $sTableCharset = $this->_generateTableCharSet($oRs->fields[1]);
456 
457  // create heap table
458  if (!($this->_createHeapTable($sHeapTable, $sTableCharset))) {
459  // error
460  oxRegistry::getUtils()->showMessageAndExit("Could not create HEAP Table {$sHeapTable}\n<br>");
461  }
462 
463  $sCatAdd = $this->_getCatAdd(oxRegistry::getConfig()->getRequestParameter("acat"));
464  if (!$this->_insertArticles($sHeapTable, $sCatAdd)) {
465  oxRegistry::getUtils()->showMessageAndExit("Could not insert Articles in Table {$sHeapTable}\n<br>");
466  }
467 
468  $this->_removeParentArticles($sHeapTable);
469  $this->_setSessionParams();
470 
471  // get total cnt
472  return $oDB->getOne("select count(*) from {$sHeapTable}");
473  }
474 
483  public function getOneArticle($iCnt, & $blContinue)
484  {
485  $myConfig = $this->getConfig();
486 
487  //[Alfonsas 2006-05-31] setting specific parameter
488  //to be checked in oxarticle.php init() method
489  $myConfig->setConfigParam('blExport', true);
490  $blContinue = false;
491 
492  if (($oArticle = $this->_initArticle($this->_getHeapTableName(), $iCnt, $blContinue))) {
493  $blContinue = true;
494  $oArticle = $this->_setCampaignDetailLink($oArticle);
495  }
496 
497  //[Alfonsas 2006-05-31] unsetting specific parameter
498  //to be checked in oxarticle.php init() method
499  $myConfig->setConfigParam('blExport', false);
500 
501  return $oArticle;
502  }
503 
512  public function assureContent($sInput, $sReplace = null)
513  {
514  $oStr = getStr();
515  if (!$oStr->strlen($sInput)) {
516  if (!isset($sReplace) || !$oStr->strlen($sReplace)) {
517  $sReplace = "-";
518  }
519  $sInput = $sReplace;
520  }
521 
522  return $sInput;
523  }
524 
533  protected function _unHtmlEntities($sInput)
534  {
535  $aTransTbl = array_flip(get_html_translation_table(HTML_ENTITIES));
536 
537  return strtr($sInput, $aTransTbl);
538  }
539 
545  protected function _getHeapTableName()
546  {
547  // table name must not start with any digit
548  return "tmp_" . str_replace("0", "", md5($this->getSession()->getId()));
549  }
550 
558  protected function _generateTableCharSet($sMysqlVersion)
559  {
560  $sTableCharset = "";
561 
562  //if MySQL >= 4.1.0 set charsets and collations
563  if (version_compare($sMysqlVersion, '4.1.0', '>=') > 0) {
564  $oDB = oxDb::getDb(oxDB::FETCH_MODE_ASSOC);
565  $oRs = $oDB->execute("SHOW FULL COLUMNS FROM `oxarticles` WHERE field like 'OXID'");
566  if (isset($oRs->fields['Collation']) && ($sMysqlCollation = $oRs->fields['Collation'])) {
567  $oRs = $oDB->execute("SHOW COLLATION LIKE '{$sMysqlCollation}'");
568  if (isset($oRs->fields['Charset']) && ($sMysqlCharacterSet = $oRs->fields['Charset'])) {
569  $sTableCharset = "DEFAULT CHARACTER SET {$sMysqlCharacterSet} COLLATE {$sMysqlCollation}";
570  }
571  }
572 
573  }
574 
575  return $sTableCharset;
576  }
577 
586  protected function _createHeapTable($sHeapTable, $sTableCharset)
587  {
588  $blDone = false;
589 
590  $oDB = oxDb::getDb();
591  $sQ = "CREATE TABLE IF NOT EXISTS {$sHeapTable} ( `oxid` CHAR(32) NOT NULL default '' ) ENGINE=InnoDB {$sTableCharset}";
592  if (($oDB->execute($sQ)) !== false) {
593  $blDone = true;
594  $oDB->execute("TRUNCATE TABLE {$sHeapTable}");
595  }
596 
597  return $blDone;
598  }
599 
607  protected function _getCatAdd($aChosenCat)
608  {
609  $sCatAdd = null;
610  if (is_array($aChosenCat) && count($aChosenCat)) {
611  $oDB = oxDb::getDb();
612  $sCatAdd = " and ( ";
613  $blSep = false;
614  foreach ($aChosenCat as $sCat) {
615  if ($blSep) {
616  $sCatAdd .= " or ";
617  }
618  $sCatAdd .= "oxobject2category.oxcatnid = " . $oDB->quote($sCat);
619  $blSep = true;
620  }
621  $sCatAdd .= ")";
622  }
623 
624  return $sCatAdd;
625  }
626 
635  protected function _insertArticles($sHeapTable, $sCatAdd)
636  {
637  $oDB = oxDb::getDb();
638 
639  $iExpLang = oxRegistry::getConfig()->getRequestParameter("iExportLanguage");
640  if (!isset($iExpLang)) {
641  $iExpLang = oxRegistry::getSession()->getVariable("iExportLanguage");
642  }
643 
644  $oArticle = oxNew('oxarticle');
645  $oArticle->setLanguage($iExpLang);
646 
647  $sO2CView = getViewName('oxobject2category', $iExpLang);
648  $sArticleTable = getViewName("oxarticles", $iExpLang);
649 
650  $sSelect = "insert into {$sHeapTable} select {$sArticleTable}.oxid from {$sArticleTable}, {$sO2CView} as oxobject2category where ";
651  $sSelect .= $oArticle->getSqlActiveSnippet();
652 
653  if (!oxRegistry::getConfig()->getRequestParameter("blExportVars")) {
654  $sSelect .= " and {$sArticleTable}.oxid = oxobject2category.oxobjectid and {$sArticleTable}.oxparentid = '' ";
655  } else {
656  $sSelect .= " and ( {$sArticleTable}.oxid = oxobject2category.oxobjectid or {$sArticleTable}.oxparentid = oxobject2category.oxobjectid ) ";
657  }
658 
659  $sSearchString = oxRegistry::getConfig()->getRequestParameter("search");
660  if (isset($sSearchString)) {
661  $sSelect .= "and ( {$sArticleTable}.OXTITLE like " . $oDB->quote("%{$sSearchString}%");
662  $sSelect .= " or {$sArticleTable}.OXSHORTDESC like " . $oDB->quote("%$sSearchString%");
663  $sSelect .= " or {$sArticleTable}.oxsearchkeys like " . $oDB->quote("%$sSearchString%") . " ) ";
664  }
665 
666  if ($sCatAdd) {
667  $sSelect .= $sCatAdd;
668  }
669 
670  if (!$sCatAdd) {
671  $sShopID = $this->getConfig()->getShopId();
672  $sSelect .= " and {$sArticleTable}.oxshopid = '$sShopID' ";
673  }
674 
675  // add minimum stock value
676  if ($this->getConfig()->getConfigParam('blUseStock') && ($dMinStock = oxRegistry::getConfig()->getRequestParameter("sExportMinStock"))) {
677  $dMinStock = str_replace(array(";", " ", "/", "'"), "", $dMinStock);
678  $sSelect .= " and {$sArticleTable}.oxstock >= " . $oDB->quote($dMinStock);
679  }
680 
681  $sSelect .= " group by {$sArticleTable}.oxid";
682 
683  return $oDB->execute($sSelect) ? true : false;
684  }
685 
691  protected function _removeParentArticles($sHeapTable)
692  {
693  if (!(oxRegistry::getConfig()->getRequestParameter("blExportMainVars"))) {
694 
695  $oDB = oxDb::getDb();
696  $sArticleTable = getViewName('oxarticles');
697 
698  // we need to remove again parent articles so that we only have the variants itself
699  $sQ = "select $sHeapTable.oxid from $sHeapTable, $sArticleTable where
700  $sHeapTable.oxid = $sArticleTable.oxparentid group by $sHeapTable.oxid";
701 
702  $oRs = $oDB->execute($sQ);
703  $sDel = "delete from $sHeapTable where oxid in ( ";
704  $blSep = false;
705  if ($oRs != false && $oRs->recordCount() > 0) {
706  while (!$oRs->EOF) {
707  if ($blSep) {
708  $sDel .= ",";
709  }
710  $sDel .= $oDB->quote($oRs->fields[0]);
711  $blSep = true;
712  $oRs->moveNext();
713  }
714  }
715  $sDel .= " )";
716  $oDB->execute($sDel);
717  }
718  }
719 
723  protected function _setSessionParams()
724  {
725  // reset it from session
726  oxRegistry::getSession()->deleteVariable("sExportDelCost");
727  $dDelCost = oxRegistry::getConfig()->getRequestParameter("sExportDelCost");
728  if (isset($dDelCost)) {
729  $dDelCost = str_replace(array(";", " ", "/", "'"), "", $dDelCost);
730  $dDelCost = str_replace(",", ".", $dDelCost);
731  oxRegistry::getSession()->setVariable("sExportDelCost", $dDelCost);
732  }
733 
734  oxRegistry::getSession()->deleteVariable("sExportMinPrice");
735  $dMinPrice = oxRegistry::getConfig()->getRequestParameter("sExportMinPrice");
736  if (isset($dMinPrice)) {
737  $dMinPrice = str_replace(array(";", " ", "/", "'"), "", $dMinPrice);
738  $dMinPrice = str_replace(",", ".", $dMinPrice);
739  oxRegistry::getSession()->setVariable("sExportMinPrice", $dMinPrice);
740  }
741 
742  // #827
743  oxRegistry::getSession()->deleteVariable("sExportCampaign");
744  $sCampaign = oxRegistry::getConfig()->getRequestParameter("sExportCampaign");
745  if (isset($sCampaign)) {
746  $sCampaign = str_replace(array(";", " ", "/", "'"), "", $sCampaign);
747  oxRegistry::getSession()->setVariable("sExportCampaign", $sCampaign);
748  }
749 
750  // reset it from session
751  oxRegistry::getSession()->deleteVariable("blAppendCatToCampaign");
752  // now retrieve it from get or post.
753  $blAppendCatToCampaign = oxRegistry::getConfig()->getRequestParameter("blAppendCatToCampaign");
754  if ($blAppendCatToCampaign) {
755  oxRegistry::getSession()->setVariable("blAppendCatToCampaign", $blAppendCatToCampaign);
756  }
757 
758  // reset it from session
759  oxRegistry::getSession()->deleteVariable("iExportLanguage");
760  oxRegistry::getSession()->setVariable("iExportLanguage", oxRegistry::getConfig()->getRequestParameter("iExportLanguage"));
761 
762  //setting the custom header
763  oxRegistry::getSession()->setVariable("sExportCustomHeader", oxRegistry::getConfig()->getRequestParameter("sExportCustomHeader"));
764  }
765 
771  protected function _loadRootCats()
772  {
773  if ($this->_aCatLvlCache === null) {
774  $this->_aCatLvlCache = array();
775 
776  $sCatView = getViewName('oxcategories');
777  $oDb = oxDb::getDb();
778 
779  // Load all root cat's == all trees
780  $sSQL = "select oxid from $sCatView where oxparentid = 'oxrootid'";
781  $oRs = $oDb->execute($sSQL);
782  if ($oRs != false && $oRs->recordCount() > 0) {
783  while (!$oRs->EOF) {
784  // now load each tree
785  $sSQL = "SELECT s.oxid, s.oxtitle,
786  s.oxparentid, count( * ) AS LEVEL FROM $sCatView v,
787  $sCatView s WHERE s.oxrootid = '" . $oRs->fields[0] . "' and
788  v.oxrootid='" . $oRs->fields[0] . "' and s.oxleft BETWEEN
789  v.oxleft AND v.oxright AND s.oxhidden = '0' GROUP BY s.oxleft order by level";
790 
791  $oRs2 = $oDb->Execute($sSQL);
792  if ($oRs2 != false && $oRs2->recordCount() > 0) {
793  while (!$oRs2->EOF) {
794  // store it
795  $oCat = new stdClass();
796  $oCat->_sOXID = $oRs2->fields[0];
797  $oCat->oxtitle = $oRs2->fields[1];
798  $oCat->oxparentid = $oRs2->fields[2];
799  $oCat->ilevel = $oRs2->fields[3];
800  $this->_aCatLvlCache[$oCat->_sOXID] = $oCat;
801 
802  $oRs2->moveNext();
803  }
804  }
805  $oRs->moveNext();
806  }
807  }
808  }
809 
810  return $this->_aCatLvlCache;
811  }
812 
820  protected function _findDeepestCatPath($oArticle)
821  {
822  $sRet = "";
823 
824  // find deepest
825  $aIds = $oArticle->getCategoryIds();
826  if (is_array($aIds) && count($aIds)) {
827  if ($aCatLvlCache = $this->_loadRootCats()) {
828  $sIdMax = null;
829  $dMaxLvl = 0;
830  foreach ($aIds as $sCatId) {
831  if ($dMaxLvl < $aCatLvlCache[$sCatId]->ilevel) {
832  $dMaxLvl = $aCatLvlCache[$sCatId]->ilevel;
833  $sIdMax = $sCatId;
834  $sRet = $aCatLvlCache[$sCatId]->oxtitle;
835  }
836  }
837 
838  // endless
839  while (true) {
840  if (!isset($aCatLvlCache[$sIdMax]->oxparentid) || $aCatLvlCache[$sIdMax]->oxparentid == "oxrootid") {
841  break;
842  }
843  $sIdMax = $aCatLvlCache[$sIdMax]->oxparentid;
844  $sRet = $aCatLvlCache[$sIdMax]->oxtitle . "/" . $sRet;
845  }
846  }
847  }
848 
849  return $sRet;
850  }
851 
861  protected function _initArticle($sHeapTable, $iCnt, & $blContinue)
862  {
863 
864 
865  $oRs = oxDb::getDb()->selectLimit("select oxid from $sHeapTable", 1, $iCnt);
866  if ($oRs != false && $oRs->recordCount() > 0) {
867  $oArticle = oxNew('oxarticle');
868  $oArticle->setLoadParentData(true);
869 
870  $oArticle->setLanguage(oxRegistry::getSession()->getVariable("iExportLanguage"));
871 
872  if ($oArticle->load($oRs->fields[0])) {
873  // if article exists, do not stop export
874  $blContinue = true;
875  // check price
876  $dMinPrice = oxRegistry::getConfig()->getRequestParameter("sExportMinPrice");
877  if (!isset($dMinPrice) || (isset($dMinPrice) && ($oArticle->getPrice()->getBruttoPrice() >= $dMinPrice))) {
878 
879  //Saulius: variant title added
880  $sTitle = $oArticle->oxarticles__oxvarselect->value ? " " . $oArticle->oxarticles__oxvarselect->value : "";
881  $oArticle->oxarticles__oxtitle->setValue($oArticle->oxarticles__oxtitle->value . $sTitle);
882 
883 
884  return $oArticle;
885  }
886  }
887  }
888  }
889 
897  protected function _setCampaignDetailLink($oArticle)
898  {
899  // #827
900  if ($sCampaign = oxRegistry::getConfig()->getRequestParameter("sExportCampaign")) {
901  // modify detaillink
902  //#1166R - pangora - campaign
903  $oArticle->appendLink("campaign={$sCampaign}");
904 
905  if (oxRegistry::getConfig()->getRequestParameter("blAppendCatToCampaign") &&
906  ($sCat = $this->getCategoryString($oArticle))
907  ) {
908  $oArticle->appendLink("/$sCat");
909  }
910  }
911 
912  return $oArticle;
913  }
914 
920  public function getViewId()
921  {
922  return 'dyn_interface';
923  }
924 }