Example #1
0
 /**
  * 
  */
 public function makeTRadioGroup($properties)
 {
     $widget = new TRadioGroup((string) $properties->{'name'});
     $widget->setLayout('vertical');
     $pieces = explode("\n", (string) $properties->{'items'});
     $items = array();
     if ($pieces) {
         foreach ($pieces as $line) {
             $part = explode(':', $line);
             $items[$part[0]] = $part[1];
         }
     }
     $widget->addItems($items);
     $widget->setValue((string) $properties->{'value'});
     if (isset($properties->{'tip'})) {
         $widget->setTip((string) $properties->{'tip'});
     }
     $this->fields[] = $widget;
     $this->fieldsByName[(string) $properties->{'name'}] = $widget;
     return $widget;
 }