adds renderer
This commit is contained in:
parent
421b71c9d8
commit
92da216cff
12
Module.php
12
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';
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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;',
|
||||
]
|
||||
]
|
||||
|
|
|
@ -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,
|
||||
],
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
]);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,28 +2,12 @@
|
|||
|
||||
<?php
|
||||
if ($title !== false && $title !== "") {
|
||||
$title = sprintf('<p id="achive_org_media-title">%s</p>', $title);
|
||||
$title = sprintf('<p id="sketchfab-title">%s</p>', $title);
|
||||
} else {
|
||||
$title = false;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ($media_type != "audio") { ?>
|
||||
<style>
|
||||
#<?= $id ?> {
|
||||
height: <?= $height ?>px;
|
||||
width: <?= $width ?>px;
|
||||
}
|
||||
</style>
|
||||
<?php } ?>
|
||||
|
||||
<iframe
|
||||
id="<?= $id ?>"
|
||||
src="<?= $url ?>"
|
||||
frameborder="0"
|
||||
webkitallowfullscreen="true"
|
||||
mozallowfullscreen="true"
|
||||
allowfullscreen >
|
||||
</iframe>
|
||||
<?= $sketchfab_iframe ?>
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue