forked from NatLibFi/NDL-VuFind2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added own templates for RecordTab controls
- Loading branch information
Showing
4 changed files
with
93 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!-- START of: finna - RecordTab/controls/sort.phtml --> | ||
<?php $list = $this->sortList ? $this->sortList : $this->params->getSortList(); | ||
if (empty($list)) { | ||
return; | ||
}?> | ||
<div class="sort-option-container"> | ||
<span class="hidden-sm hidden-xs hidden-md button-label" id="sort-label"><?=$this->transEsc('Sort')?></span> | ||
<span class="sr-only hidden-lg hidden-md"><?=$this->transEsc('Sort')?></span> | ||
<div class="sort-button"> | ||
<div class="dropdown"> | ||
<?php $selectedFound = false; ?> | ||
<?php foreach ($list as $sortType => $sortData): ?> | ||
<?php if ($sortData['selected']): ?> | ||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-label="<?= $this->transEsc('Sort') . ': ' . $this->transEsc($sortData['desc'])?>"> | ||
<span><?=$this->transEsc($sortData['desc'])?></span> <?=$this->icon('dropdown-open') ?> | ||
</a> | ||
<?php $selectedFound = true; ?> | ||
<?php endif; ?> | ||
<?php endforeach; ?> | ||
<?php if (!$selectedFound): ?> | ||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> | ||
<span><?=$this->transEsc('choose_from_list')?></span> <?=$this->icon('dropdown-open') ?> | ||
</a> | ||
<?php endif; ?> | ||
<ul class="dropdown-menu dropdown-menu-right" role="menu" aria-labelledby="sort-label"> | ||
<?php foreach ($list as $sortType => $sortData): ?> | ||
<li> | ||
<a href="Results<?=isset($sortData['url']) ? $this->escapeHtmlAttr($sortData['url']) : $this->results->getUrlQuery()->setSort($sortType)?>" role="menuitem" aria-label="<?= $this->transEsc('Sort') . ': ' . $this->transEsc($sortData['desc'])?>"><?=$this->transEsc($sortData['desc'])?></a> | ||
<?php endforeach; ?> | ||
</li> | ||
</ul> | ||
<noscript><input type="submit" class="btn btn-default" value="<?=$this->transEscAttr('Set')?>"></noscript> | ||
</div> | ||
</div> | ||
</div> | ||
<?php // Use a hidden form for upstream JS results compatibility: ?> | ||
<form class="search-sort hidden" action="<?=$this->currentPath()?>" method="get" name="sort"> | ||
<?=$this->results->getUrlQuery()->asHiddenFields(['sort' => '/.*/', 'page' => '/.*/']);?> | ||
<label for="sort_options_1"><?=$this->transEsc('Sort')?></label> | ||
<select id="sort_options_1" name="sort" class="jumpMenu form-control"> | ||
<?php foreach ($list as $sortType => $sortData): ?> | ||
<option value="<?=$this->escapeHtmlAttr($sortType)?>"<?=$sortData['selected'] ? ' selected="selected"' : ''?><?=$sortData['default'] ? ' data-default' : ''?>><?=$this->transEsc($sortData['desc'])?></option> | ||
<?php endforeach; ?> | ||
</select> | ||
<noscript><input type="submit" class="btn btn-default" value="<?=$this->transEscAttr('Set')?>"></noscript> | ||
</form> | ||
<!-- END of: finna - RecordTab/controls/sort.phtml --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!-- START of: finna - RecordTab/controls/view.phtml --> | ||
<?php | ||
$viewList = $this->params->getViewList(); | ||
if (count($viewList) <= 1) { | ||
return; | ||
} | ||
?> | ||
<div class="view-option-container text-right"> | ||
<span class="hidden-sm hidden-xs hidden-md button-label" id="show-as-label"><?=$this->transEsc('show_as')?></span> | ||
<span class="sr-only hidden-lg hidden-md"><?=$this->transEsc('show_as')?></span> | ||
<div class="view-dropdown"> | ||
<div class="dropdown"> | ||
<?php foreach ($viewList as $viewType => $viewData): ?> | ||
<?php if ($viewData['selected']): ?> | ||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-label="<?=$this->transEsc('show_as') . ': ' . $this->transEsc('Show As ' . $viewData['desc'])?>"><?=$this->icon('view-' . $viewType, 'icon-' . $viewType) ?> <span class="hidden-xs hidden-sm"><?=$this->transEsc('Show As ' . $viewData['desc'])?></span> <?=$this->icon('dropdown-open') ?></a> | ||
<?php endif; ?> | ||
<?php endforeach; ?> | ||
|
||
<ul class="dropdown-menu dropdown-menu-right" role="menu" aria-labelledby="show-as-label"> | ||
<?php foreach ($viewList as $viewType => $viewData): ?> | ||
<?php | ||
if ($viewData['selected']) { | ||
$viewUrl = '#'; | ||
} else { | ||
$viewUrl = $this->results->getUrlQuery()->setViewParam($viewType); | ||
if ('visual' === $viewType) { | ||
$viewUrl = $viewUrl->setPage(1); | ||
} | ||
} | ||
?> | ||
<li> | ||
<a href="<?=$viewUrl?>" title="<?=$this->transEsc($viewData['desc'])?>" role="menuitem" aria-label="<?=$this->transEsc('show_as') . ': ' . $this->transEsc('Show As ' . $viewData['desc'])?>" > | ||
<?=$this->icon('view-' . $viewType, 'icon-' . $viewType) ?> <?=$this->transEsc('Show As ' . $viewData['desc'])?> | ||
</a> | ||
</li> | ||
<?php endforeach; ?> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- END of: finna - RecordTab/controls/view.phtml --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters