diff --git a/module/finc/src/finc/View/Helper/Root/Flashmessages.php b/module/finc/src/finc/View/Helper/Root/Flashmessages.php index 1b099d258b2ac6056d4c5f7c0706a8efb742528f..c26fbb8288ac275b56259037cc28f61869a73fb5 100644 --- a/module/finc/src/finc/View/Helper/Root/Flashmessages.php +++ b/module/finc/src/finc/View/Helper/Root/Flashmessages.php @@ -39,8 +39,8 @@ namespace finc\View\Helper\Root; class Flashmessages extends \VuFind\View\Helper\Bootstrap3\Flashmessages { /** - * Generate flash message <p>'s with appropriate classes based on message type. - * This is basically a copy of the parent method but uses p-Tags instead of divs + * Generate flash message <div>'s with appropriate classes based on message type. + * This is basically a copy of the parent method but adds role = alert to divs * * @return string $html */ @@ -53,14 +53,14 @@ class Flashmessages extends \VuFind\View\Helper\Bootstrap3\Flashmessages $this->fm->getMessages($ns), $this->fm->getCurrentMessages($ns) ); foreach (array_unique($messages, SORT_REGULAR) as $msg) { - $html .= '<p class="' . $this->getClassForNamespace($ns) . '"'; + $html .= '<div class="' . $this->getClassForNamespace($ns) . '"'; if (isset($msg['dataset'])) { foreach ($msg['dataset'] as $attr => $value) { $html .= ' data-' . $attr . '="' . htmlspecialchars($value) . '"'; } } - $html .= '>'; + $html .= ' role="alert">'; // Advanced form: if (is_array($msg)) { // Use a different translate helper depending on whether @@ -83,7 +83,7 @@ class Flashmessages extends \VuFind\View\Helper\Bootstrap3\Flashmessages $transEsc = $this->getView()->plugin('transEsc'); $html .= $transEsc($msg); } - $html .= '</p>'; + $html .= '</div>'; } $this->fm->clearMessages($ns); $this->fm->clearCurrentMessages($ns); diff --git a/themes/finc-accessibility/templates/Recommend/AlphaBrowseLink.phtml b/themes/finc-accessibility/templates/Recommend/AlphaBrowseLink.phtml index 6c3f63c4b61fab76fef821b2b1b8d4f9fbcb35a4..8d7fc91cc4c775c9d19045d2361d7e4c22b9ae69 100644 --- a/themes/finc-accessibility/templates/Recommend/AlphaBrowseLink.phtml +++ b/themes/finc-accessibility/templates/Recommend/AlphaBrowseLink.phtml @@ -14,5 +14,5 @@ ] ); ?> -<p class="alert alert-info"><?=$link?></p> +<p class="alert alert-info" role="alert"><?=$link?></p> <!-- finc-accessibility: Recommend - AlphaBrowseLink - END --> diff --git a/themes/finc-accessibility/templates/Recommend/Channels.phtml b/themes/finc-accessibility/templates/Recommend/Channels.phtml index 10710cbd4018d93ad48304cd973dca02d7bcf16a..9ea450e3ed1056f39a5a9eebb1616a27140dcba3 100644 --- a/themes/finc-accessibility/templates/Recommend/Channels.phtml +++ b/themes/finc-accessibility/templates/Recommend/Channels.phtml @@ -7,7 +7,7 @@ . $results->getUrlQuery()->getParams(false) . '&source=' . urlencode($results->getParams()->getSearchClassId()); ?> -<p class="channels-alert alert alert-info"> +<p class="channels-alert alert alert-info" role="alert"> <a href="<?=$this->escapeHtmlAttr($link)?>"><?=$this->transEsc('channel_expand')?></a> </p> <!-- finc-accessibility: Recommend - Channels - END --> diff --git a/themes/finc-accessibility/templates/Recommend/DOI.phtml b/themes/finc-accessibility/templates/Recommend/DOI.phtml index 0a20a62a35e08cb2eaf590fb0199514e022c1384..d39d99a2e6cc32115663df33cc0dd5747cae4d80 100644 --- a/themes/finc-accessibility/templates/Recommend/DOI.phtml +++ b/themes/finc-accessibility/templates/Recommend/DOI.phtml @@ -3,7 +3,7 @@ <?php $doi = $this->recommend->getDOI(); if (!empty($doi)): ?> <?php $url = $this->recommend->getURL(); ?> - <p class="alert alert-info"> + <p class="alert alert-info" role="alert"> <?=$this->translate('doi_detected_html', ['%%url%%' => $url, '%%doi%%' => $doi])?> </p> <?php if ($this->recommend->isFullMatch()): ?> diff --git a/themes/finc-accessibility/templates/Recommend/RemoveFilters.phtml b/themes/finc-accessibility/templates/Recommend/RemoveFilters.phtml index c79a65f63ca767b0ff7333209e7ac8624dbe71b9..07f915a551d4bf3f16dec7ae90ec717809d2883c 100644 --- a/themes/finc-accessibility/templates/Recommend/RemoveFilters.phtml +++ b/themes/finc-accessibility/templates/Recommend/RemoveFilters.phtml @@ -2,7 +2,7 @@ <?php /* #17950 - use <p> for alerts - HR */ ?> <?php if ($this->recommend->hasFilters()): ?> - <p class="alert alert-info"> + <p class="alert alert-info" role="alert"> <?=$this->transEsc('nohit_active_filters')?> <a href="<?=$this->recommend->getFilterlessUrl()?>"><?=$this->transEsc('nohit_query_without_filters')?></a> </p> diff --git a/themes/finc-accessibility/templates/Recommend/SwitchType.phtml b/themes/finc-accessibility/templates/Recommend/SwitchType.phtml index c44dc55b6b04da6d8e3fd71da4d8501f47b8fadf..9276727ecdf680fa8c1b7cb6629c34f6ba34778e 100644 --- a/themes/finc-accessibility/templates/Recommend/SwitchType.phtml +++ b/themes/finc-accessibility/templates/Recommend/SwitchType.phtml @@ -2,7 +2,7 @@ <?php /* #17950 - use <p> for alerts - HR */ ?> <?php if ($handler = $this->recommend->getNewHandler()): ?> - <p class="alert alert-info"> + <p class="alert alert-info" role="alert" role="alert"> <?=$this->transEsc('widen_prefix')?> <a href="<?=$this->recommend->getResults()->getUrlQuery()->setHandler($handler)?>"><?=$this->transEsc($this->recommend->getNewHandlerName())?></a>. </p> diff --git a/themes/finc-accessibility/templates/RecordDriver/EDS/result-list.phtml b/themes/finc-accessibility/templates/RecordDriver/EDS/result-list.phtml index d65ddb57d0e14cf38e6911fafdc8e393755d7fb3..85fe0b87f756cfa88da36c26aec682a378cc9967 100644 --- a/themes/finc-accessibility/templates/RecordDriver/EDS/result-list.phtml +++ b/themes/finc-accessibility/templates/RecordDriver/EDS/result-list.phtml @@ -118,7 +118,7 @@ <i class="fa fa-fw fa-star" aria-hidden="true"></i> <a href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" class="save-record" data-lightbox id="<?=$this->driver->getUniqueId() ?>" title="<?=$this->transEsc('Add to favorites')?>"><?=$this->transEsc('Add to favorites')?></a><br/> <?php /* Saved lists */ ?> - <p class="savedLists alert alert-info hidden"> + <p class="savedLists alert alert-info hidden" role="alert"> <strong><?=$this->transEsc("Saved in")?>:</strong> </p> <?php endif; ?> diff --git a/themes/finc-accessibility/templates/Related/Channels.phtml b/themes/finc-accessibility/templates/Related/Channels.phtml index 04f65247244c0ea79f6b2872dbfe1a73ec3368f9..5b5abb0465820528c50343ab7aad9fa33b6526c6 100644 --- a/themes/finc-accessibility/templates/Related/Channels.phtml +++ b/themes/finc-accessibility/templates/Related/Channels.phtml @@ -7,7 +7,7 @@ . '?id=' . urlencode($driver->getUniqueId()) . '&source=' . urlencode($driver->getSourceIdentifier()); ?> -<p class="channels-alert alert alert-info"> +<p class="channels-alert alert alert-info" role="alert"> <a href="<?=$this->escapeHtmlAttr($link)?>"><?=$this->transEsc('channel_expand')?></a> </p> <!-- finc-accessibility: Related - Channels - END --> diff --git a/themes/finc-accessibility/templates/myresearch/delete.phtml b/themes/finc-accessibility/templates/myresearch/delete.phtml index 19fc345724ecabbc95f7602577310e30e2be84f4..aeb2c39b4b64b8759d3c88c1df86a5bd96292a15 100644 --- a/themes/finc-accessibility/templates/myresearch/delete.phtml +++ b/themes/finc-accessibility/templates/myresearch/delete.phtml @@ -7,7 +7,7 @@ <div id="popupMessages"><?=$this->flashmessages()?></div> <div id="popupDetails"> <?php if (!$this->list): ?> - <p class="alert alert-info"><?=$this->transEsc("fav_delete_warn") ?></p> + <p class="alert alert-info" role="alert"><?=$this->transEsc("fav_delete_warn") ?></p> <?php else: ?> <h2><?=$this->transEsc("List") ?>: <?=$this->escapeHtml($this->list->title) ?></h2> <?php endif; ?> diff --git a/themes/finc-accessibility/templates/myresearch/login.phtml b/themes/finc-accessibility/templates/myresearch/login.phtml index 5bf1facad28941ca265940bc867cf9cd8d4841c9..f7d5f80479408229447b485f1b3b0056d30a18c3 100644 --- a/themes/finc-accessibility/templates/myresearch/login.phtml +++ b/themes/finc-accessibility/templates/myresearch/login.phtml @@ -22,7 +22,7 @@ <?=$this->flashmessages()?> <?php if ($hideLogin): ?> - <p class="alert alert-danger"><?=$this->transEsc('login_disabled')?></p> + <p class="alert alert-danger" role="alert"><?=$this->transEsc('login_disabled')?></p> <?php else: ?> <?=$this->auth()->getLogin()?> <?php endif; ?> diff --git a/themes/finc-accessibility/templates/record/comments-list.phtml b/themes/finc-accessibility/templates/record/comments-list.phtml index 66b90c54bb8dfd790243408f195f0f0c04471309..fa892bbad12807b77f5528e057e0e19c6e5e8e69 100644 --- a/themes/finc-accessibility/templates/record/comments-list.phtml +++ b/themes/finc-accessibility/templates/record/comments-list.phtml @@ -1,7 +1,7 @@ <!-- finc-accessibility: record - comments-list --> <?php $comments = $this->driver->getComments(); ?> <?php if (empty($comments) || count($comments) == 0): ?> - <p class="alert alert-info"><?=$this->transEsc('Be the first to leave a comment')?>!</p> + <p class="alert alert-info" role="alert"><?=$this->transEsc('Be the first to leave a comment')?>!</p> <?php else: ?> <?php foreach ($comments as $comment): ?> <div class="comment"> diff --git a/themes/finc/js/lightbox.js b/themes/finc/js/lightbox.js index 50e34faa90b8204e93fa5c5085a02bde4186a5bb..ecd9155acd7e7952e7780678724aced2b96168cf 100644 --- a/themes/finc/js/lightbox.js +++ b/themes/finc/js/lightbox.js @@ -42,7 +42,7 @@ VuFind.register('lightbox', function Lightbox() { // Public: Present an alert function showAlert(message, _type) { var type = _type || 'info'; - _html('<p class="flash-message alert alert-' + type + '">' + message + '</p>' + _html('<div class="flash-message alert alert-' + type + '" role="alert">' + message + '</div>' + '<button class="btn btn-default" data-dismiss="modal">' + VuFind.translate('close') + '</button>'); _modal.modal('show'); } @@ -50,7 +50,7 @@ VuFind.register('lightbox', function Lightbox() { var type = _type || 'info'; _modalBody.find('.flash-message,.fa.fa-spinner').remove(); _modalBody.find('h2:first-of-type') - .after('<p class="flash-message alert alert-' + type + '">' + message + '</p>'); + .after('<div class="flash-message alert alert-' + type + '" role="alert">' + message + '</div>'); } function close() { _modal.modal('hide'); diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/collection-info.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/collection-info.phtml index fcd4bba892f0c6b2d12ea9b1414a3ad4f49a056b..9a632703f394087e73e9d4c8dc200cdaf71855c6 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/collection-info.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/collection-info.phtml @@ -34,7 +34,7 @@ <?php endif; ?> <?php /* Display the lists that this record is saved to */ ?> - <p class="savedLists hidden alert alert-info" id="savedLists"> + <p class="savedLists hidden alert alert-info" id="savedLists" role="alert"> <strong><?=$this->transEsc("Saved in")?>:</strong> </p> diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml index 36660cc5e396252fc74e6434b0e0fd971fcc63e4..f1f15d36742fa45d55e1099415c7c04ebcdea050 100644 --- a/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml +++ b/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml @@ -216,7 +216,7 @@ $i = 0; <?=$block?> <?php endif; ?> <?php /* Saved lists */ ?> - <p class="savedLists alert alert-info hidden"> + <p class="savedLists alert alert-info hidden" role="alert"> <strong><?=$this->transEsc("Saved in")?>:</strong> </p> <?php endif; ?>