original_string: private function choose_from_radio($options, $name, $onclick = '', $checked = '', $return = false) {
  
          static $idcounter = 0;
  
          if (!$name) {
              $name = 'unnamed';
          }
  
          $output = '<span class="radiogroup ' . $name . "\">\n";
  
          if (!empty($options)) {
              $currentradio = 0;
              foreach ($options as $value => $label) {
                  $htmlid = 'auto-rb' . sprintf('%04d', ++$idcounter);
                  $output .= ' <span class="radioelement ' . $name . ' rb' . $currentradio . "\">";
                  $output .= '<input name="' . $name . '" id="' . $htmlid . '" type="radio" value="' . $value . '"';
                  if ($value == $checked) {
                      $output .= ' checked="checked"';
                  }
                  if ($onclick) {
                      $output .= ' onclick="' . $onclick . '"';
                  }
                  if ($label === '') {
                      $output .= ' /> <label for="' . $htmlid . '">' . $value . '</label></span>' . "\n";
                  } else {
                      $output .= ' /> <label for="' . $htmlid . '">' . $label . '</label></span>' . "\n";
                  }
                  $currentradio = ($currentradio + 1) % 2;
              }
          }
  
          $output .= '</span>' . "\n";
  
          if ($return) {
              return $output;
          } else {
              echo $output;
          }
      }
code: private function choose_from_radio($options, $name, $onclick = '', $checked = '', $return = false) {
  
          static $idcounter = 0;
  
          if (!$name) {
              $name = 'unnamed';
          }
  
          $output = '<span class="radiogroup ' . $name . "\">\n";
  
          if (!empty($options)) {
              $currentradio = 0;
              foreach ($options as $value => $label) {
                  $htmlid = 'auto-rb' . sprintf('%04d', ++$idcounter);
                  $output .= ' <span class="radioelement ' . $name . ' rb' . $currentradio . "\">";
                  $output .= '<input name="' . $name . '" id="' . $htmlid . '" type="radio" value="' . $value . '"';
                  if ($value == $checked) {
                      $output .= ' checked="checked"';
                  }
                  if ($onclick) {
                      $output .= ' onclick="' . $onclick . '"';
                  }
                  if ($label === '') {
                      $output .= ' /> <label for="' . $htmlid . '">' . $value . '</label></span>' . "\n";
                  } else {
                      $output .= ' /> <label for="' . $htmlid . '">' . $label . '</label></span>' . "\n";
                  }
                  $currentradio = ($currentradio + 1) % 2;
              }
          }
  
          $output .= '</span>' . "\n";
  
          if ($return) {
              return $output;
          } else {
              echo $output;
          }
      }
code_tokens: private function choose_from_radio ( $ options , $ name , $ onclick = '' , $ checked = '' , $ return = false ) { static $ idcounter = 0 ; if ( ! $ name ) { $ name = 'unnamed' ; } $ output = '<span class="radiogroup ' . $ name . "\">\n" ; if ( ! empty ( $ options ) ) { $ currentradio = 0 ; foreach ( $ options as $ value => $ label ) { $ htmlid = 'auto-rb' . sprintf ( '%04d' , ++ $ idcounter ) ; $ output .= ' <span class="radioelement ' . $ name . ' rb' . $ currentradio . "\">" ; $ output .= '<input name="' . $ name . '" id="' . $ htmlid . '" type="radio" value="' . $ value . '"' ; if ( $ value == $ checked ) { $ output .= ' checked="checked"' ; } if ( $ onclick ) { $ output .= ' onclick="' . $ onclick . '"' ; } if ( $ label === '' ) { $ output .= ' /> <label for="' . $ htmlid . '">' . $ value . '</label></span>' . "\n" ; } else { $ output .= ' /> <label for="' . $ htmlid . '">' . $ label . '</label></span>' . "\n" ; } $ currentradio = ( $ currentradio + 1 ) % 2 ; } } $ output .= '</span>' . "\n" ; if ( $ return ) { return $ output ; } else { echo $ output ; } }
docstring: Given an array of values, creates a group of radio buttons to be part of a form
  
  @param array  $options  An array of value-label pairs for the radio group (values as keys).
  @param string $name     Name of the radiogroup (unique in the form).
  @param string $onclick  Function to be executed when the radios are clicked.
  @param string $checked  The value that is already checked.
  @param bool   $return   If true, return the HTML as a string, otherwise print it.
  
  @return mixed If $return is false, returns nothing, otherwise returns a string of HTML.
docstring_tokens: Given an array of values creates a group of radio buttons to be part of a form