<commit_before><?php // vim:ts=4:sw=4:et:fdm=marker
/*
 * Undocumented
 *
 * @link http://agiletoolkit.org/
*//*
==ATK4===================================================
   This file is part of Agile Toolkit 4
    http://agiletoolkit.org/

   (c) 2008-2013 Agile Toolkit Limited <<EMAIL>>
   Distributed under Affero General Public License v3 and
   commercial license.

   See LICENSE or LICENSE_COM for more information
 =====================================================ATK4=*/
class Form_Field_Radio extends Form_Field_ValueList {
    function validate(){
        if(!isset($this->value_list[$this->value]) && (!$this->value && $this->empty_value)){
            $this->displayFieldError("Value ".$this->value." is not one of offered values");
        }
        return parent::validate();
    }
    function getInput($attr=array()){
        $output = '<div id="'.$this->name.'" class="atk-form-options">';
        foreach($this->getValueList() as $value=>$descr){

            if($descr instanceof AbstractView){
                $descr=$descr->getHTML();
            }else{
                $descr=$this->api->encodeHtmlChars($descr);
            }

            $output.=
                "<div>".$this->getTag('input',
                        array_merge(
                            array(
                                'id'=>$this->name.'_'.$value,
                                'name'=>$this->name,
                                'data-shortname'=>$this->short_name,
                                'type'=>'radio',
                                'value'=>$value,<commit_msg>Make compatible with validation changes<commit_after><?php // vim:ts=4:sw=4:et:fdm=marker
/*
 * Undocumented
 *
 * @link http://agiletoolkit.org/
*//*
==ATK4===================================================
   This file is part of Agile Toolkit 4
    http://agiletoolkit.org/

   (c) 2008-2013 Agile Toolkit Limited <<EMAIL>>
   Distributed under Affero General Public License v3 and
   commercial license.

   See LICENSE or LICENSE_COM for more information
 =====================================================ATK4=*/
class Form_Field_Radio extends Form_Field_ValueList {
    function getInput($attr=array()){
        $output = '<div id="'.$this->name.'" class="atk-form-options">';
        foreach($this->getValueList() as $value=>$descr){

            if($descr instanceof AbstractView){
                $descr=$descr->getHTML();
            }else{
                $descr=$this->api->encodeHtmlChars($descr);
            }

            $output.=
                "<div>".$this->getTag('input',
                        array_merge(
                            array(
                                'id'=>$this->name.'_'.$value,
                                'name'=>$this->name,
                                'data-shortname'=>$this->short_name,
                                'type'=>'radio',
                                'value'=>$value,
{'fraction_non_alphanumeric': 0.2072714916751614, 'fraction_numerical': 0.009514101257220523, 'mean_word_length': 1.9322709163346614, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '628366', 'n_tokens_mistral': 807, 'n_tokens_neox': 765, 'n_words': 152}