Skip to content

Commit

Permalink
feat: minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
Satoru committed Sep 26, 2022
1 parent b5f96b1 commit 4855f52
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 57 deletions.
2 changes: 1 addition & 1 deletion config/theme.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[info]
name = "Bootstrap 5"
version = "1.0.1"
version = "1.0.2"
author = "Satoru Nakamura"
description = "Omeka S theme based on bootstrap 5 - https://getbootstrap.com/"
theme_link = "https://github.com/ldasjp8/Omeka-S-theme-Bootstrap5"
Expand Down
2 changes: 1 addition & 1 deletion release.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set -e

version=1.0.1
version=1.0.2
name=Bootstrap5

# 不要なファイルを除外したモジュール名のフォルダを作成
Expand Down
79 changes: 24 additions & 55 deletions view/common/helper/iiif-viewers.phtml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?php
use Omeka\Api\Exception\NotFoundException;

// アイコンURL取得
function getIconAttr($view, $iconId, $attribute)
{
// IDがない場合はなし
if (!$iconId) {
if (!$iconId)
{
return '';
}
try {
// アイコンIDからデータ取得
$icon = $view->api()->read('iiif_viewers_icons', $iconId)->getContent();
if (!$icon) {
if (!$icon)
{
return '';
}
return sprintf($attribute, $icon->assetUrl());
Expand All @@ -20,33 +21,15 @@ function getIconAttr($view, $iconId, $attribute)
}
}
$translate = $this->plugin('translate');

$manifest = $config["iiifResourceUri"];
$iconAttr = 'src="%s"';
$setting = $config["setting"];

// ロゴアイコン
$logoIconId = $config["setting"]['logo'];
$logoIconId = $setting['manifest_icon'];
// src属性取得
$logoAttr = getIconAttr($this, $logoIconId, $iconAttr);
// Miradorアイコン
$miradorIconId = $config["setting"]['iiifviewers_mirador_icon'];
// src属性取得
$miradorAttr = getIconAttr($this, $miradorIconId, $iconAttr);
// Universal Viewerアイコン
$universalViewerIconId = $config["setting"]['iiifviewers_universal_viewer_icon'];
// src属性取得
$universalViewerAttr = getIconAttr($this, $universalViewerIconId, $iconAttr);
// Curation Viewerアイコン
$curationViewerIconId = $config["setting"]['iiifviewers_curation_viewer_icon'];
// src属性取得
$curationViewerAttr = getIconAttr($this, $curationViewerIconId, $iconAttr);
// Tifyアイコン
// $tifyIconId = $config["setting"]['iiifviewers_tify_icon'];
// src属性取得
// $tifyAttr = getIconAttr($this, $tifyIconId, $iconAttr);
// IAアイコン
$iaIconId = $config["setting"]['iiifviewers_ia_icon'];
// src属性取得
$iaAttr = getIconAttr($this, $iaIconId, $iconAttr);

?>
<div>
<div style="background-color: black">
Expand All @@ -57,35 +40,21 @@ $iaAttr = getIconAttr($this, $iaIconId, $iconAttr);
</div>
</div>
<div class="container text-end mt-2">
<a href="<?php echo $manifest; ?>?manifest=<?php echo $manifest; ?>"
title="<?php echo $translate('IIIF Manifest'); ?>"
target="_blank"><img style="height: 24px" <?php echo $logoAttr; ?> /></a>
<?php if ($config["setting"]["iiifviewers_mirador"]): ?>
<a style="margin-left : 10px;"
href="<?php echo $config["setting"]["iiifviewers_mirador"].$manifest; ?>"
title="Mirador" target="_blank"><img style="height: 24px" <?php echo $miradorAttr; ?> /></a>
<?php endif; ?>
<?php if ($config["setting"]["iiifviewers_universal_viewer"]): ?>
<a style="margin-left : 10px;"
href="<?php echo $config["setting"]["iiifviewers_universal_viewer"].$manifest; ?>"
title="Univesal Viewer" target="_blank"><img style="height: 24px" <?php echo $universalViewerAttr; ?> /></a>
<?php endif; ?>
<?php if ($config["setting"]["iiifviewers_curation_viewer"]): ?>
<a style="margin-left : 10px;"
href="<?php echo $config["setting"]["iiifviewers_curation_viewer"].$manifest; ?>"
title="IIIF Curation Viewer" target="_blank"><img style="height: 24px" <?php echo $curationViewerAttr; ?> /></a>
<?php endif; ?>
<!--
<?php if ($config["setting"]["iiifviewers_tify"]): ?>
<a style="margin-left : 10px;"
href="<?php echo $config["setting"]["iiifviewers_tify"].$manifest; ?>"
title="TIFY" target="_blank"><img style="height: 24px" <?php echo $tifyAttr; ?> /></a>
<?php endif; ?>
-->
<?php if ($config["setting"]["iiifviewers_ia"]): ?>
<a style="margin-left : 10px;"
href="<?php echo $config["setting"]["iiifviewers_ia"].$manifest; ?>"
title="Image Annotator" target="_blank"><img style="height: 24px" <?php echo $iaAttr; ?> /></a>
<?php endif; ?>
<a href="<?php echo $manifest; ?>?manifest=<?php echo $manifest; ?>" title="<?php echo $translate('IIIF Manifest'); ?>" target="_blank"><img style="height: 30px" <?php echo $logoAttr; ?> /></a>
<?php for($i = 0; $i < 5; $i++): ?>
<?php
$index = $i + 1;
if(isset($setting["url_".($index)])):
?>
<?php
$url = $setting["url_".$index].$manifest;
$icon = getIconAttr($this, $setting["icon_".$index], $iconAttr);
$label = $setting["label_".$index];
?>
<a style="margin-left : 10px;" href="<?php echo $url; ?>" title="<?php echo $label; ?>" target="_blank">
<img style="height: 30px" <?php echo $icon; ?> />
</a>
<?php endif; ?>
<?php endfor; ?>
</div>
</div>

0 comments on commit 4855f52

Please sign in to comment.