| @@ -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_Checkbox extends AccuaForm_OptionElement { |
| 4 | 3 | protected $attributes = array("type" => "checkbox"); |
| 5 | 4 | protected $inline; |
| 6 | 5 | protected $maxheight; |
| @@ -25,11 +24,8 @@ | ||
| 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 | if(isset($this->attributes["value"])) { |
| 33 | 29 | if(!is_array($this->attributes["value"])) |
| 34 | 30 | $this->attributes["value"] = array($this->attributes["value"]); |
| 35 | 31 | } |
| @@ -39,23 +35,12 @@ | ||
| 39 | 35 | if(substr($this->attributes["name"], -2) != "[]") |
| 40 | 36 | $this->attributes["name"] .= "[]"; |
| 41 | 37 | |
| 42 | 38 | $count = 0; |
| 43 | - $wrapperCssId = $this->getWrapperCssId(); | |
| 44 | - $wrapperCssClass = $this->getWrapperCssClass(); | |
| 45 | 39 | echo '<div id="', $this->attributes["id"], '"><div class="pfbc-checkboxes">'; |
| 46 | 40 | foreach($this->options as $value => $text) { |
| 47 | 41 | $value = $this->getOptionValue($value); |
| 48 | - $optionNum = $count + 1; | |
| 49 | - $optionClass = 'pfbc-checkbox'; | |
| 50 | - if(!empty($wrapperCssClass)) { | |
| 51 | - $optionClass .= ' ' . esc_attr($wrapperCssClass) . '-option-' . $optionNum; | |
| 52 | - } | |
| 53 | - echo '<div class="', $optionClass, '"'; | |
| 54 | - if(!empty($wrapperCssId)) { | |
| 55 | - echo ' id="', esc_attr($wrapperCssId), '-option-', $optionNum, '"'; | |
| 56 | - } | |
| 57 | - echo '><input id="', $this->attributes["id"], "-", $count, '"', $this->getAttributes(array("id", "value", "checked")), ' value="', $this->filter($value), '"'; | |
| 42 | + echo '<div class="pfbc-checkbox"><input id="', $this->attributes["id"], "-", $count, '"', $this->getAttributes(array("id", "value", "checked")), ' value="', $this->filter($value), '"'; | |
| 58 | 43 | if(in_array($value, $this->attributes["value"])) |
| 59 | 44 | echo ' checked="checked"'; |
| 60 | 45 | echo '/> <label for="', $this->attributes["id"], "-", $count, '">', $text, '</label></div>'; |
| 61 | 46 | ++$count; |