Skip to content
Snippets Groups Projects
Commit 41fc9af3 authored by André Lahmann's avatar André Lahmann
Browse files

refs #8733:

* added context specific content to ILS-Offline messages
parent 9076fc7c
No related merge requests found
...@@ -283,9 +283,16 @@ class AjaxController extends \VuFind\Controller\AjaxController ...@@ -283,9 +283,16 @@ class AjaxController extends \VuFind\Controller\AjaxController
protected function getIlsStatusAjax() protected function getIlsStatusAjax()
{ {
$this->disableSessionWrites(); // avoid session write timing bug $this->disableSessionWrites(); // avoid session write timing bug
$offlineModeMsg = $this->params()->fromPost(
'offlineModeMsg',
$this->params()->fromQuery('offlineModeMsg')
);
if ($this->getILS()->getOfflineMode() == 'ils-offline') { if ($this->getILS()->getOfflineMode() == 'ils-offline') {
return $this->output( return $this->output(
$this->getViewRenderer()->render('Helpers/ils-offline.phtml'), $this->getViewRenderer()->render(
'Helpers/ils-offline.phtml',
['offlineModeMsg' => $offlineModeMsg]
),
self::STATUS_OK self::STATUS_OK
); );
} }
......
<div data-alert class="alert-box warning" tabindex="0" aria-live="assertive" role="dialogalert"> <div data-alert class="alert-box warning" tabindex="0" aria-live="assertive" role="dialogalert">
<h2><?=$this->transEsc('ils_offline_title')?></h2> <h2><?=$this->transEsc('ils_offline_title')?></h2>
<p><strong><?=$this->transEsc('ils_offline_status')?></strong></p> <p><strong><?=$this->transEsc('ils_offline_status')?></strong></p>
<p><?=$this->transEsc('ils_offline_home_message')?></p> <p><?=$this->transEsc($this->offlineModeMsg)?></p>
<? $supportEmail = $this->escapeHtmlAttr($this->systemEmail()); ?> <? $supportEmail = $this->escapeHtmlAttr($this->systemEmail()); ?>
<p><a href="mailto:<?=$supportEmail?>"><?=$supportEmail?></a></p> <p><a href="mailto:<?=$supportEmail?>"><?=$supportEmail?></a></p>
</div> </div>
\ No newline at end of file
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', array('user' => $this->auth()->isLoggedIn())); ?> <?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', array('user' => $this->auth()->isLoggedIn())); ?>
<?=($offlineMode == "ils-offline") ? $this->render('Helpers/ils-offline.phtml') : ''?> <?=($offlineMode == "ils-offline") ? $this->render('Helpers/ils-offline.phtml', ['offlineModeMsg' => 'ils_offline_holdings_message']) : ''?>
<? if (($this->ils()->getHoldsMode() == 'driver' && !empty($holdings)) || $this->ils()->getTitleHoldsMode() == 'driver'): ?> <? if (($this->ils()->getHoldsMode() == 'driver' && !empty($holdings)) || $this->ils()->getTitleHoldsMode() == 'driver'): ?>
<? if ($account->loginEnabled() && $offlineMode != 'ils-offline'): ?> <? if ($account->loginEnabled() && $offlineMode != 'ils-offline'): ?>
<? if (!$user): ?> <? if (!$user): ?>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
$offlineMode = $this->ils()->getOfflineMode(); $offlineMode = $this->ils()->getOfflineMode();
?> ?>
<? if ($offlineMode == "ils-offline"): ?> <? if ($offlineMode == "ils-offline"): ?>
<?=$this->render('Helpers/ils-offline.phtml')?> <?=$this->render('Helpers/ils-offline.phtml', ['offlineModeMsg' => 'ils_offline_login_message'])?>
<? else: ?> <? else: ?>
<h3><?=$this->transEsc('Library Catalog Profile')?></h3> <h3><?=$this->transEsc('Library Catalog Profile')?></h3>
<?=$this->flashmessages()?> <?=$this->flashmessages()?>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
?> ?>
<? if ($offlineMode == "ils-offline"): ?> <? if ($offlineMode == "ils-offline"): ?>
<?=$this->render('Helpers/ils-offline.phtml')?> <?=$this->render('Helpers/ils-offline.phtml', ['offlineModeMsg' => 'ils_offline_login_message'])?>
<? else: ?> <? else: ?>
<h2><?=$this->transEsc('Login')?></h2> <h2><?=$this->transEsc('Login')?></h2>
<?=$this->flashmessages()?> <?=$this->flashmessages()?>
......
...@@ -26,6 +26,7 @@ $this->layout()->breadcrumbs = false; ...@@ -26,6 +26,7 @@ $this->layout()->breadcrumbs = false;
$.ajax({ $.ajax({
dataType: 'json', dataType: 'json',
method: 'GET', method: 'GET',
data: {'offlineModeMsg':'ils_offline_home_message'},
url: VuFind.path + '/AJAX/JSON?method=getIlsStatus', url: VuFind.path + '/AJAX/JSON?method=getIlsStatus',
success: function(response) { success: function(response) {
$('.searchHomeContent').append(response.data); $('.searchHomeContent').append(response.data);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment