/** * Show the widget at the screen */ public function show() { if ($this->items) { // iterate the RadioButton options foreach ($this->items as $index => $label) { $button = new TRadioButton($this->name); $button->setTip($this->tag->title); $button->setValue($index); // check if contains any value if ($this->value == $index) { // mark as checked $button->setProperty('checked', '1'); } // check whether the widget is non-editable if (!parent::getEditable()) { $button->setEditable(FALSE); } // create the label for the button $obj = new TLabel($label); $obj->add($button); $obj->show(); if ($this->layout == 'vertical') { // shows a line break $br = new TElement('br'); $br->show(); } echo "\n"; } } }
/** * Show the widget at the screen */ public function show() { if ($this->items) { // iterate the RadioButton options foreach ($this->items as $index => $label) { $button = new TRadioButton($this->name); $button->setTip($this->tag->title); $button->setValue($index); // check if contains any value if ($this->value == $index) { // mark as checked $button->setProperty('checked', '1'); } // check whether the widget is non-editable if (parent::getEditable()) { if (isset($this->changeAction)) { if (!TForm::getFormByName($this->formName) instanceof TForm) { throw new Exception(TAdiantiCoreTranslator::translate('You must pass the ^1 (^2) as a parameter to ^3', __CLASS__, $this->name, 'TForm::setFields()')); } $string_action = $this->changeAction->serialize(FALSE); $button->setProperty('onChange', "serialform=(\$('#{$this->formName}').serialize());\n ajaxLookup('{$string_action}&'+serialform, this)"); } } else { $button->setEditable(FALSE); } // create the label for the button $obj = new TLabel($label); $obj->add($button); $obj->show(); if ($this->layout == 'vertical') { // shows a line break $br = new TElement('br'); $br->show(); } echo "\n"; } } }