| @@ -9,8 +9,9 @@ | ||
| 9 | 9 | class FrmFieldRadio extends FrmFieldType { |
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * @var string |
| 13 | + * | |
| 13 | 14 | * @since 3.0 |
| 14 | 15 | */ |
| 15 | 16 | protected $type = 'radio'; |
| 16 | 17 | |
| @@ -15,8 +16,9 @@ | ||
| 15 | 16 | protected $type = 'radio'; |
| 16 | 17 | |
| 17 | 18 | /** |
| 18 | 19 | * @var bool |
| 20 | + * | |
| 19 | 21 | * @since 3.0 |
| 20 | 22 | */ |
| 21 | 23 | protected $holds_email_values = true; |
| 22 | 24 | |
| @@ -23,8 +25,9 @@ | ||
| 23 | 25 | /** |
| 24 | 26 | * Does the html for this field label need to include "for"? |
| 25 | 27 | * |
| 26 | 28 | * @var bool |
| 29 | + * | |
| 27 | 30 | * @since 3.06.01 |
| 28 | 31 | */ |
| 29 | 32 | protected $has_for_label = false; |
| 30 | 33 | |
| @@ -30,10 +33,13 @@ | ||
| 30 | 33 | |
| 31 | 34 | /** |
| 32 | 35 | * @var bool |
| 33 | 36 | */ |
| 34 | - protected $array_allowed = false; | |
| 37 | + protected $array_allowed = true; | |
| 35 | 38 | |
| 39 | + /** | |
| 40 | + * @return string | |
| 41 | + */ | |
| 36 | 42 | protected function input_html() { |
| 37 | 43 | return $this->multiple_input_html(); |
| 38 | 44 | } |
| 39 | 45 | |
| @@ -41,11 +47,23 @@ | ||
| 41 | 47 | return $this->include_front_form_file(); |
| 42 | 48 | } |
| 43 | 49 | |
| 44 | 50 | /** |
| 51 | + * @return bool[] | |
| 52 | + */ | |
| 53 | + protected function field_settings_for_type() { | |
| 54 | + return array( | |
| 55 | + 'invalid' => true, | |
| 56 | + ); | |
| 57 | + } | |
| 58 | + | |
| 59 | + /** | |
| 45 | 60 | * Get the type of field being displayed. |
| 46 | 61 | * |
| 47 | 62 | * @since 4.02.01 |
| 63 | + * | |
| 64 | + * @param array|object $field | |
| 65 | + * | |
| 48 | 66 | * @return array |
| 49 | 67 | */ |
| 50 | 68 | public function displayed_field_type( $field ) { |
| 51 | 69 | return array( |
| @@ -56,12 +74,10 @@ | ||
| 56 | 74 | /** |
| 57 | 75 | * @return array |
| 58 | 76 | */ |
| 59 | 77 | protected function extra_field_opts() { |
| 60 | - $form_id = $this->get_field_column( 'form_id' ); | |
| 61 | - | |
| 62 | 78 | return array( |
| 63 | - 'align' => FrmStylesController::get_style_val( 'radio_align', ( empty( $form_id ) ? 'default' : $form_id ) ), | |
| 79 | + 'align' => '', | |
| 64 | 80 | ); |
| 65 | 81 | } |
| 66 | 82 | |
| 67 | 83 | /** |
| @@ -80,8 +96,10 @@ | ||
| 80 | 96 | |
| 81 | 97 | /** |
| 82 | 98 | * @since 4.06 |
| 83 | 99 | * |
| 100 | + * @param array $args | |
| 101 | + * | |
| 84 | 102 | * @return void |
| 85 | 103 | */ |
| 86 | 104 | protected function show_priority_field_choices( $args = array() ) { |
| 87 | 105 | include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/back-end/radio-images.php'; |
| @@ -98,6 +116,19 @@ | ||
| 98 | 116 | * @return bool |
| 99 | 117 | */ |
| 100 | 118 | protected function show_readonly_hidden() { |
| 101 | 119 | return true; |
| 120 | + } | |
| 121 | + | |
| 122 | + /** | |
| 123 | + * Unset aria-invalid for radio buttons because it's not valid for radio buttons. | |
| 124 | + * Instead aria-invalid is added to the radiogroup parent element. | |
| 125 | + * | |
| 126 | + * @since 6.25 | |
| 127 | + * | |
| 128 | + * @param array $shortcode_atts | |
| 129 | + * @param array $args | |
| 130 | + */ | |
| 131 | + public function set_aria_invalid_error( &$shortcode_atts, $args ) { | |
| 132 | + unset( $shortcode_atts['aria-invalid'] ); | |
| 102 | 133 | } |
| 103 | 134 | } |