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 $_iViewIndexState = VIEW_INDEXSTATE_NOINDEXNOFOLLOW; 00035 00042 public function render() 00043 { 00044 parent::render(); 00045 00046 // checking registration status 00047 if ( $this->getRegistrationStatus() ) { 00048 00049 //for older templates 00050 $this->_aViewData['error'] = $this->getRegistrationError(); 00051 $this->_aViewData['success'] = $this->getRegistrationStatus(); 00052 00053 return $this->_sSuccessTemplate; 00054 } 00055 00056 $this->_aViewData['aMustFillFields'] = $this->getMustFillFields(); 00057 00058 return $this->_sThisTemplate; 00059 } 00060 00066 public function getRegistrationError() 00067 { 00068 return oxConfig::getParameter( 'newslettererror' ); 00069 } 00070 00076 public function getRegistrationStatus() 00077 { 00078 return oxConfig::getParameter( 'success' ); 00079 } 00080 00086 public function getDelAddress() 00087 { 00088 // is logged in ? 00089 if ( $this->_oDelAddress === null ) { 00090 $this->_oDelAddress = false; 00091 00092 if ( $oUser = $this->getUser() ) { 00093 $sAddressId = $oUser->getSelectedAddress(); 00094 if ( $sAddressId && $sAddressId != '-1' ) { 00095 $this->_oDelAddress = oxNew( 'oxaddress' ); 00096 $this->_oDelAddress->load( $sAddressId ); 00097 } 00098 } 00099 } 00100 00101 return $this->_oDelAddress; 00102 } 00103 00111 protected function _addFakeAddress( $oAddresses ) 00112 { 00113 } 00114 00122 public function isFieldRequired( $sField ) 00123 { 00124 if ( $aMustFillFields = $this->getMustFillFields() ) { 00125 if ( isset( $aMustFillFields[$sField] ) ) { 00126 return true; 00127 } 00128 } 00129 00130 return false; 00131 } 00132 00133 }