register.php

Go to the documentation of this file.
00001 <?php
00002 
00007 class Register extends User
00008 {
00014     protected $_sThisTemplate = 'register.tpl';
00015 
00020     protected $_blIsOrderStep = false;
00021 
00027     protected $_sSuccessTemplate = 'register_success.tpl';
00028 
00034     protected $_aMustFillFields = null;
00035 
00041     protected $_iViewIndexState = VIEW_INDEXSTATE_NOINDEXNOFOLLOW;
00042 
00049     public function render()
00050     {
00051         parent::render();
00052 
00053         // checking registration status
00054         if ( $this->getRegistrationStatus() ) {
00055 
00056             //for older templates
00057             $this->_aViewData['error']   = $this->getRegistrationError();
00058             $this->_aViewData['success'] = $this->getRegistrationStatus();
00059 
00060             return $this->_sSuccessTemplate;
00061         }
00062 
00063         $this->_aViewData['aMustFillFields'] = $this->getMustFillFields();
00064 
00065         return $this->_sThisTemplate;
00066     }
00067 
00073     public function getRegistrationError()
00074     {
00075         return oxConfig::getParameter( 'newslettererror' );
00076     }
00077 
00083     public function getRegistrationStatus()
00084     {
00085         return oxConfig::getParameter( 'success' );
00086     }
00087 
00093     public function getMustFillFields()
00094     {
00095         if ( $this->_aMustFillFields === null ) {
00096             $this->_aMustFillFields = false;
00097 
00098             // passing must-be-filled-fields info
00099             $aMustFillFields = $this->getConfig()->getConfigParam( 'aMustFillFields' );
00100             if ( is_array( $aMustFillFields ) ) {
00101                 $this->_aMustFillFields = array_flip( $aMustFillFields );
00102             }
00103         }
00104         return $this->_aMustFillFields;
00105     }
00106 
00112     public function getDelAddress()
00113     {
00114         // is logged in ?
00115         if ( $this->_oDelAddress === null ) {
00116             $this->_oDelAddress = false;
00117 
00118             if ( $oUser = $this->getUser() ) {
00119                 $sAddressId = $oUser->getSelectedAddress();
00120                 if ( $sAddressId && $sAddressId != '-1' ) {
00121                     $this->_oDelAddress = oxNew( 'oxaddress' );
00122                     $this->_oDelAddress->load( $sAddressId );
00123                 }
00124             }
00125         }
00126 
00127         return $this->_oDelAddress;
00128     }
00129 
00137     protected function _addFakeAddress( $oAddresses )
00138     {
00139     }
00140 
00141 }

Generated on Tue Sep 29 16:45:16 2009 for OXID eShop CE by  doxygen 1.5.5