wishlist.php

Go to the documentation of this file.
00001 <?php
00002 
00006 class Wishlist extends oxUBase
00007 {
00008 
00013     protected $_sThisTemplate = 'wishlist.tpl';
00014 
00020     protected $_oWishUser = null;
00021 
00027     protected $_oWishList = null;
00028 
00034     protected $_sSearchParam = null;
00035 
00041     protected $_oWishListUsers = false;
00042 
00047     protected $_blTop5Action = true;
00048 
00053     protected $_blBargainAction = true;
00054 
00068     public function render()
00069     {
00070         parent::render();
00071 
00072         // loading actions
00073         $this->_loadActions();
00074 
00075         //for older templates
00076         $this->_aViewData['wishuser'] = $this->getWishUser();
00077         $this->_aViewData['wishlist'] = $this->getWishList();
00078 
00079         $this->_aViewData['wish_result'] = $this->getWishListUsers();
00080         $this->_aViewData['search']      = $this->getWishListSearchParam();
00081         return $this->_sThisTemplate;
00082     }
00083 
00084 
00090     public function getWishUser()
00091     {
00092 
00093         if ( $this->_oWishUser === null) {
00094             $this->_oWishUser = false;
00095 
00096             if ( $sUserID = oxConfig::getParameter( 'wishid' ) ) {
00097                 $oUser = oxNew( 'oxuser' );
00098                 if ( $oUser->load( $sUserID ) ) {
00099 
00100                     // passing wishlist information
00101                     $this->_oWishUser = $oUser;
00102 
00103                     // store this one to session
00104                     oxSession::setVar( 'wishid', $sUserID );
00105                 }
00106             }
00107         }
00108         return $this->_oWishUser;
00109     }
00110 
00116     public function getWishList()
00117     {
00118         if ( $this->_oWishList === null) {
00119             $this->_oWishList = false;
00120 
00121             // passing wishlist information
00122             if ( $oUser = $this->getWishUser() ) {
00123                 $this->_oWishList = $oUser->getBasket( 'wishlist' )->getArticles();
00124             }
00125         }
00126         return $this->_oWishList;
00127     }
00128 
00138     public function searchForWishList()
00139     {
00140         if ( $sSearch = oxConfig::getParameter( 'search' ) ) {
00141 
00142             // search for baskets
00143             $oUserList = oxNew( 'oxuserlist' );
00144             $oUserList->loadWishlistUsers( $sSearch );
00145             if ( $oUserList->count() ) {
00146                 $this->_oWishListUsers = $oUserList;
00147             }
00148             $this->_sSearchParam = $sSearch;
00149         }
00150     }
00151 
00158     public function getWishListUsers()
00159     {
00160         return $this->_oWishListUsers;
00161     }
00162 
00168     public function getWishListSearchParam()
00169     {
00170         return $this->_sSearchParam;
00171     }
00172 }

Generated on Tue Apr 21 15:45:45 2009 for OXID eShop CE by  doxygen 1.5.5