Skip to content

Commit

Permalink
refs vufind-org#2999 keep prefix in context and set checkboxElementId…
Browse files Browse the repository at this point in the history
… in checkbox.phtml
  • Loading branch information
RLangeUni committed Apr 18, 2024
1 parent 3dd8446 commit 22e7630
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions module/VuFind/src/VuFind/View/Helper/Root/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,9 @@ public function getCheckbox($idPrefix = '', $formAttr = false, $number = null)
{
$context = compact('number') + [
'id' => $this->getUniqueIdWithSourcePrefix(),
'checkboxElementId' => $this->getUniqueHtmlElementId($idPrefix)
];
'checkboxElementId' => $this->getUniqueHtmlElementId($idPrefix),
'prefix' => $idPrefix
];
if ($formAttr) {
$context['formAttr'] = $formAttr;
}
Expand Down
2 changes: 1 addition & 1 deletion themes/bootstrap3/templates/record/checkbox.phtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<label class="record-checkbox hidden-print">
<input class="checkbox-select-item" type="checkbox" name="ids[]" value="<?=$this->escapeHtmlAttr($this->id) ?>"<?php if (isset($this->formAttr)): ?> form="<?=$this->formAttr ?>"<?php endif; ?> aria-label="<?=$this->transEscAttr('select_item')?>">
<input <?php if (isset($this->checkboxElementId)): ?>id="<?=$this->checkboxElementId ?>"<?php endif; ?> class="checkbox-select-item" type="checkbox" name="ids[]" value="<?=$this->escapeHtmlAttr($this->id) ?>"<?php if (isset($this->formAttr)): ?> form="<?=$this->formAttr ?>"<?php endif; ?> aria-label="<?=$this->transEscAttr('select_item')?>">
<span class="checkbox-icon"></span>
<?php if (strlen($this->number ?? '') > 0): ?><span class="sr-only"><?=$this->transEsc('result_checkbox_label', ['%%number%%' => $this->number]) ?></span><?php endif; ?>
</label>
Expand Down

0 comments on commit 22e7630

Please sign in to comment.