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
00036 protected $_iViewIndexState = 1;
00037
00044 public function render()
00045 {
00046 parent::render();
00047
00048
00049 if ( $this->getRegistrationStatus() ) {
00050
00051
00052 $this->_aViewData['error'] = $this->getRegistrationError();
00053 $this->_aViewData['success'] = $this->getRegistrationStatus();
00054
00055 return $this->_sSuccessTemplate;
00056 }
00057
00058 $this->_aViewData['aMustFillFields'] = $this->getMustFillFields();
00059
00060 return $this->_sThisTemplate;
00061 }
00062
00068 public function getRegistrationError()
00069 {
00070 return oxConfig::getParameter( 'newslettererror' );
00071 }
00072
00078 public function getRegistrationStatus()
00079 {
00080 return oxConfig::getParameter( 'success' );
00081 }
00082
00088 public function getMustFillFields()
00089 {
00090 if ( $this->_aMustFillFields === null ) {
00091 $this->_aMustFillFields = false;
00092
00093
00094 $aMustFillFields = $this->getConfig()->getConfigParam( 'aMustFillFields' );
00095 if ( is_array( $aMustFillFields ) ) {
00096 $this->_aMustFillFields = array_flip( $aMustFillFields );
00097 }
00098 }
00099 return $this->_aMustFillFields;
00100 }
00101
00107 public function getDelAddress()
00108 {
00109
00110 if ( $this->_oDelAddress === null ) {
00111 $this->_oDelAddress = false;
00112
00113 if ( $oUser = $this->getUser() ) {
00114 $sAddressId = $oUser->getSelectedAddress();
00115 if ( $sAddressId && $sAddressId != '-1' ) {
00116 $this->_oDelAddress = oxNew( 'oxbase' );
00117 $this->_oDelAddress->init( 'oxaddress' );
00118 $this->_oDelAddress->load( $sAddressId );
00119 }
00120 }
00121 }
00122
00123 return $this->_oDelAddress;
00124 }
00125
00133 protected function _addFakeAddress( $oAddresses )
00134 {
00135 }
00136
00137 }