<h4><?=$this->transEsc('Your Account')?></h4>
<div class="myresearch-menu">
  <?php if ($this->userlist()->getMode() !== 'disabled'): ?>
    <a href="<?=$this->url('myresearch-favorites')?>"<?=$this->active == 'favorites' ? ' class="active"' : ''?>>
      <i class="fa fa-fw fa-star" aria-hidden="true"></i> <?=$this->transEsc('Favorites')?>
    </a>
  <?php endif; ?>
  <?php if ('ils-none' !== $this->ils()->getOfflineMode()): ?>
    <?php if ($this->ils()->checkCapability('getMyTransactions')): ?>
      <a href="<?=$this->url('myresearch-checkedout')?>"<?=$this->active == 'checkedout' ? ' class="active"' : ''?>>
        <i class="fa fa-fw fa-book" aria-hidden="true"></i> <?=$this->transEsc('Checked Out Items')?>
      </a>
    <?php endif; ?>
    <?php if ($this->ils()->checkCapability('getMyHolds')): ?>
      <a href="<?=$this->url('myresearch-holds')?>"<?=$this->active == 'holds' ? ' class="active"' : ''?>>
        <i class="fa fa-fw fa-flag" aria-hidden="true"></i> <?=$this->transEsc('Holds and Recalls')?>
      </a>
    <?php endif; ?>
    <?php if ($this->ils()->checkFunction('StorageRetrievalRequests')): ?>
      <a href="<?=$this->url('myresearch-storageretrievalrequests')?>"<?=$this->active == 'storageRetrievalRequests' ? ' class="active"' : ''?>>
        <i class="fa fa-fw fa-archive" aria-hidden="true"></i> <?=$this->transEsc('Storage Retrieval Requests')?>
      </a>
    <?php endif; ?>
    <?php if ($this->ils()->checkFunction('ILLRequests')): ?>
    <a href="<?=$this->url('myresearch-illrequests')?>"<?=$this->active == 'ILLRequests' ? ' class="active"' : ''?>>
      <i class="fa fa-fw fa-exchange" aria-hidden="true"></i> <?=$this->transEsc('Interlibrary Loan Requests')?>
    </a>
    <?php endif; ?>
<?php // Lines for fines deleted ?>
    <?php if ($this->ils()->checkCapability('getMyProfile')): ?>
      <a href="<?=$this->url('myresearch-profile')?>"<?=$this->active == 'profile' ? ' class="active"' : ''?>>
        <i class="fa fa-fw fa-user" aria-hidden="true"></i> <?=$this->transEsc('Profile')?>
      </a>
    <?php endif; ?>
    <?php $user = $this->auth()->isLoggedIn(); if ($user && $user->libraryCardsEnabled()): ?>
      <a href="<?=$this->url('librarycards-home')?>"<?=$this->active == 'librarycards' ? ' class="active"' : ''?>>
        <i class="fa fa-fw fa-barcode" aria-hidden="true"></i> <?=$this->transEsc('Library Cards')?>
      </a>
    <?php endif; ?>
  <?php endif; ?>
  <?php if ($this->accountCapabilities()->getSavedSearchSetting() === 'enabled'): ?>
    <a href="<?=$this->url('search-history')?>?require_login"<?=$this->active == 'history' ? ' class="active"' : ''?>>
      <i class="fa fa-fw fa-search" aria-hidden="true"></i> <?=$this->transEsc('history_saved_searches')?>
    </a>
  <?php endif; ?>
  <?php if ($user = $this->auth()->isLoggedIn()): ?>
    <a href="<?=$this->url('myresearch-logout')?>">
      <i class="fa fa-fw fa-sign-out" aria-hidden="true"></i> <?=$this->transEsc("Log Out")?>
    </a>
  <?php endif; ?>
</div>
<?php if ($this->auth()->isLoggedIn() && $this->auth()->getManager()->supportsPasswordChange()): ?>
  <h4><?=$this->transEsc('Preferences')?></h4>
  <div class="myresearch-menu">
    <a href="<?=$this->url('myresearch-changepassword') ?>"<?=$this->active == 'newpassword' ? ' class="active"' : ''?>>
      <i class="fa fa-fw fa-lock" aria-hidden="true"></i> <?=$this->transEsc('Change Password') ?>
    </a>
  </div>
<?php endif; ?>
<?php if ($this->userlist()->getMode() !== 'disabled' && $user = $this->auth()->isLoggedIn()): ?>
  <h4><?=$this->transEsc('Your Lists')?></h4>
  <div class="myresearch-menu">
    <a href="<?=$this->url('myresearch-favorites')?>"<?=$this->active == 'favorites' ? ' class="active"' : ''?>>
      <i class="fa fa-fw fa-star" aria-hidden="true"></i> <?=$this->transEsc('Your Favorites')?>
    </a>
    <?php $lists = $user->getLists() ?>
    <?php foreach ($lists as $list): ?>
      <a href="<?=$this->url('userList', ['id' => $list['id']])?>"<?=$this->active == 'list' . $list['id'] ? ' class="active"' : ''?>>
        <?=$this->escapeHtml($list['title'])?>
        <span class="badge"><?=$list->cnt ?></span>
      </a>
    <?php endforeach; ?>
    <a href="<?=$this->url('editList', ['id'=>'NEW'])?>">
      <i class="fa fa-fw fa-plus" aria-hidden="true"></i> <?=$this->transEsc('Create a List') ?>
    </a>
  </div>
<?php endif ?>
