/** * Add a form field * @param $label Field Label * @param $object Field Object * @param $size Field Size * @param $validator Field Validator */ public function addQuickField($label, AdiantiWidgetInterface $object, $size = 200, TFieldValidator $validator = NULL) { $object->setSize($size, $size); parent::addField($object); $object->setLabel($label); if (empty($this->currentRow) or $this->fieldPositions % $this->fieldsByRow == 0) { // add the field to the container $this->currentRow = $this->table->addRow(); } $row = $this->currentRow; if ($validator instanceof TRequiredValidator) { $label_field = new TLabel($label . ' (*)'); $label_field->setFontColor('#FF0000'); } else { $label_field = new TLabel($label); } if ($object instanceof THidden) { $row->addCell(''); } else { $row->addCell($label_field); } $row->addCell($object); if ($validator) { $object->addValidation($label, $validator); } $this->fieldPositions++; return $row; }