account_noticelist.php

Go to the documentation of this file.
00001 <?php
00002 
00010 class Account_Noticelist extends Account
00011 {
00016     protected $_sThisTemplate = 'page/account/noticelist.tpl';
00017 
00023     protected $_aNoticeProductList = null;
00024 
00030     protected $_aSimilarProductList = null;
00031 
00037     protected $_aRecommList = null;
00038 
00044     protected $_iViewIndexState = VIEW_INDEXSTATE_NOINDEXNOFOLLOW;
00045 
00056     public function render()
00057     {
00058         parent::render();
00059 
00060         // is logged in ?
00061         $oUser = $this->getUser();
00062         if ( !$oUser ) {
00063             return $this->_sThisTemplate = $this->_sThisLoginTemplate;
00064         }
00065 
00066         return $this->_sThisTemplate;
00067     }
00068 
00074     public function getNoticeProductList()
00075     {
00076         if ( $this->_aNoticeProductList === null ) {
00077             if ( $oUser = $this->getUser() ) {
00078                 $this->_aNoticeProductList = $oUser->getBasket( 'noticelist' )->getArticles();
00079             }
00080         }
00081         return $this->_aNoticeProductList;
00082     }
00083 
00089     public function getSimilarProducts()
00090     {
00091         // similar products list
00092         if ( $this->_aSimilarProductList === null && count( $this->getNoticeProductList() ) ) {
00093 
00094             // just ensuring that next call will skip this check
00095             $this->_aSimilarProductList = false;
00096 
00097             // loading similar products
00098             if ( $oSimilarProd = current( $this->getNoticeProductList() ) ) {
00099                 $this->_aSimilarProductList = $oSimilarProd->getSimilarProducts();
00100             }
00101         }
00102 
00103         return $this->_aSimilarProductList;
00104     }
00105 
00111     public function getSimilarRecommLists()
00112     {
00113         if ( $this->getViewConfig()->getShowListmania() ) {
00114             // recommlist
00115             if ( $this->_aRecommList === null ) {
00116 
00117                 // just ensuring that next call will skip this check
00118                 $this->_aRecommList = false;
00119 
00120                 // loading recomm list
00121                 $aNoticeProdList = $this->getNoticeProductList();
00122                 if ( is_array( $aNoticeProdList ) && count( $aNoticeProdList ) ) {
00123                     $oRecommList = oxNew('oxrecommlist');
00124                     $this->_aRecommList = $oRecommList->getRecommListsByIds( array_keys( $aNoticeProdList ));
00125 
00126                 }
00127             }
00128             return $this->_aRecommList;
00129         }
00130     }
00131 
00137     public function getBreadCrumb()
00138     {
00139         $aPaths = array();
00140         $aPath  = array();
00141         
00142         $aPath['title'] = oxLang::getInstance()->translateString( 'PAGE_ACCOUNT_MY_ACCOUNT', oxLang::getInstance()->getBaseLanguage(), false );
00143         $aPath['link']  =  oxSeoEncoder::getInstance()->getStaticUrl( $this->getViewConfig()->getSelfLink() . "cl=account" );
00144         $aPaths[] = $aPath;
00145 
00146         $aPath['title'] = oxLang::getInstance()->translateString( 'PAGE_ACCOUNT_NOTICELIST_MYWISHLIST', oxLang::getInstance()->getBaseLanguage(), false );
00147         $aPath['link']  = $this->getLink();
00148         $aPaths[] = $aPath;
00149 
00150         return $aPaths;
00151     }
00152 }