diff --git a/README.md b/README.md index fd9bf81..1364206 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Built using HTML5, CSS3, JavaScript, and WebGL, it is plug-in free. ``` cd ./modules -https://git.hangar.org/arcHIVE-tech/PanoramaViewer/archive/main.zip +https://git.hangar.org/arcHIVE-tech/PanoramaViewer-omeka-module/archive/main.zip unzip main.zip mv panoramaviewer/ PanoramaViewer ``` @@ -21,7 +21,7 @@ The script for Panorama feature is imported from [Pannellum]. [arc-hive]: https://arc-hive.zone/ -[Panorama Viewer]: https://git.hangar.org/arcHIVE-tech/PanoramaViewer +[Panorama Viewer]: https://git.hangar.org/arcHIVE-tech/PanoramaViewer-omeka-module [Pannellum]: https://pannellum.org/ [Omeka S]: https://omeka.org/s [MIT]: http://opensource.org/licenses/MIT diff --git a/config/module.config.php b/config/module.config.php index 0002504..308cfe2 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -25,6 +25,7 @@ return [ 'width' => 600, 'ratio' => '2', 'autoLoad' => false, + 'renderSourceLink' => true, 'wrapStyle' => 'overflow-y: hidden;display: flex;flex-direction: column;justify-content: center;', //'imgStyle' => '', 'ui_background' => 'rgba(0,0,0,0.1)', diff --git a/src/Form/PanoramaViewerBlockForm.php b/src/Form/PanoramaViewerBlockForm.php index 71c382b..aa2eaf6 100644 --- a/src/Form/PanoramaViewerBlockForm.php +++ b/src/Form/PanoramaViewerBlockForm.php @@ -20,14 +20,6 @@ class PanoramaViewerBlockForm extends Form ], ]); - $this->add([ - 'name' => 'o:block[__blockIndex__][o:data][title]', - 'type' => Element\Text::class, - 'options' => [ - 'label' => 'Title (option)', - ] - ]); - $this->add([ 'name' => 'o:block[__blockIndex__][o:data][width]', 'type' => Element\Number::class, @@ -59,5 +51,24 @@ class PanoramaViewerBlockForm extends Form ], ]); + $this->add([ + 'type' => Element\Checkbox::class, + 'name' => 'o:block[__blockIndex__][o:data][renderSourceLink]', + 'options' => [ + 'label' => 'Display a link to the item', + //'use_hidden_element' => true, + 'checked_value' => true, + 'unchecked_value' => false, + ], + ]); + + $this->add([ + 'name' => 'o:block[__blockIndex__][o:data][title]', + 'type' => Element\Text::class, + 'options' => [ + 'label' => 'Sub-title', + ] + ]); + } } diff --git a/src/Site/BlockLayout/PanoramaViewer.php b/src/Site/BlockLayout/PanoramaViewer.php index e775d6c..bd1a616 100644 --- a/src/Site/BlockLayout/PanoramaViewer.php +++ b/src/Site/BlockLayout/PanoramaViewer.php @@ -52,6 +52,7 @@ class PanoramaViewer extends AbstractBlockLayout 'o:block[__blockIndex__][o:data][width]' => $data['width'], 'o:block[__blockIndex__][o:data][ratio]' => $data['ratio'], 'o:block[__blockIndex__][o:data][autoLoad]' => $data['autoLoad'], + 'o:block[__blockIndex__][o:data][renderSourceLink]' => $data['renderSourceLink'], ]); $form->prepare(); @@ -102,6 +103,7 @@ class PanoramaViewer extends AbstractBlockLayout 'width' => $width, 'height' => $height, 'autoLoad' => $block->dataValue('autoLoad'), + 'renderSourceLink' => $block->dataValue('renderSourceLink'), 'urls' => $urls, 'id' => 'pv-' . ++$id, 'mediaTypes' => $media_types, diff --git a/view/common/block-layout/panorama-viewer.phtml b/view/common/block-layout/panorama-viewer.phtml index 738aee7..e462fa2 100644 --- a/view/common/block-layout/panorama-viewer.phtml +++ b/view/common/block-layout/panorama-viewer.phtml @@ -28,8 +28,13 @@ } -
+
+ + + + + +
-
- + +
+
+