Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
menu.phtml 7.93 KiB
<!-- finc: myresearch - menu -->
<?php

/**
 * origin: finc
 *
 * called by view helper/controller: MyResearchController
 *
 * usage:
 ** renders side menu of profile/myreasearch menu
 *
 * configured in: --
 */
?>
<?php
  $user = $this->auth()->isLoggedIn();
  $patron = $user ? $this->auth()->getILSPatron() : false;
  $capabilityParams = $patron ? ['patron' => $patron] : [];
  $ilsOnline = ('ils-none' !== $this->ils()->getOfflineMode());
?>
<?php /* finc change btn-link to btn-default */ ?>
<button class="close-offcanvas btn btn-default" data-toggle="offcanvas"><?=$this->transEsc('navigate_back') ?></button>
<?php /* finc: change h3 to h2 */ ?>
<h2><?=$this->transEsc('Your Account')?></h2>
<?php /* finc needs to add .facet-group class and classes on sub items for borders - CK */
      /* also adds aria-current for correct menu action */ ?>
<?php /* finc needs to add .facet-group class and classes on sub items for borders - CK */ ?>
<?php /* finc: myreasearch menu as list #19734 */ ?>
<?php /* finc: specify current page menu entry in following elements #19941 */ ?>
<ul class="myresearch-menu account-menu facet-group">
  <?php if ($this->userlist()->getMode() !== 'disabled'): ?>
    <li class="facet">
      <a href="<?=$this->url('myresearch-favorites')?>"<?=$this->active == 'favorites' ? ' class="active" aria-current="page"' : ''?>>
        <i class="fa fa-fw fa-star" aria-hidden="true"></i> <?=$this->transEsc('Favorites')?>
      </a>
    </li>
  <?php endif; ?>
  <?php if ($ilsOnline && $this->ils()->checkCapability('getMyTransactions', $capabilityParams)): ?>
    <li class="facet">
      <a href="<?=$this->url('myresearch-checkedout')?>" class="flex checkedout<?=$this->active == 'checkedout' ? ' active' : ''?>"
        <?=$this->active == 'checkedout' ? ' aria-current="page"' : ''?>
      >
        <span class="flex-col"><i class="fa fa-fw fa-book" aria-hidden="true"></i>&nbsp;<?=$this->transEsc('Checked Out Items')?></span>
        <span class="checkedout-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span>
      </a>
    </li>
  <?php endif; ?>
  <?php if ($ilsOnline && $this->ils()->checkFunction('getMyTransactionHistory', $capabilityParams)): ?>
    <li class="facet">
      <a href="<?=$this->url('myresearch-historicloans')?>"<?=$this->active == 'historicloans' ? ' class="active" aria-current="page"' : ''?>>
        <i class="fa fa-fw fa-history" aria-hidden="true"></i> <?=$this->transEsc('Loan History')?>
      </a>
    </li>
  <?php endif; ?>
  <?php if ($ilsOnline && $this->ils()->checkCapability('getMyHolds', $capabilityParams)): ?>
    <li class="facet">
      <a href="<?=$this->url('myresearch-holds')?>" class="flex<?=$this->active == 'holds' ? ' active' : ''?>"
        <?=$this->active == 'holds' ? ' aria-current="page"' : ''?>
      >
        <span class="flex-col"><i class="fa fa-fw fa-flag" aria-hidden="true"></i>&nbsp;<?=$this->transEsc('Holds and Recalls')?></span>
        <span class="holds-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span>
      </a>
    </li>
  <?php endif; ?>
  <?php if ($ilsOnline && $this->ils()->checkFunction('StorageRetrievalRequests', $capabilityParams)): ?>
    <li class="facet">
      <a href="<?=$this->url('myresearch-storageretrievalrequests')?>" class="flex<?=$this->active == 'storageRetrievalRequests' ? ' active' : ''?>"
        <?=$this->active == 'storageRetrievalRequests' ? ' aria-current="page"' : ''?>
      >
        <span class="flex-col"><i class="fa fa-fw fa-archive" aria-hidden="true"></i> <?=$this->transEsc('Storage Retrieval Requests')?></span>
        <span class="storageretrievalrequests-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span>
      </a>
    </li>
  <?php endif; ?>
  <?php if ($ilsOnline && $this->ils()->checkFunction('ILLRequests', $capabilityParams)): ?>
    <li class="facet">
      <a href="<?=$this->url('myresearch-illrequests')?>" class="flex<?=$this->active == 'ILLRequests' ? ' active' : ''?>"
        <?=$this->active == 'ILLRequests' ? ' aria-current="page"' : ''?>
      >
        <span class="flex-col"><i class="fa fa-fw fa-exchange" aria-hidden="true"></i> <?=$this->transEsc('Interlibrary Loan Requests')?></span>
        <span class="illrequests-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span>
      </a>
    </li>
  <?php endif; ?>
  <?php if ($ilsOnline && $this->ils()->checkCapability('getMyFines', $capabilityParams)): ?>
    <li class="facet">
      <a href="<?=$this->url('myresearch-fines')?>" class="flex<?=$this->active == 'fines' ? ' active' : ''?>"
        <?=$this->active == 'fines' ? ' aria-current="page"' : ''?>
      >
        <span class="flex-col"><i class="fa fa-fw fa-usd" aria-hidden="true"></i>&nbsp;<?=$this->transEsc('Fines')?></span>
        <span class="fines-status status hidden"><i class="fa fa-spin fa-spinner" aria-hidden="true"></i></span>
      </a>
    </li>
  <?php endif; ?>
  <li class="facet">
    <a href="<?=$this->url('myresearch-profile')?>"<?=$this->active == 'profile' ? ' class="active" aria-current="page"' : ''?>>
      <i class="fa fa-fw fa-user" aria-hidden="true"></i> <?=$this->transEsc('Profile')?>
    </a>
  </li>
  <?php if ($ilsOnline && $user && $user->libraryCardsEnabled()): ?>
    <li class="facet">
      <a href="<?=$this->url('librarycards-home')?>"<?=$this->active == 'librarycards' ? ' class="active" aria-current="page"' : ''?>>
        <i class="fa fa-fw fa-barcode" aria-hidden="true"></i> <?=$this->transEsc('Library Cards')?>
      </a>
    </li>
  <?php endif; ?>
  <?php if ($this->overdrive()->showMyContentLink()):?>
    <li class="facet">
      <a href="<?=$this->url('overdrive-mycontent')?>"<?=$this->active == 'dgcontent' ? ' class="active"' : ''?>>
        <i class="fa fa-fw fa-download" aria-hidden="true"></i> <?=$this->transEsc('Overdrive Content')?>
      </a>
    </li>
  <?php endif; ?>
  <?php if ($this->accountCapabilities()->getSavedSearchSetting() === 'enabled'): ?>
    <li class="facet">
      <a href="<?=$this->url('search-history')?>?require_login"<?=$this->active == 'history' ? ' class="active" aria-current="page"' : ''?>>
        <i class="fa fa-fw fa-search" aria-hidden="true"></i> <?=$this->transEsc('history_saved_searches')?>
      </a>
    </li>
  <?php endif; ?>
  <?php if ($user): ?>
    <li class="facet">
      <a href="<?=$this->url('myresearch-logout')?>">
        <i class="fa fa-fw fa-sign-out" aria-hidden="true"></i> <?=$this->transEsc("Log Out")?>
      </a>
    </li>
  <?php endif; ?>
