Skip to content

Commit

Permalink
Discussion changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rominail committed Jul 29, 2024
1 parent eca95d7 commit a4bfd84
Show file tree
Hide file tree
Showing 3 changed files with 203 additions and 216 deletions.
1 change: 0 additions & 1 deletion module/VuFind/src/VuFind/Controller/AbstractRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

namespace VuFind\Controller;

use Exception;
use VuFind\Db\Service\UserListServiceInterface;
use VuFind\Db\Service\UserResourceServiceInterface;
use VuFind\Exception\BadRequest as BadRequestException;
Expand Down
207 changes: 101 additions & 106 deletions themes/bootstrap3/templates/header.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,124 +4,119 @@ $account = $this->auth()->getManager();
?>
<div class="banner container navbar">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#header-collapse"
aria-label="<?= $this->transEscAttr('mobile_toggle_navigation_text') ?>">
<?= $this->icon('ui-menu') ?>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#header-collapse" aria-label="<?=$this->transEscAttr('mobile_toggle_navigation_text')?>">
<?=$this->icon('ui-menu') ?>
</button>
<a class="navbar-brand lang-<?= $this->layout()->userLang ?>" href="<?= $this->url('home') ?>">VuFind</a>
<a class="navbar-brand lang-<?=$this->layout()->userLang ?>" href="<?=$this->url('home')?>">VuFind</a>
</div>
<?php if (!isset($this->layout()->renderingError)): ?>
<div class="collapse navbar-collapse" id="header-collapse">
<nav>
<ul class="nav navbar-nav navbar-right flip">
<?php if ($this->feedback()->tabEnabled()): ?>
<li>
<a class="icon-link" id="feedbackLink" data-lightbox href="<?= $this->url('feedback-home') ?>">
<?= $this->icon('feedback', 'icon-link__icon') ?>
<span class="icon-link__label"><?= $this->transEsc('Feedback') ?></span>
</a>
</li>
<?php endif; ?>
<?php $cart = $this->cart(); ?>
<?php if ($cart->isActive()): ?>
<li id="cartSummary" aria-live="polite" aria-atomic="true">
<a id="cartItems" class="icon-link" data-lightbox title="<?= $this->transEscAttr('View Book Bag') ?>"
href="<?= $this->url('cart-home') ?>">
<?= $this->icon('cart', 'icon-link__icon') ?>
<span class="icon-link__label">
<span class="sr-only"><?= $this->transEsc('Book Bag') ?>:</span>
<span
role="status"><strong><?= count($cart->getItems()) ?></strong> <?= $this->transEsc('items') ?></span>
<span
class="full<?= !$cart->isFull() ? ' hidden' : '' ?>">(<?= $this->transEsc('bookbag_full') ?>)</span>
<?php if (!isset($this->layout()->renderingError)): ?>
<div class="collapse navbar-collapse" id="header-collapse">
<nav>
<ul class="nav navbar-nav navbar-right flip">
<?php if ($this->feedback()->tabEnabled()): ?>
<li>
<a class="icon-link" id="feedbackLink" data-lightbox href="<?=$this->url('feedback-home') ?>">
<?=$this->icon('feedback', 'icon-link__icon') ?>
<span class="icon-link__label"><?=$this->transEsc('Feedback')?></span>
</a>
</li>
<?php endif; ?>
<?php $cart = $this->cart(); ?>
<?php if ($cart->isActive()): ?>
<li id="cartSummary" aria-live="polite" aria-atomic="true">
<a id="cartItems" class="icon-link" data-lightbox title="<?=$this->transEscAttr('View Book Bag')?>" href="<?=$this->url('cart-home')?>">
<?=$this->icon('cart', 'icon-link__icon') ?>
<span class="icon-link__label">
<span class="sr-only"><?=$this->transEsc('Book Bag')?>:</span>
<span role="status"><strong><?=count($cart->getItems())?></strong> <?=$this->transEsc('items')?></span>
<span class="full<?=!$cart->isFull() ? ' hidden' : '' ?>">(<?=$this->transEsc('bookbag_full') ?>)</span>
</span>
</a>
</a>
</li>
<?php endif; ?>
<?php if (is_object($account) && $account->loginEnabled()): // hide login/logout if unavailable ?>
<?php if ($account->getIdentity()): ?>
<li class="logoutOptions<?php if ($account->dropdownEnabled()): ?> with-dropdown<?php endif ?>">
<a href="<?=$this->url('myresearch-home', [], ['query' => ['redirect' => 0]])?>" class="icon-link">
<span id="account-icon" class="icon-link__icon"><?=$this->icon('my-account') ?></span>
<span class="icon-link__label"><?=$this->transEsc('Your Account')?></span>
</a>
</li>
<?php if ($account->dropdownEnabled()): ?>
<li id="login-dropdown" class="dropdown hidden-xs">
<a href="#" data-toggle="dropdown"><?=$this->icon('dropdown-caret') ?></a>
<div class="dropdown-menu">
<?=$this->accountMenu()->render('', 'header_')?>
</div>
</li>
<?php endif; ?>
<?php if (is_object($account) && $account->loginEnabled()): // hide login/logout if unavailable ?>
<?php if ($account->getIdentity()): ?>
<li class="logoutOptions<?php if ($account->dropdownEnabled()): ?> with-dropdown<?php endif ?>">
<a href="<?= $this->url('myresearch-home', [], ['query' => ['redirect' => 0]]) ?>"
class="icon-link">
<span id="account-icon" class="icon-link__icon"><?= $this->icon('my-account') ?></span>
<span class="icon-link__label"><?= $this->transEsc('Your Account') ?></span>
</a>
</li>
<?php if ($account->dropdownEnabled()): ?>
<li id="login-dropdown" class="dropdown hidden-xs">
<a href="#" data-toggle="dropdown"><?= $this->icon('dropdown-caret') ?></a>
<div class="dropdown-menu">
<?= $this->accountMenu()->render('', 'header_') ?>
</div>
</li>
<?php endif; ?>
<li class="logoutOptions">
<a href="<?= $this->url('myresearch-logout') ?>" class="logout icon-link">
<?= $this->icon('sign-out', 'icon-link__icon') ?>
<span class="icon-link__label"><?= $this->transEsc('Log Out') ?></span>
</a>
</li>
<?php else: ?>
<li id="loginOptions">
<?php if ($account->getSessionInitiator($this->serverUrl($this->url('myresearch-home')))): ?>
<a href="<?= $this->url('myresearch-userlogin') ?>" class="icon-link">
<?= $this->icon('sign-in', 'icon-link__icon') ?>
<span class="icon-link__label"><?= $this->transEsc('Institutional Login') ?></span>
</a>
<?php else: ?>
<a href="<?= $this->url('myresearch-userlogin') ?>" class="icon-link" data-lightbox>
<?= $this->icon('sign-in', 'icon-link__icon') ?>
<span class="icon-link__label"><?= $this->transEsc('Login') ?></span>
</a>
<?php endif; ?>
</li>
<?php endif; ?>
<?php endif; ?>
<li class="logoutOptions">
<a href="<?=$this->url('myresearch-logout')?>" class="logout icon-link">
<?=$this->icon('sign-out', 'icon-link__icon') ?>
<span class="icon-link__label"><?=$this->transEsc('Log Out')?></span>
</a>
</li>
<?php else: ?>
<li id="loginOptions">
<?php if ($account->getSessionInitiator($this->serverUrl($this->url('myresearch-home')))): ?>
<a href="<?=$this->url('myresearch-userlogin')?>" class="icon-link">
<?=$this->icon('sign-in', 'icon-link__icon') ?>
<span class="icon-link__label"><?=$this->transEsc('Institutional Login')?></span>
</a>
<?php else: ?>
<a href="<?=$this->url('myresearch-userlogin')?>" class="icon-link" data-lightbox>
<?=$this->icon('sign-in', 'icon-link__icon') ?>
<span class="icon-link__label"><?=$this->transEsc('Login')?></span>
</a>
<?php endif; ?>
</li>
<?php endif; ?>
<?php endif; ?>

