コード例 #1
0
 protected function buildBicElement()
 {
     if ($this->getBicFieldName() !== null) {
         if ($this->getBicOptionList() !== null) {
             $list = $this->getBicOptionList();
             asort($list);
             $this->bicControl = new Customweb_Form_Control_Select($this->getBicFieldName(), array_merge(array('none' => ' - ' . Customweb_I18n_Translation::__('Please select') . ' - '), $list));
             $description = Customweb_I18n_Translation::__('Please select the Bank Identifier Code (BIC) of your bank.');
         } else {
             $this->bicControl = new Customweb_Form_Control_TextInput($this->getBicFieldName());
             $description = Customweb_I18n_Translation::__('Please enter here the Bank Identifier Code (BIC).');
             $this->bicControl->setAutocomplete(false);
         }
         $this->bicControl->addValidator(new Customweb_Form_Validator_NotEmpty($this->bicControl, Customweb_I18n_Translation::__("You have to enter the BIC.")));
         $this->bicElement = new Customweb_Form_Element(Customweb_I18n_Translation::__('BIC'), $this->bicControl, $description);
         $this->bicElement->setElementIntention(Customweb_Form_Intention_Factory::getBankCodeIntention())->setErrorMessage($this->getBicErrorMessage());
     }
 }