</ul>

<?php if ($user && $this->userlist()->getMode() !== 'disabled'): ?>
  <?php /* finc adds '.lists-heading' for styling purposes */ ?>
  <h3 class="list-heading"><?=$this->transEsc('Your Lists')?></h3>
  <?php /* finc: change menu into list */ ?>
  <ul class="myresearch-menu facet-group">
    <li class="facet">
      <?php /* finc adds aria-current */ ?>
      <a href="<?=$this->url('myresearch-favorites')?>"<?=$this->active == 'favorites' ? ' class="active"' : ''?>
        <?=$this->active == 'favorites' ? ' aria-current="page"' : ''?>
      >
        <i class="fa fa-fw fa-star" aria-hidden="true"></i> <?=$this->transEsc('Your Favorites')?>
      </a>
    </li>
    <?php $lists = $user->getLists() ?>
    <?php foreach ($lists as $list): ?>
      <li class="facet">
        <a href="<?=$this->url('userList', ['id' => $list['id']])?>"<?=$this->active == 'list' . $list['id'] ? ' class="active"' : ''?>
          <?=$this->active == 'list' . $list['id'] ? ' aria-current="page"' : ''?>
        >
          <?=$this->escapeHtml($list['title'])?>
          <span class="badge"><?=$list->cnt ?></span>
        </a>
      </li>
    <?php endforeach; ?>
    <li class="facet">
      <a href="<?=$this->url('editList', ['id' => 'NEW'])?>"
        <?=$this->active == 'editlist/NEW' ? ' aria-current="page"' : ''?>
      >
        <i class="fa fa-fw fa-plus" aria-hidden="true"></i> <?=$this->transEsc('Create a List') ?>
      </a>
    </li>
  </ul>
<?php endif ?>
<!-- finc: myresearch - menu - END -->