aOptions[] = array('IdValue' => $IdValue, 'DisplayValue' => $DisplayValue, 'ItemAppend' => $ItemAppend); } function AddOptionsFromAssociativeArray($Array, $KeyPrefix) { while (list($key, $val) = each($Array)) { $this->AddOption($KeyPrefix.$key, $val); } } function AddOptionsFromDataSet(&$Database, $DataSet, $IdField, $DisplayField) { while ($rows = $Database->GetRow($DataSet)) { $this->AddOption($rows[$IdField], $rows[$DisplayField]); } } function Clear() { $this->Name = ''; $this->SelectedID = 0; $this->CssClass = ''; $this->Attributes = ''; $this->aOptions = array(); } function ClearOptions() { $this->aOptions = array(); } function Get() { $sReturn = ''; $OptionCount = count($this->aOptions); $i = 0; for ($i = 0; $i < $OptionCount ; $i++) { $sReturn .= 'Attributes.' id="Radio_'.$this->aOptions[$i]['IdValue'].'" value="'.$this->aOptions[$i]['IdValue'].'"'; if ($this->aOptions[$i]['IdValue'] == $this->SelectedID) $sReturn .= ' checked="checked"'; if ($this->CssClass != '') $sReturn .= ' class="'.$this->CssClass.'"'; $sReturn .= ' /> '.$this->aOptions[$i]['ItemAppend'].' '; } return $sReturn; } function Radio() { $this->Clear(); } function Write() { echo($this->Get()); } } ?>