PanoramaViewer-omeka-module/view/common/block-layout/panorama-viewer.phtml

37 lines
852 B
PHTML
Raw Normal View History

2021-04-03 18:47:20 +02:00
<div style="position:relative;">
<?php
$this->headLink()->appendStylesheet($this->assetUrl('vendor/pannellum/pannellum.css', 'PanoramaViewer'));
$this->headScript()->appendFile($this->assetUrl('vendor/pannellum/pannellum.js', 'PanoramaViewer'));
if ($title !== false && $title !== "") {
$title = sprintf('<p id="panorama-viewer-title">%s</p>', $title);
} else {
$title = false;
}
?>
<style>
.panorama-viewer { height: <?= $height ?>; }
.pannellum-img { width: 100%; }
</style>
<div class="pannellum">
2021-04-03 18:56:54 +02:00
<div id="<?= $id ?>" class="panorama-viewer"></div>
2021-04-03 18:47:20 +02:00
</div>
<script>
2021-04-03 18:56:54 +02:00
pannellum.viewer("<?= $id ?>", {
2021-04-03 18:47:20 +02:00
type: "<?= $panorama_type ?>",
autoLoad: true,
panorama: "<?= $urls[0]; ?>",
});
<?php if ($title !== false): ?>
$('#pannellum-ui').append('<?= $title ?>');
<?php endif ?>
</script>
</div>