account_noticelist.php

Go to the documentation of this file.
00001 <?php
00002 
00010 class Account_Noticelist extends Account
00011 {
00012 
00018     protected $_sThisTemplate = 'page/account/noticelist.tpl';
00019 
00025     protected $_aNoticeProductList = null;
00026 
00032     protected $_aSimilarProductList = null;
00033 
00039     protected $_aRecommList = null;
00040 
00046     protected $_iViewIndexState = VIEW_INDEXSTATE_NOINDEXNOFOLLOW;
00047 
00053     protected $_aSimilarRecommListIds = null;
00054 
00065     public function render()
00066     {
00067         parent::render();
00068 
00069         // is logged in ?
00070         $oUser = $this->getUser();
00071         if (!$oUser) {
00072             return $this->_sThisTemplate = $this->_sThisLoginTemplate;
00073         }
00074 
00075         return $this->_sThisTemplate;
00076     }
00077 
00086     public function getNavigationParams()
00087     {
00088         $aParams = parent::getNavigationParams();
00089 
00090 
00091         return $aParams;
00092     }
00093 
00099     public function getNoticeProductList()
00100     {
00101         if ($this->_aNoticeProductList === null) {
00102             if ($oUser = $this->getUser()) {
00103                 $this->_aNoticeProductList = $oUser->getBasket('noticelist')->getArticles();
00104             }
00105         }
00106 
00107         return $this->_aNoticeProductList;
00108     }
00109 
00115     public function getSimilarProducts()
00116     {
00117         // similar products list
00118         if ($this->_aSimilarProductList === null && count($this->getNoticeProductList())) {
00119 
00120             // just ensuring that next call will skip this check
00121             $this->_aSimilarProductList = false;
00122 
00123             // loading similar products
00124             if ($oSimilarProd = current($this->getNoticeProductList())) {
00125                 $this->_aSimilarProductList = $oSimilarProd->getSimilarProducts();
00126             }
00127         }
00128 
00129         return $this->_aSimilarProductList;
00130     }
00131 
00137     public function getSimilarRecommListIds()
00138     {
00139         if ($this->_aSimilarRecommListIds === null) {
00140             $this->_aSimilarRecommListIds = false;
00141 
00142             $aNoticeProdList = $this->getNoticeProductList();
00143             if (is_array($aNoticeProdList) && count($aNoticeProdList)) {
00144                 $this->_aSimilarRecommListIds = array_keys($aNoticeProdList);
00145             }
00146         }
00147 
00148         return $this->_aSimilarRecommListIds;
00149     }
00150 
00156     public function getBreadCrumb()
00157     {
00158         $aPaths = array();
00159         $aPath = array();
00160 
00161         $oLang = oxRegistry::getLang();
00162         $sSelfLink = $this->getViewConfig()->getSelfLink();
00163 
00164         $iBaseLanguage = $oLang->getBaseLanguage();
00165         $aPath['title'] = $oLang->translateString('MY_ACCOUNT', $iBaseLanguage, false);
00166         $aPath['link'] = oxRegistry::get("oxSeoEncoder")->getStaticUrl($sSelfLink . "cl=account");
00167         $aPaths[] = $aPath;
00168 
00169         $aPath['title'] = $oLang->translateString('MY_WISH_LIST', $iBaseLanguage, false);
00170         $aPath['link'] = $this->getLink();
00171         $aPaths[] = $aPath;
00172 
00173         return $aPaths;
00174     }
00175 }