| @@ -1,6 +1,5 @@ | ||
| 1 | 1 | <?php |
| 2 | -// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped, WordPress.Security.EscapeOutput.HeredocOutputNotEscaped, PluginCheck.CodeAnalysis.Heredoc -- PFBC framework extension, HTML output is controlled | |
| 3 | 2 | class AccuaForm_Element_Radio extends AccuaForm_OptionElement { |
| 4 | 3 | protected $attributes = array("type" => "radio"); |
| 5 | 4 | protected $inline; |
| 6 | 5 | protected $maxheight; |
| @@ -25,28 +24,14 @@ | ||
| 25 | 24 | } |
| 26 | 25 | } |
| 27 | 26 | |
| 28 | 27 | public function render() { |
| 29 | - // Apply ARIA attributes for accessibility (EAA compliance) | |
| 30 | - $this->applyAriaAttributes(); | |
| 31 | - | |
| 32 | 28 | $count = 0; |
| 33 | 29 | $checked = false; |
| 34 | - $wrapperCssId = $this->getWrapperCssId(); | |
| 35 | - $wrapperCssClass = $this->getWrapperCssClass(); | |
| 36 | 30 | echo '<div id="', $this->attributes["id"], '"><div class="pfbc-radio-buttons">'; |
| 37 | 31 | foreach($this->options as $value => $text) { |
| 38 | 32 | $value = $this->getOptionValue($value); |
| 39 | - $optionNum = $count + 1; | |
| 40 | - $optionClass = 'pfbc-radio'; | |
| 41 | - if(!empty($wrapperCssClass)) { | |
| 42 | - $optionClass .= ' ' . esc_attr($wrapperCssClass) . '-option-' . $optionNum; | |
| 43 | - } | |
| 44 | - echo '<div class="', $optionClass, '"'; | |
| 45 | - if(!empty($wrapperCssId)) { | |
| 46 | - echo ' id="', esc_attr($wrapperCssId), '-option-', $optionNum, '"'; | |
| 47 | - } | |
| 48 | - echo '><input id="', $this->attributes["id"], "-", $count, '"', $this->getAttributes(array("id", "value", "checked")), ' value="', $this->filter($value), '"'; | |
| 33 | + echo '<div class="pfbc-radio"><input id="', $this->attributes["id"], "-", $count, '"', $this->getAttributes(array("id", "value", "checked")), ' value="', $this->filter($value), '"'; | |
| 49 | 34 | if(isset($this->attributes["value"]) && $this->attributes["value"] == $value) |
| 50 | 35 | echo ' checked="checked"'; |
| 51 | 36 | echo '/> <label for="', $this->attributes["id"], "-", $count, '">', $text, '</label></div>'; |
| 52 | 37 | ++$count; |