addElement('select', 'status', [ 'label' => 'Account Status', 'required' => true, 'multioptions' => ['' => 'Select One'] + $this->_getStatuses(), ]); $this->addElement('date', 'membershipExpiresOn', [ 'label' => 'Membership Expires On', 'value' => date('Y-m-d', strtotime('+1 year')) ]); $this->addElement('header', '_contactFieldsHeader', ['value' => 'Contact Information']); $this->_initContactFields(); $this->addElement('header', '_showcaseFieldsHeader', ['value' => 'Showcase Information']); $this->_initShowcaseInfoFields(); $this->_initSocialLinksFields(); $this->addElement('header', '_memberFieldsHeader', ['value' => 'Member Information']); $this->_initMemberFields(); $this->addElement('header', '_membershipFieldsHeader', ['value' => 'Membership Information']); $this->_initMembershipFields(); $this->addElement('header', '_billingShippingFieldsHeader', ['value' => 'Payment & Billing Information']); $this->_initBillingShippingFields(); $this->addElement('header', '_prizeFieldsHeader', ['value' => 'Prize Information']); $this->_initPrizeFields(); return $this; } protected function _prepareData($data = null) { $data = parent::_prepareData($data); $this->_initAddressData($data); return $data; } protected function _initAddressData(array &$data) { if (($sameAs = $data[AddressEntity::TYPE_SHIPPING]['sameAs'])) { $data[AddressEntity::TYPE_SHIPPING] = array_merge(compact('sameAs'), $data[$sameAs]); } return $this; } protected function _initMemberFields() { parent::_initMemberFields(); $this->removeElement('securityQuestionId'); $this->removeElement('securityAnswer'); return $this; } protected function _initPrizeFields() { parent::_initPrizeFields(); $this->getElement('shirtSize')->setRequired(false); $this->getElement('shoeSize')->setRequired(false); $this->getElement('dressSize')->setRequired(false); $this->getElement('nailColor')->setRequired(false); return $this; } protected function _get4Select($tableAlias) { $table = new Qs_Db_Table($tableAlias); return $table->get4Select(); } protected function _getStatuses() { return $this->_get4Select('UserStatus'); } }