account_downloads.php

Go to the documentation of this file.
00001 <?php
00002 
00007 class Account_Downloads extends Account
00008 {
00014     protected $_sThisTemplate = 'page/account/downloads.tpl';
00015 
00021     protected $_iViewIndexState = VIEW_INDEXSTATE_NOINDEXNOFOLLOW;
00022 
00026     protected $_oOrderFilesList = null;
00027 
00028 
00029 
00035     public function getBreadCrumb()
00036     {
00037         $aPaths = array();
00038         $aPath  = array();
00039 
00040         $aPath['title'] = oxRegistry::getLang()->translateString( 'MY_ACCOUNT', oxRegistry::getLang()->getBaseLanguage(), false );
00041         $aPath['link']  =  oxRegistry::get("oxSeoEncoder")->getStaticUrl( $this->getViewConfig()->getSelfLink() . "cl=account" );
00042         $aPaths[] = $aPath;
00043 
00044         $aPath['title'] = oxRegistry::getLang()->translateString( 'MY_DOWNLOADS', oxRegistry::getLang()->getBaseLanguage(), false );
00045         $aPath['link']  = $this->getLink();
00046         $aPaths[] = $aPath;
00047 
00048         return $aPaths;
00049     }
00050 
00056     public function getOrderFilesList()
00057     {
00058         if ( $this->_oOrderFilesList !== null ) {
00059             return $this->_oOrderFilesList;
00060         }
00061 
00062         $oOrderFileList = oxNew('oxOrderFileList');
00063         $oOrderFileList->loadUserFiles( $this->getUser()->getId() );
00064 
00065         $this->_oOrderFilesList = $this->_prepareForTemplate( $oOrderFileList );
00066 
00067         return $this->_oOrderFilesList;
00068     }
00069 
00077     protected function _prepareForTemplate( $oOrderFileList )
00078     {
00079         $oOrderArticles = array();
00080 
00081         foreach ( $oOrderFileList as $oOrderFile ) {
00082             $sOrderArticleId = $oOrderFile->oxorderfiles__oxorderarticleid->value;
00083             $oOrderArticles[$sOrderArticleId]['oxordernr'] = $oOrderFile->oxorderfiles__oxordernr->value;
00084             $oOrderArticles[$sOrderArticleId]['oxorderdate'] = substr($oOrderFile->oxorderfiles__oxorderdate->value, 0, 16);
00085             $oOrderArticles[$sOrderArticleId]['oxarticletitle'] = $oOrderFile->oxorderfiles__oxarticletitle->value;
00086             $oOrderArticles[$sOrderArticleId]['oxorderfiles'][] = $oOrderFile;
00087         }
00088 
00089         return $oOrderArticles;
00090     }
00091 
00097     public function getDownloadError()
00098     {
00099         return $this->getConfig()->getParameter( 'download_error' );
00100     }
00101 
00102 }