Example #1
0
 /**
  * Add standard condition field
  * @param string $key
  * @param string $label
  * @param string $size
  * @param string $unit
  * @param string $type options: all | numeric | string
  */
 private function addConditionField($key, $label, $size = '', $unit = '', $type = 'all')
 {
     $Field = new FormularInputWithEqualityOption($key, $label);
     $Field->setLayout(FormularFieldset::$LAYOUT_FIELD_W33);
     if (!empty($size)) {
         $Field->setSize($size);
     }
     if (!empty($unit)) {
         $Field->setUnit($unit);
     }
     if ($type == 'numeric') {
         $Field->setNumericOptions();
     } elseif ($type == 'string') {
         $Field->setStringOptions();
     }
     $this->Fieldset->addField($Field);
 }