PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / V3.3.2
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder vV3.3.2
V3.3.3 V3.3.2 3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 All 140 releases
← All changes | includes/Frontend/Form/View/Theme/Fields/RatingField.php +89 -48 2.10.0 → V3.3.2 View file →
@@ -52,11 +52,12 @@
52 52 // } else {
53 53 // $checked = '';
54 54 // }
55 55
56 - if ($defaultValue ) {
57 - if ($opt->val === $defaultValue)
56 + if ($defaultValue) {
57 + if ($opt->val === $defaultValue) {
58 58 $checked = "checked='1'";
59 + }
59 60 } else {
60 61 if (isset($opt->check) && true === $opt->check) {
61 62 $checked = "checked='{$opt->check}'";
62 63 } else {
@@ -68,55 +69,95 @@
68 69 $checkedCls = $rowID . '-rating-selected';
69 70 } else {
70 71 $checkedCls = null;
71 72 }
72 - $ratingOption .= <<<RATINGOPTION
73 - <label
74 - class="{$fieldHelpers->getAtomicCls('rating-lbl')} {$fieldHelpers->getCustomClasses('rating-lbl')}"
75 - for="{$rowID}-{$contentCount}-rating-{$key}"
76 - {$fieldHelpers->getCustomAttributes('rating-lbl')}
77 - data-indx="{$key}"
78 - >
79 - <input
80 - type="radio"
81 - class="{$fieldHelpers->getAtomicCls('rating-input')} {$fieldHelpers->getCustomClasses('rating-input')}"
82 - {$name}
83 - value={$val}
84 - aria-label="{$lbl}"
85 - id="{$rowID}-{$contentCount}-rating-{$key}"
86 - {$checked}
87 - {$req}
88 - {$fieldHelpers->getCustomAttributes('rating-input')}
89 - />
90 - <img
91 - class="{$fieldHelpers->getAtomicCls('rating-img')} {$fieldHelpers->getCustomClasses('rating-img')} {$checkedCls}"
92 - src="{$img}"
93 - alt="{$lbl}"
94 - aria-label="{$lbl}"
95 - {$fieldHelpers->getCustomAttributes('rating-img')}
96 - />
97 - </label>
98 -RATINGOPTION;
73 + $ratingOption .= sprintf(
74 + '<label
75 + class="%1$s %2$s"
76 + for="%3$s-%4$s-rating-%5$s"
77 + %6$s
78 + data-indx="%5$s"
79 + >
80 + <input
81 + type="radio"
82 + class="%7$s %8$s"
83 + %9$s
84 + value="%10$s"
85 + aria-label="%11$s"
86 + id="%3$s-%4$s-rating-%5$s"
87 + %12$s
88 + %13$s
89 + %14$s
90 + />
91 + <img
92 + class="%15$s %16$s %17$s"
93 + src="%18$s"
94 + alt="%11$s"
95 + aria-label="%11$s"
96 + %19$s
97 + />
98 + </label>',
99 + $fieldHelpers->getAtomicCls('rating-lbl'),
100 + $fieldHelpers->getCustomClasses('rating-lbl'),
101 + $rowID,
102 + $contentCount,
103 + $key,
104 + $fieldHelpers->getCustomAttributes('rating-lbl'),
105 + $fieldHelpers->getAtomicCls('rating-input'),
106 + $fieldHelpers->getCustomClasses('rating-input'),
107 + $name,
108 + $fieldHelpers->esc_attr($val),
109 + $fieldHelpers->esc_attr($lbl),
110 + $checked,
111 + $req,
112 + $fieldHelpers->getCustomAttributes('rating-input'),
113 + $fieldHelpers->getAtomicCls('rating-img'),
114 + $fieldHelpers->getCustomClasses('rating-img'),
115 + $checkedCls,
116 + $fieldHelpers->esc_url($img),
117 + $fieldHelpers->getCustomAttributes('rating-img')
118 + );
99 119 }
100 120 }
101 121
102 - return <<<RATINGFIELD
103 - <div
104 - {$fieldHelpers->getCustomAttributes('inp-fld-wrp')}
105 - class="{$fieldHelpers->getAtomicCls('inp-fld-wrp')} {$fieldHelpers->getCustomClasses('inp-fld-wrp')}"
106 - >
107 - <div
108 - {$fieldHelpers->getCustomAttributes('rating-wrp')}
109 - class="{$fieldHelpers->getAtomicCls('rating-wrp')} {$fieldHelpers->getCustomClasses('rating-wrp')}"
110 - tabindex="0"
122 + $labelId = $fieldHelpers->getLabelId();
123 + $ariaDescribedBy = $fieldHelpers->ariaDescribedBy();
124 + $ariaRequired = $fieldHelpers->ariaRequired();
125 +
126 + return sprintf(
127 + '<div
128 + %1$s
129 + class="%2$s %3$s"
111 130 >
112 - {$ratingOption}
113 - </div>
114 - <span
115 - class="{$fieldHelpers->getAtomicCls('rating-msg')} {$fieldHelpers->getCustomClasses('rating-msg')}"
116 - {$fieldHelpers->getCustomAttributes('rating-msg')}
117 - >
118 - </span>
119 - </div>
120 -RATINGFIELD;
131 + <div
132 + %4$s
133 + class="%5$s %6$s"
134 + role="radiogroup"
135 + aria-labelledby="%7$s"
136 + %8$s
137 + %9$s
138 + tabindex="0"
139 + >
140 +%10$s
141 + </div>
142 + <span
143 + class="%11$s %12$s"
144 + %13$s
145 + >
146 + </span>
147 + </div>',
148 + $fieldHelpers->getCustomAttributes('inp-fld-wrp'),
149 + $fieldHelpers->getAtomicCls('inp-fld-wrp'),
150 + $fieldHelpers->getCustomClasses('inp-fld-wrp'),
151 + $fieldHelpers->getCustomAttributes('rating-wrp'),
152 + $fieldHelpers->getAtomicCls('rating-wrp'),
153 + $fieldHelpers->getCustomClasses('rating-wrp'),
154 + $labelId,
155 + $ariaDescribedBy,
156 + $ariaRequired,
157 + $ratingOption,
158 + $fieldHelpers->getAtomicCls('rating-msg'),
159 + $fieldHelpers->getCustomClasses('rating-msg'),
160 + $fieldHelpers->getCustomAttributes('rating-msg')
161 + );
121 162 }
122 -}
163 +}