00001 <?php 00002 00007 class Register extends User 00008 { 00014 protected $_sThisTemplate = 'register.tpl'; 00015 00021 protected $_sSuccessTemplate = 'register_success.tpl'; 00022 00028 protected $_aMustFillFields = null; 00029 00035 protected $_iViewIndexState = VIEW_INDEXSTATE_NOINDEXNOFOLLOW; 00036 00043 public function render() 00044 { 00045 parent::render(); 00046 00047 // checking registration status 00048 if ( $this->getRegistrationStatus() ) { 00049 00050 //for older templates 00051 $this->_aViewData['error'] = $this->getRegistrationError(); 00052 $this->_aViewData['success'] = $this->getRegistrationStatus(); 00053 00054 return $this->_sSuccessTemplate; 00055 } 00056 00057 $this->_aViewData['aMustFillFields'] = $this->getMustFillFields(); 00058 00059 return $this->_sThisTemplate; 00060 } 00061 00067 public function getRegistrationError() 00068 { 00069 return oxConfig::getParameter( 'newslettererror' ); 00070 } 00071 00077 public function getRegistrationStatus() 00078 { 00079 return oxConfig::getParameter( 'success' ); 00080 } 00081 00087 public function getMustFillFields() 00088 { 00089 if ( $this->_aMustFillFields === null ) { 00090 $this->_aMustFillFields = false; 00091 00092 // passing must-be-filled-fields info 00093 $aMustFillFields = $this->getConfig()->getConfigParam( 'aMustFillFields' ); 00094 if ( is_array( $aMustFillFields ) ) { 00095 $this->_aMustFillFields = array_flip( $aMustFillFields ); 00096 } 00097 } 00098 return $this->_aMustFillFields; 00099 } 00100 00106 public function getDelAddress() 00107 { 00108 // is logged in ? 00109 if ( $this->_oDelAddress === null ) { 00110 $this->_oDelAddress = false; 00111 00112 if ( $oUser = $this->getUser() ) { 00113 $sAddressId = $oUser->getSelectedAddress(); 00114 if ( $sAddressId && $sAddressId != '-1' ) { 00115 $this->_oDelAddress = oxNew( 'oxbase' ); 00116 $this->_oDelAddress->init( 'oxaddress' ); 00117 $this->_oDelAddress->load( $sAddressId ); 00118 } 00119 } 00120 } 00121 00122 return $this->_oDelAddress; 00123 } 00124 00132 protected function _addFakeAddress( $oAddresses ) 00133 { 00134 } 00135 00136 }