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 
00051     protected $_aSimilarRecommListIds = null;
00052 
00063     public function render()
00064     {
00065         parent::render();
00066 
00067         // is logged in ?
00068         $oUser = $this->getUser();
00069         if ( !$oUser ) {
00070             return $this->_sThisTemplate = $this->_sThisLoginTemplate;
00071         }
00072 
00073         return $this->_sThisTemplate;
00074     }
00075 
00084     public function getNavigationParams()
00085     {
00086         $aParams = parent::getNavigationParams();
00087 
00088 
00089         return $aParams;
00090     }
00091 
00097     public function getNoticeProductList()
00098     {
00099         if ( $this->_aNoticeProductList === null ) {
00100             if ( $oUser = $this->getUser() ) {
00101                 $this->_aNoticeProductList = $oUser->getBasket( 'noticelist' )->getArticles();
00102             }
00103         }
00104         return $this->_aNoticeProductList;
00105     }
00106 
00112     public function getSimilarProducts()
00113     {
00114         // similar products list
00115         if ( $this->_aSimilarProductList === null && count( $this->getNoticeProductList() ) ) {
00116 
00117             // just ensuring that next call will skip this check
00118             $this->_aSimilarProductList = false;
00119 
00120             // loading similar products
00121             if ( $oSimilarProd = current( $this->getNoticeProductList() ) ) {
00122                 $this->_aSimilarProductList = $oSimilarProd->getSimilarProducts();
00123             }
00124         }
00125 
00126         return $this->_aSimilarProductList;
00127     }
00128 
00134     public function getSimilarRecommListIds()
00135     {
00136         if ( $this->_aSimilarRecommListIds === null ) {
00137             $this->_aSimilarRecommListIds = false;
00138 
00139             $aNoticeProdList = $this->getNoticeProductList();
00140             if ( is_array( $aNoticeProdList ) && count( $aNoticeProdList ) ) {
00141                 $this->_aSimilarRecommListIds = array_keys( $aNoticeProdList );
00142             }
00143         }
00144         return $this->_aSimilarRecommListIds;
00145     }
00146 
00152     public function getBreadCrumb()
00153     {
00154         $aPaths = array();
00155         $aPath  = array();
00156 
00157         $aPath['title'] = oxRegistry::getLang()->translateString( 'MY_ACCOUNT', oxRegistry::getLang()->getBaseLanguage(), false );
00158         $aPath['link']  =  oxRegistry::get("oxSeoEncoder")->getStaticUrl( $this->getViewConfig()->getSelfLink() . "cl=account" );
00159         $aPaths[] = $aPath;
00160 
00161         $aPath['title'] = oxRegistry::getLang()->translateString( 'MY_WISH_LIST', oxRegistry::getLang()->getBaseLanguage(), false );
00162         $aPath['link']  = $this->getLink();
00163         $aPaths[] = $aPath;
00164 
00165         return $aPaths;
00166     }
00167 }