OXID eShop CE  4.10.2
 All Classes Namespaces Files Functions Variables Pages
account_downloads.php
Go to the documentation of this file.
1 <?php
2 
8 {
9 
15  protected $_sThisTemplate = 'page/account/downloads.tpl';
16 
23 
27  protected $_oOrderFilesList = null;
28 
29 
35  public function getBreadCrumb()
36  {
37  $aPaths = array();
38  $aPath = array();
39 
40  $iBaseLanguage = oxRegistry::getLang()->getBaseLanguage();
42  $oSeoEncoder = oxRegistry::get("oxSeoEncoder");
43  $aPath['title'] = oxRegistry::getLang()->translateString('MY_ACCOUNT', $iBaseLanguage, false);
44  $aPath['link'] = $oSeoEncoder->getStaticUrl($this->getViewConfig()->getSelfLink() . "cl=account");
45  $aPaths[] = $aPath;
46 
47  $aPath['title'] = oxRegistry::getLang()->translateString('MY_DOWNLOADS', $iBaseLanguage, false);
48  $aPath['link'] = $this->getLink();
49  $aPaths[] = $aPath;
50 
51  return $aPaths;
52  }
53 
59  public function getOrderFilesList()
60  {
61  if ($this->_oOrderFilesList !== null) {
63  }
64 
65  $oOrderFileList = oxNew('oxOrderFileList');
66  $oOrderFileList->loadUserFiles($this->getUser()->getId());
67 
68  $this->_oOrderFilesList = $this->_prepareForTemplate($oOrderFileList);
69 
71  }
72 
80  protected function _prepareForTemplate($oOrderFileList)
81  {
82  $oOrderArticles = array();
83 
84  foreach ($oOrderFileList as $oOrderFile) {
85  $sOrderArticleIdField = 'oxorderfiles__oxorderarticleid';
86  $sOrderNumberField = 'oxorderfiles__oxordernr';
87  $sOrderDateField = 'oxorderfiles__oxorderdate';
88  $sOrderTitleField = 'oxorderfiles__oxarticletitle';
89  $sOrderArticleId = $oOrderFile->$sOrderArticleIdField->value;
90  $oOrderArticles[$sOrderArticleId]['oxordernr'] = $oOrderFile->$sOrderNumberField->value;
91  $oOrderArticles[$sOrderArticleId]['oxorderdate'] = substr($oOrderFile->$sOrderDateField->value, 0, 16);
92  $oOrderArticles[$sOrderArticleId]['oxarticletitle'] = $oOrderFile->$sOrderTitleField->value;
93  $oOrderArticles[$sOrderArticleId]['oxorderfiles'][] = $oOrderFile;
94  }
95 
96  return $oOrderArticles;
97  }
98 
104  public function getDownloadError()
105  {
106  return $this->getConfig()->getRequestParameter('download_error');
107  }
108 }