diff --git a/themes/finc/templates/search/history.phtml b/themes/finc/templates/search/history.phtml index d1716c94b490647267c1b64d1e9a79b576aaac64..a5888f90d8aad80b74c98d2000787b907c7578eb 100644 --- a/themes/finc/templates/search/history.phtml +++ b/themes/finc/templates/search/history.phtml @@ -1,22 +1,36 @@ <!-- 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 // Set page title. $this->headTitle($this->translate('Search History')); - // finc: handle disable account capabilities - $loginEnabled = is_object($account = $this->auth()->getManager()) && $account->loginEnabled(); +$saveSupported = $this->accountCapabilities()->getSavedSearchSetting() === 'enabled'; +$isLoggedIn = $this->auth()->isLoggedIn(); // Set up breadcrumbs: - // finc: check for $loginEnabled - $this->layout()->breadcrumbs = ($loginEnabled ? '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li>' + // finc: check for $isLoggedIn + $this->layout()->breadcrumbs = ( + $isLoggedIn ? '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li>' : '') . '<li class="active">' . $this->transEsc('History') . '</li>'; - - $saveSupported = $this->accountCapabilities()->getSavedSearchSetting() === 'enabled'; ?> <div class="<?=$this->layoutClass('mainbody')?>"> - <?php /* finc: show only when if $saveSupported */ ?> - <?php if ($saveSupported): ?> + <?php /* finc: show offcanvas-toggler and profile-menu only when if $isLoggedIn */ ?> + <?php if ($isLoggedIn): ?> <?=$this->render('RecordDriver/DefaultRecord/offcanvas-toggler-myresearch'); ?> <?php endif; ?> @@ -27,7 +41,7 @@ (<a href="<?=$this->url('myresearch-profile');?>"><?=$this->transEsc("edit");?></a>) <?php endif; ?> </div> - <?php elseif (!empty($this->schedule) && $this->auth()->isLoggedIn()): ?> + <?php elseif (!empty($this->schedule) && $isLoggedIn): ?> <div class="alert alert-danger alert-email-notification"> <?=$this->transEsc("no_email_address") . ' ';?><a href="<?=$this->url('myresearch-profile');?>"><?=$this->transEsc("check_profile");?></a> </div> @@ -49,12 +63,13 @@ <?php endif; ?> </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"> <?=$this->context($this)->renderInContext( "myresearch/menu.phtml", - // Only activate search history in account menu if user is logged in. - $this->auth()->isLoggedIn() ? ['active' => 'history'] : [] + // apply active highlighting in profile-menu + ['active' => 'history'] ); ?> </div>