Skip to content

Commit e3950a4

Browse files
authored
Merge pull request #226 from cooperfellows/UDOIT_issue168
Udoit issue168 - Add Unique ID to Form Elements fixes #168
2 parents e564b95 + e0cf516 commit e3950a4

File tree

9 files changed

+19
-13
lines changed

9 files changed

+19
-13
lines changed

templates/partials/result_item/contrast.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
<div class="left">
2727
<div class="form-group no-margin margin-bottom">
2828
<?php if ( isset($group_item->back_color) ): ?>
29-
<label for="newcontent[1]">Replace Background Color <?= $group_item->back_color; ?></label>
30-
<input class="color {hash:true,caps:false} form-control back-color" type="text" name="newcontent[1]" value="<?= $group_item->back_color; ?>" placeholder="Replacement for Background Color <?= $group_item->back_color; ?>">
29+
<label for="<?= $this->e($item_id); ?>-bgcolor">Replace Background Color <?= $group_item->back_color; ?></label>
30+
<input class="color {hash:true,caps:false} form-control back-color" type="text" name="newcontent[1]" value="<?= $group_item->back_color; ?>" placeholder="Replacement for Background Color <?= $group_item->back_color; ?>" id="<?= $this->e($item_id);?>-bgcolor">
3131
<?php endif; ?>
3232

33-
<label for="newcontent[0]">Replace Foreground Color <?= $group_item->fore_color; ?></label>&nbsp;<span class="contrast-invalid hidden red"><span class="glyphicon glyphicon-remove"></span>&nbsp;Ratio Invalid (<span class="contrast-ratio"></span>:1)</span>
34-
<input class="color {hash:true,caps:false} form-control fore-color" type="text" name="newcontent[0]" value="<?= $group_item->fore_color; ?>" placeholder="Replacement for Foreground Color <?= $group_item->fore_color; ?>">
33+
<label for="<?= $this->e($item_id); ?>-fgcolor">Replace Foreground Color <?= $group_item->fore_color; ?></label>&nbsp;<span class="contrast-invalid hidden red"><span class="glyphicon glyphicon-remove"></span>&nbsp;Ratio Invalid (<span class="contrast-ratio"></span>:1)</span>
34+
<input class="color {hash:true,caps:false} form-control fore-color" type="text" name="newcontent[0]" value="<?= $group_item->fore_color; ?>" placeholder="Replacement for Foreground Color <?= $group_item->fore_color; ?>" id="<?= $this->e($item_id); ?>-fgcolor">
3535
<label><input name="add-bold" type="checkbox" value="bold" />&nbsp;Make this text bold</label>&nbsp;<label><input name="add-italic" type="checkbox" value="italic" />&nbsp;Make this text <span style="font-style: italics;">italicized</span></label><br />
3636
<input type="text" name="threshold" class="threshold hidden" value="<?= $group_item->text_type; ?>">
3737
</div>

templates/partials/result_item/header_text.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
*/
2020
?>
2121
<div class="form-group no-margin margin-bottom">
22-
<input class="{hash:true,caps:false} form-control" type="text" name="newcontent" placeholder="New heading text">
22+
<label for="<?= $this->e($item_id); ?>-input" class="control-label sr-only">Enter New Text For This Heading</label>
23+
<input class="{hash:true,caps:false} form-control" type="text" name="newcontent" placeholder="New heading text" id="<?= $this->e($item_id); ?>-input">
2324
<label><input class="remove-heading" type="checkbox" />&nbsp;Delete this Header completely instead</label><br />
2425
<button class="submit-content inactive btn btn-default" type="submit">Submit</button>
2526
</div>

