library/core/class.form.php
public function RadioList($FieldName, $DataSet, $Attributes = FALSE) {
      $List = GetValue('list', $Attributes);
      $Return = '';

      if ($List) {
         $Return .= '<ul'.(isset($Attributes['listclass']) ? " class=\"{$Attributes['listclass']}\"" : '').'>';
         $LiOpen = '<li>';
         $LiClose = '</li>';
      } else {
         $LiOpen = '';
         $LiClose = ' ';
      }
      
      // Show inline errors?
      $ShowErrors = ($this->_InlineErrors && array_key_exists($FieldName, $this->_ValidationResults));
      
      // Add error class to input element
      if ($ShowErrors) 
         $this->AddErrorClass($Attributes);

      if (is_object($DataSet)) {
         $ValueField = ArrayValueI('ValueField', $Attributes, 'value');
         $TextField = ArrayValueI('TextField', $Attributes, 'text');
         $Data = $DataSet->FirstRow();
         if (property_exists($Data, $ValueField) && property_exists($Data,
            $TextField)) {
            foreach($DataSet->Result() as $Data) {
               $Attributes['value'] = $Data->$ValueField;

               $Return .= $LiOpen.$this->Radio($FieldName, $Data->$TextField, $Attributes).$LiClose;
            }
         }
      } elseif (is_array($DataSet)) {
         foreach($DataSet as $ID => $Text) {
            $Attributes['value'] = $ID;
            $Return .= $LiOpen.$this->Radio($FieldName, $Text, $Attributes).$LiClose;
         }
      }

      if ($List)
         $Return .= '</ul>';
      
      // Append validation error message
      if ($ShowErrors && ArrayValueI('InlineErrors', $Attributes, TRUE))  
         $Return .= $this->InlineError($FieldName);

      return $Return;
   }
public function RadioList($FieldName, $DataSet, $Attributes = FALSE) {
      $List = GetValue('list', $Attributes);
      $Return = '';

      if ($List) {
         $Return .= '<ul'.(isset($Attributes['listclass']) ? " class=\"{$Attributes['listclass']}\"" : '').'>';
         $LiOpen = '<li>';
         $LiClose = '</li>';
      } else {
         $LiOpen = '';
         $LiClose = ' ';
      }
      
      // Show inline errors?
      $ShowErrors = ($this->_InlineErrors && array_key_exists($FieldName, $this->_ValidationResults));
      
      // Add error class to input element
      if ($ShowErrors) 
         $this->AddErrorClass($Attributes);

      if (is_object($DataSet)) {
         $ValueField = ArrayValueI('ValueField', $Attributes, 'value');
         $TextField = ArrayValueI('TextField', $Attributes, 'text');
         $Data = $DataSet->FirstRow();
         if (property_exists($Data, $ValueField) && property_exists($Data,
            $TextField)) {
            foreach($DataSet->Result() as $Data) {
               $Attributes['value'] = $Data->$ValueField;

               $Return .= $LiOpen.$this->Radio($FieldName, $Data->$TextField, $Attributes).$LiClose;
            }
         }
      } elseif (is_array($DataSet)) {
         foreach($DataSet as $ID => $Text) {
            $Attributes['value'] = $ID;
            $Return .= $LiOpen.$this->Radio($FieldName, $Text, $Attributes).$LiClose;
         }
      }

      if ($List)
         $Return .= '</ul>';
      
      // Append validation error message
      if ($ShowErrors && ArrayValueI('InlineErrors', $Attributes, TRUE))  
         $Return .= $this->InlineError($FieldName);

      return $Return;
   }
public function RadioList ( $ FieldName , $ DataSet , $ Attributes = FALSE ) { $ List = GetValue ( 'list' , $ Attributes ) ; $ Return = '' ; if ( $ List ) { $ Return .= '<ul' . ( isset ( $ Attributes [ 'listclass' ] ) ? " class=\"{$Attributes['listclass']}\"" : '' ) . '>' ; $ LiOpen = '<li>' ; $ LiClose = '</li>' ; } else { $ LiOpen = '' ; $ LiClose = ' ' ; } // Show inline errors? $ ShowErrors = ( $ this -> _InlineErrors && array_key_exists ( $ FieldName , $ this -> _ValidationResults ) ) ; // Add error class to input element if ( $ ShowErrors ) $ this -> AddErrorClass ( $ Attributes ) ; if ( is_object ( $ DataSet ) ) { $ ValueField = ArrayValueI ( 'ValueField' , $ Attributes , 'value' ) ; $ TextField = ArrayValueI ( 'TextField' , $ Attributes , 'text' ) ; $ Data = $ DataSet -> FirstRow ( ) ; if ( property_exists ( $ Data , $ ValueField ) && property_exists ( $ Data , $ TextField ) ) { foreach ( $ DataSet -> Result ( ) as $ Data ) { $ Attributes [ 'value' ] = $ Data -> $ ValueField ; $ Return .= $ LiOpen . $ this -> Radio ( $ FieldName , $ Data -> $ TextField , $ Attributes ) . $ LiClose ; } } } elseif ( is_array ( $ DataSet ) ) { foreach ( $ DataSet as $ ID => $ Text ) { $ Attributes [ 'value' ] = $ ID ; $ Return .= $ LiOpen . $ this -> Radio ( $ FieldName , $ Text , $ Attributes ) . $ LiClose ; } } if ( $ List ) $ Return .= '</ul>' ; // Append validation error message if ( $ ShowErrors && ArrayValueI ( 'InlineErrors' , $ Attributes , TRUE ) ) $ Return .= $ this -> InlineError ( $ FieldName ) ; return $ Return ; }
Returns XHTML for an unordered list of radio button elements.

@param string $FieldName The name of the field that is being displayed/posted with this input.
It should related directly to a field name in $this->_DataArray. ie. RoleID
@param mixed $DataSet The data to fill the options in the select list. Either an associative
array or a database dataset.
@param array $Attributes An associative array of attributes for the list. Here is a list of
"special" attributes and their default values:

Attribute   Options                        Default
------------------------------------------------------------------------
ValueField  The name of the field in       'value'
$DataSet that contains the
option values.
TextField   The name of the field in       'text'
$DataSet that contains the
option text.
Value       A string or array of strings.  $this->_DataArray->$FieldName
Default     The default value.             empty
InlineErrors  Show inline error message?   TRUE
Allows disabling per-dropdown
for multi-fields like Date()

@return string
Returns XHTML for an unordered list of radio button elements .