Example #1
0
 protected function createDataDescription()
 {
     $result = parent::createdataDescription();
     if ($field = $result->getFieldDescriptionByName('u_is_active')) {
         $result->removeFieldDescription($field);
     }
     if ($field = $result->getFieldDescriptionByName('u_password')) {
         $field->setProperty('message2', $this->translate('ERR_PWD_MISMATCH'));
         $result->removeFieldDescription($field);
         $result->addFieldDescription($field);
     }
     if ($this->getState() !== 'save') {
         if ($result->getFieldDescriptionByName('u_password')) {
             $field = new FieldDescription('u_password2');
             $field->setProperty('message2', $this->translate('ERR_PWD_MISMATCH'));
             $field->setType(FieldDescription::FIELD_TYPE_PWD);
             $field->setProperty('customField', true);
             //$field->setProperty('title', $this->translate('FIELD_U_PASSWORD2'));
             $field->setProperty('title', 'FIELD_U_PASSWORD2');
             $result->addFieldDescription($field);
         }
     }
     return $result;
 }