templates/partials/result_item/image_alt.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
*/
2020
?>
2121
<div class="fix-alt input-group">
22+
<label for="<?= $this->e($item_id); ?>-input" class="control-label sr-only">Provide New Alt Text For This Image</label>
2223
<span class="counter">100</span>
23-
<input class="form-control" type="text" name="newcontent" maxlength="100" placeholder="New alt text">
24+
<input class="form-control" type="text" name="newcontent" maxlength="100" placeholder="New alt text" id="<?= $this->e($item_id); ?>-input">
2425
<span class="input-group-btn">
2526
<button class="submit-content inactive btn btn-default" type="submit">Submit</button>
2627
</span>

templates/partials/result_item/link.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
*/
2020
?>
2121
<div class="form-group no-margin margin-bottom">
22-
<input class="{hash:true,caps:false} form-control" type="text" name="newcontent" placeholder="New link text">
22+
<label for="<?= $this->e($item_id); ?>-input" class="control-label sr-only">Enter New Text for This Link</label>
23+
<input class="{hash:true,caps:false} form-control" type="text" name="newcontent" placeholder="New link text" id="<?= $this->e($item_id); ?>-input">
2324
<label><input class="remove-link" type="checkbox" />Delete this Link completely instead</label><br />
2425
<button class="submit-content inactive btn btn-default" type="submit">Submit</button>
2526
</div>

templates/partials/result_item/link_text.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
*/
2020
?>
2121
<div class="form-group no-margin margin-bottom">
22-
<input class="{hash:true,caps:false} form-control" type="text" name="newcontent" placeholder="New link text">
22+
<label for="<?= $this->e($item_id); ?>-input" class="control-label sr-only">Enter New Text for This Link</label>
23+
<input class="{hash:true,caps:false} form-control" type="text" name="newcontent" placeholder="New link text" id="<?= $this->e($item_id); ?>-input">
2324
<label><input class="remove-link" type="checkbox" />&nbsp;Delete this Link completely instead</label><br />
2425
<button class="submit-content inactive btn btn-default" type="submit">Submit</button>
2526
</div>

templates/partials/result_item/suspicious_link_text.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
*/
2020
?>
2121
<div class="input-group">
22-
<input class="form-control" type="text" name="newcontent" placeholder="New link description">
22+
<label for="<?= $this->e($item_id); ?>-input" class="control-label sr-only">Enter a New Description for This Link</label>
23+
<input class="form-control" type="text" name="newcontent" placeholder="New link description" id="<?= $this->e($item_id); ?>">
2324
<span class="input-group-btn">
2425
<button class="submit-content inactive btn btn-default" type="submit">Submit</button>
2526
</span>

templates/partials/result_item/table_header.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
*/
2020
?>
2121
<hr>
22-
<p>Select which part of the table to convert to a header</p>
2322
<div class="input-group">
24-
<select class="form-control" name="newcontent">
23+
<label for="<?= $this->e($item_id); ?>-input" class="control-label sr-only">Select which part of the table to convert to a header</label>
24+
<select class="form-control" name="newcontent" id="<?= $this->e($item_id); ?>-input">
2525
<option value="row">The first row</option>
2626
<option value="col">The first column</option>
2727
<option value="both">Both the first row and column</option>

templates/partials/result_item/table_header_scope.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
* Primary Author Contact: Jacob Bates <jacob.bates@ucf.edu>
1919
*/
2020
?>
21+
<label for="<?= $this->e($item_id); ?>-input" class="control-label sr-only">Select which part of the table to convert to a header</label>
2122
<div class="input-group">
22-
<select class="form-control" name="newcontent">
23+
<select class="form-control" name="newcontent" id="<?= $this->e($item_id); ?>-input">
2324
<option value="col">col</option>
2425
<option value="row">row</option>
2526
</select>

templates/partials/results_items.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
}
146146

147147
if ( ! empty($result_template)) {
148-
echo($this->fetch("partials/result_item/{$result_template}", ['group_item' => $group_item]));
148+
echo($this->fetch("partials/result_item/{$result_template}", ['group_item' => $group_item, 'item_id' => $li_id]));
149149
}
150150
?>
151151
</form>

0 commit comments

Comments
 (0)