<?php if (isset($this->layout()->themeOptions) && count($this->layout()->themeOptions) > 1): ?>
<?= $this->component('menu-button', [
'toggleLabel' => 'Theme',
'wrapperClass' => 'theme-selector',
'wrapperTag' => 'li',
'menuItems' => array_map(
function ($item) {
$item['label'] = $item['desc'];
$item['url'] = $this->url()->addQueryParameters(['ui' => $item['name']]);
<?php if (isset($this->layout()->themeOptions) && count($this->layout()->themeOptions) > 1): ?>
<?=$this->component('menu-button', [
'toggleLabel' => 'Theme',
'wrapperClass' => 'theme-selector',
'wrapperTag' => 'li',
'menuItems' => array_map(
function ($item) {
$item['label'] = $item['desc'];
$item['url'] = $this->url()->addQueryParameters(['ui' => $item['name']]);

return $item;
},
$this->layout()->themeOptions
),
]) ?>
<?php endif; ?>
return $item;
},
$this->layout()->themeOptions
),
]) ?>
<?php endif; ?>

<?php if (isset($this->layout()->allLangs) && count($this->layout()->allLangs) > 1): ?>
<?= $this->component('menu-button', [
'toggleLabel' => 'Language',
'wrapperClass' => 'language',
'wrapperTag' => 'li',
'menuItems' => array_map(
function ($langCode, $langName) {
return [
'label' => $this->displayLanguageOption($langName),
'url' => $this->url()->addQueryParameters(['lng' => $langCode]),
'selected' => $this->layout()->userLang == $langCode,
];
},
array_keys($this->layout()->allLangs),
array_values($this->layout()->allLangs),
),
]) ?>
<?php endif; ?>
</ul>
</nav>
</div>
<?php endif; ?>
<?php if (isset($this->layout()->allLangs) && count($this->layout()->allLangs) > 1): ?>
<?=$this->component('menu-button', [
'toggleLabel' => 'Language',
'wrapperClass' => 'language',
'wrapperTag' => 'li',
'menuItems' => array_map(
function ($langCode, $langName) {
return [
'label' => $this->displayLanguageOption($langName),
'url' => $this->url()->addQueryParameters(['lng' => $langCode]),
'selected' => $this->layout()->userLang == $langCode,
];
},
array_keys($this->layout()->allLangs),
array_values($this->layout()->allLangs),
),
]) ?>
<?php endif; ?>
</ul>
</nav>
</div>
<?php endif; ?>
</div>
<?php if ($this->layout()->searchbox !== false): ?>
<div class="search container navbar">
<div class="nav searchbox hidden-print" role="search">
<?= $this->layout()->searchbox ?>
<?=$this->layout()->searchbox ?>
</div>
</div>
<?php endif; ?>
Loading

0 comments on commit a4bfd84

Please sign in to comment.