OXID eShop CE  4.8.12
 All Classes Files Functions Variables Pages
account_downloads.php
Go to the documentation of this file.
1 <?php
2 
8 {
14  protected $_sThisTemplate = 'page/account/downloads.tpl';
15 
22 
26  protected $_oOrderFilesList = null;
27 
28 
29 
35  public function getBreadCrumb()
36  {
37  $aPaths = array();
38  $aPath = array();
39 
40  $aPath['title'] = oxRegistry::getLang()->translateString( 'MY_ACCOUNT', oxRegistry::getLang()->getBaseLanguage(), false );
41  $aPath['link'] = oxRegistry::get("oxSeoEncoder")->getStaticUrl( $this->getViewConfig()->getSelfLink() . "cl=account" );
42  $aPaths[] = $aPath;
43 
44  $aPath['title'] = oxRegistry::getLang()->translateString( 'MY_DOWNLOADS', oxRegistry::getLang()->getBaseLanguage(), false );
45  $aPath['link'] = $this->getLink();
46  $aPaths[] = $aPath;
47 
48  return $aPaths;
49  }
50 
56  public function getOrderFilesList()
57  {
58  if ( $this->_oOrderFilesList !== null ) {
60  }
61 
62  $oOrderFileList = oxNew('oxOrderFileList');
63  $oOrderFileList->loadUserFiles( $this->getUser()->getId() );
64 
65  $this->_oOrderFilesList = $this->_prepareForTemplate( $oOrderFileList );
66 
68  }
69 
77  protected function _prepareForTemplate( $oOrderFileList )
78  {
79  $oOrderArticles = array();
80 
81  foreach ( $oOrderFileList as $oOrderFile ) {
82  $sOrderArticleId = $oOrderFile->oxorderfiles__oxorderarticleid->value;
83  $oOrderArticles[$sOrderArticleId]['oxordernr'] = $oOrderFile->oxorderfiles__oxordernr->value;
84  $oOrderArticles[$sOrderArticleId]['oxorderdate'] = substr($oOrderFile->oxorderfiles__oxorderdate->value, 0, 16);
85  $oOrderArticles[$sOrderArticleId]['oxarticletitle'] = $oOrderFile->oxorderfiles__oxarticletitle->value;
86  $oOrderArticles[$sOrderArticleId]['oxorderfiles'][] = $oOrderFile;
87  }
88 
89  return $oOrderArticles;
90  }
91 
97  public function getDownloadError()
98  {
99  return $this->getConfig()->getParameter( 'download_error' );
100  }
101 
102 }