| @@ -1,16 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * PFBC (PHP Form Builder Class) - Third-party library | |
| 4 | - * @package PFBC | |
| 5 | - */ | |
| 6 | - | |
| 7 | -// phpcs:disable WordPress.Security.EscapeOutput, WordPress.NamingConventions.PrefixAllGlobals, PluginCheck.CodeAnalysis.Heredoc -- Third-party library | |
| 8 | - | |
| 9 | 2 | abstract class View extends Base { |
| 10 | 3 | protected $form; |
| 11 | 4 | |
| 12 | - public function __construct(?array $properties = null) { | |
| 5 | + public function __construct(array $properties = null) { | |
| 13 | 6 | $this->configure($properties); |
| 14 | 7 | } |
| 15 | 8 | |
| 16 | 9 | /*This method encapsulates the various pieces that are included in an element's label.*/ |
| @@ -22,9 +15,9 @@ | ||
| 22 | 15 | echo '<div class="pfbc-label">'; |
| 23 | 16 | if(!empty($label)) { |
| 24 | 17 | echo '<label for="', $id, '">'; |
| 25 | 18 | if($element->isRequired()) |
| 26 | - echo '<span class="pfbc-required" aria-label="required">*</span> '; | |
| 19 | + echo '<strong>*</strong> '; | |
| 27 | 20 | echo $label, '</label>'; |
| 28 | 21 | } |
| 29 | 22 | if(!empty($description)) |
| 30 | 23 | echo '<em>', $description, '</em>'; |
| @@ -30,20 +23,8 @@ | ||
| 30 | 23 | echo '<em>', $description, '</em>'; |
| 31 | 24 | echo '</div>'; |
| 32 | 25 | } |
| 33 | 26 | } |
| 34 | - | |
| 35 | - /*Render inline error messages for an element with proper ARIA support*/ | |
| 36 | - protected function renderInlineError($element) { | |
| 37 | - $errors = $element->getErrors(); | |
| 38 | - $errorID = $element->getErrorID(); | |
| 39 | - if(!empty($errors) && !empty($errorID)) { | |
| 40 | - echo '<div class="pfbc-inline-error" id="', $errorID, '" role="alert" aria-live="polite">'; | |
| 41 | - echo '<span class="pfbc-error-icon" aria-hidden="true">⚠</span> '; | |
| 42 | - echo '<span class="pfbc-error-text">', implode(' ', $errors), '</span>'; | |
| 43 | - echo '</div>'; | |
| 44 | - } | |
| 45 | - } | |
| 46 | 27 | |
| 47 | 28 | public function setForm(Form $form) { |
| 48 | 29 | $this->form = $form; |
| 49 | 30 | } |