Skip to content
Snippets Groups Projects
Commit e1713883 authored by Alexander Purr's avatar Alexander Purr Committed by Robert Lange
Browse files

refs #22938 [finc] search history: more consistent behavior

* not logged in:
** don't show offcancas-toggler and profile menu
** breadcrumb like: Home -> History
* logged in:
** show offcancas-toggler and profile menu
** breadcrumb like: Home -> My Account -> History
parent 10fee245
No related merge requests found
<!-- finc - templates - search - history --> <!-- finc - templates - search - history -->
<?php
/**
origin: vufind
called by view helper/controller: --
usage: (saved) search history
modified for finc: special finc behavior:
* not logged in:
** don't show offcancas-toggler and profile menu
** breadcrumb like: Home -> History
* logged in:
** show offcancas-toggler and profile menu
** breadcrumb like: Home -> My Account -> History
configured in: --
*/
?>
<?php <?php
// Set page title. // Set page title.
$this->headTitle($this->translate('Search History')); $this->headTitle($this->translate('Search History'));
// finc: handle disable account capabilities $saveSupported = $this->accountCapabilities()->getSavedSearchSetting() === 'enabled';
$loginEnabled = is_object($account = $this->auth()->getManager()) && $account->loginEnabled(); $isLoggedIn = $this->auth()->isLoggedIn();
// Set up breadcrumbs: // Set up breadcrumbs:
// finc: check for $loginEnabled // finc: check for $isLoggedIn
$this->layout()->breadcrumbs = ($loginEnabled ? '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li>' $this->layout()->breadcrumbs = (
$isLoggedIn ? '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li>'
: '') . '<li class="active">' . $this->transEsc('History') . '</li>'; : '') . '<li class="active">' . $this->transEsc('History') . '</li>';
$saveSupported = $this->accountCapabilities()->getSavedSearchSetting() === 'enabled';
?> ?>
<div class="<?=$this->layoutClass('mainbody')?>"> <div class="<?=$this->layoutClass('mainbody')?>">
<?php /* finc: show only when if $saveSupported */ ?> <?php /* finc: show offcanvas-toggler and profile-menu only when if $isLoggedIn */ ?>
<?php if ($saveSupported): ?> <?php if ($isLoggedIn): ?>
<?=$this->render('RecordDriver/DefaultRecord/offcanvas-toggler-myresearch'); ?> <?=$this->render('RecordDriver/DefaultRecord/offcanvas-toggler-myresearch'); ?>
<?php endif; ?> <?php endif; ?>
...@@ -27,7 +41,7 @@ ...@@ -27,7 +41,7 @@
(<a href="<?=$this->url('myresearch-profile');?>"><?=$this->transEsc("edit");?></a>) (<a href="<?=$this->url('myresearch-profile');?>"><?=$this->transEsc("edit");?></a>)
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php elseif (!empty($this->schedule) && $this->auth()->isLoggedIn()): ?> <?php elseif (!empty($this->schedule) && $isLoggedIn): ?>
<div class="alert alert-danger alert-email-notification"> <div class="alert alert-danger alert-email-notification">
<?=$this->transEsc("no_email_address") . ' ';?><a href="<?=$this->url('myresearch-profile');?>"><?=$this->transEsc("check_profile");?></a> <?=$this->transEsc("no_email_address") . ' ';?><a href="<?=$this->url('myresearch-profile');?>"><?=$this->transEsc("check_profile");?></a>
</div> </div>
...@@ -49,12 +63,13 @@ ...@@ -49,12 +63,13 @@
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php if ($saveSupported): ?> <?php /* finc: show offcanvas-toggler and profile-menu only if $isLoggedIn */ ?>
<?php if ($isLoggedIn): ?>
<div class="<?=$this->layoutClass('sidebar')?>" id="myresearch-sidebar"> <div class="<?=$this->layoutClass('sidebar')?>" id="myresearch-sidebar">
<?=$this->context($this)->renderInContext( <?=$this->context($this)->renderInContext(
"myresearch/menu.phtml", "myresearch/menu.phtml",
// Only activate search history in account menu if user is logged in. // apply active highlighting in profile-menu
$this->auth()->isLoggedIn() ? ['active' => 'history'] : [] ['active' => 'history']
); );
?> ?>
</div> </div>
......
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