From 92da216cff7137b301bfba94d1c52eac38bb48ed Mon Sep 17 00:00:00 2001
From: buttle
Date: Tue, 22 Jun 2021 11:37:19 +0200
Subject: [PATCH] adds renderer
---
Module.php | 12 ------------
README.md | 7 +++----
config/module.config.php | 3 ---
src/Form/SketchfabBlockForm.php | 18 ------------------
src/Site/BlockLayout/Sketchfab.php | 7 +++++++
view/common/block-layout/sketchfab.phtml | 20 ++------------------
6 files changed, 12 insertions(+), 55 deletions(-)
diff --git a/Module.php b/Module.php
index f1c99fc..e75640a 100644
--- a/Module.php
+++ b/Module.php
@@ -9,18 +9,6 @@ class Module extends AbstractModule
{
const NAMESPACE = __NAMESPACE__;
- const MEDIA_TYPE = [
- 'video' => 'Video',
- 'audio' => 'Audio',
- 'image' => 'Image',
- ];
-
- const RATIOS = [
- '1.777' => '16:9',
- '1.333' => '4:3',
- '2' => '2:1',
- ];
-
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
diff --git a/README.md b/README.md
index d653996..95294d4 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# Sketchfab models for Omeka S
-[Sketchfab] is a module for [Omeka S] that integrates Sketchfab
+[Sketchfab-omeka-module] is a module for [Omeka S] that integrates Sketchfab
3D models.
## Install
@@ -9,7 +9,7 @@
cd ./modules
https://git.hangar.org/arcHIVE-tech/Sketchfab-omeka-module.git
unzip main.zip
-mv archiveorg/ Sketchfab
+mv sketchfab-omeka-module Sketchfab
rm main.zip
```
@@ -18,9 +18,8 @@ The module is released under the [MIT] License.
[arc-hive]: https://arc-hive.zone/
-[Archive.org media ]: https://git.hangar.org/arcHIVE-tech/Sketchfab
+[Sketchfab-omeka-module]: https://git.hangar.org/arcHIVE-tech/Sketchfab-omeka-module
[Omeka S]: https://omeka.org/s
-[Archive.org]: https://archive.org
[MIT]: http://opensource.org/licenses/MIT
diff --git a/config/module.config.php b/config/module.config.php
index 0ff93e9..b3f08a0 100644
--- a/config/module.config.php
+++ b/config/module.config.php
@@ -29,11 +29,8 @@ return [
],
'DefaultSettings' => [
'SketchfabBlockForm' => [
- 'media_type' => 'video',
'title' => '',
'width' => 600,
- 'ratio' => '2',
- 'autoLoad' => false,
'wrapStyle' => 'overflow-y: hidden;display: flex;flex-direction: column;justify-content: center;',
]
]
diff --git a/src/Form/SketchfabBlockForm.php b/src/Form/SketchfabBlockForm.php
index 0124e0a..b6f94f6 100644
--- a/src/Form/SketchfabBlockForm.php
+++ b/src/Form/SketchfabBlockForm.php
@@ -18,15 +18,6 @@ class SketchfabBlockForm extends Form
]
]);
- $this->add([
- 'name' => 'o:block[__blockIndex__][o:data][media_type]',
- 'type' => Element\Select::class,
- 'options' => [
- 'label' => 'Media type',
- 'value_options' => Module::MEDIA_TYPE,
- ],
- ]);
-
$this->add([
'name' => 'o:block[__blockIndex__][o:data][width]',
'type' => Element\Number::class,
@@ -38,14 +29,5 @@ class SketchfabBlockForm extends Form
],
]);
- $this->add([
- 'name' => 'o:block[__blockIndex__][o:data][ratio]',
- 'type' => Element\Select::class,
- 'options' => [
- 'label' => 'Ratio',
- 'value_options' => Module::RATIOS,
- ],
- ]);
-
}
}
diff --git a/src/Site/BlockLayout/Sketchfab.php b/src/Site/BlockLayout/Sketchfab.php
index 9149744..e78fb64 100644
--- a/src/Site/BlockLayout/Sketchfab.php
+++ b/src/Site/BlockLayout/Sketchfab.php
@@ -75,6 +75,12 @@ class Sketchfab extends AbstractBlockLayout
static $id = 0;
$media = $attachments[0]->item()->media()[0];
+ return $view->partial('common/block-layout/sketchfab', [
+ 'title' => false,
+ 'sketchfab_iframe' => $media->mediaData()['html'],
+ ]);
+ //return $media->mediaData()['html'];
+ /*
$width = $block->dataValue('width');
$height = $width / $block->dataValue('ratio');
return $view->partial('common/block-layout/archiveOrg', [
@@ -86,5 +92,6 @@ class Sketchfab extends AbstractBlockLayout
'id' => 'achive_org-' . ++$id,
'thumbnails' => $thumbnails,
]);
+ */
}
}
diff --git a/view/common/block-layout/sketchfab.phtml b/view/common/block-layout/sketchfab.phtml
index 4fb4f5d..a22746e 100644
--- a/view/common/block-layout/sketchfab.phtml
+++ b/view/common/block-layout/sketchfab.phtml
@@ -2,28 +2,12 @@
%s
', $title);
+ $title = sprintf('%s
', $title);
} else {
$title = false;
}
?>
-
-
-
-
-
+ = $sketchfab_iframe ?>