Compare commits
2 Commits
ea50a69804
...
ae13afa445
Author | SHA1 | Date |
---|---|---|
buttle | ae13afa445 | |
buttle | 101a016e9e |
12
Module.php
12
Module.php
|
@ -22,6 +22,18 @@ class Module extends AbstractModule
|
|||
*/
|
||||
];
|
||||
|
||||
const MODEL_WIDTH = [
|
||||
'50' => '50 %',
|
||||
'75' => '75 %',
|
||||
'100' => '100 %',
|
||||
];
|
||||
|
||||
const RATIO = [
|
||||
'2' => '2:1',
|
||||
'1.333' => '4:3',
|
||||
'1.777' => '16:9'
|
||||
];
|
||||
|
||||
public function getConfig()
|
||||
{
|
||||
return include __DIR__ . '/config/module.config.php';
|
||||
|
|
|
@ -24,6 +24,7 @@ return [
|
|||
'renderSourceLink' => true,
|
||||
//'addPreLoadImage' => true,
|
||||
'width' => 600,
|
||||
'ratio' => '1.333',
|
||||
'wrapStyle' => 'overflow-y: hidden;display: flex;flex-direction: column;justify-content: center;',
|
||||
'ui_background' => 'rgba(0,0,0,0.1)',
|
||||
]
|
||||
|
|
|
@ -22,13 +22,20 @@ class Render3DBlockForm extends Form
|
|||
|
||||
$this->add([
|
||||
'name' => 'o:block[__blockIndex__][o:data][width]',
|
||||
'type' => Element\Number::class,
|
||||
'type' => Element\Select::class,
|
||||
'options' => [
|
||||
'label' => 'Width in pixels',
|
||||
],
|
||||
'attributes' => [
|
||||
'min' => '100',
|
||||
],
|
||||
'label' => 'Width',
|
||||
'value_options' => Module::MODEL_WIDTH,
|
||||
],
|
||||
]);
|
||||
|
||||
$this->add([
|
||||
'name' => 'o:block[__blockIndex__][o:data][ratio]',
|
||||
'type' => Element\Select::class,
|
||||
'options' => [
|
||||
'label' => 'Ratio',
|
||||
'value_options' => Module::RATIO,
|
||||
],
|
||||
]);
|
||||
|
||||
$this->add([
|
||||
|
@ -54,7 +61,7 @@ class Render3DBlockForm extends Form
|
|||
],
|
||||
]);
|
||||
*/
|
||||
|
||||
|
||||
$this->add([
|
||||
'name' => 'o:block[__blockIndex__][o:data][title]',
|
||||
'type' => Element\Text::class,
|
||||
|
|
|
@ -50,6 +50,7 @@ class Render3D extends AbstractBlockLayout
|
|||
'o:block[__blockIndex__][o:data][model_type]' => $data['model_type'],
|
||||
'o:block[__blockIndex__][o:data][title]' => $data['title'],
|
||||
'o:block[__blockIndex__][o:data][width]' => $data['width'],
|
||||
'o:block[__blockIndex__][o:data][ratio]' => $data['ratio'],
|
||||
'o:block[__blockIndex__][o:data][renderSourceLink]' => $data['renderSourceLink'],
|
||||
//'o:block[__blockIndex__][o:data][addPreLoadImage]' => $data['addPreLoadImage'],
|
||||
]);
|
||||
|
@ -101,6 +102,7 @@ class Render3D extends AbstractBlockLayout
|
|||
'model_type' => $model_type,
|
||||
'title' => $block->dataValue('title'),
|
||||
'width' => $width,
|
||||
'ratio' => $block->dataValue('ratio'),
|
||||
'height' => $height,
|
||||
'item_url' => $attachments[0]->item()->url(),
|
||||
'renderSourceLink' => $block->dataValue('renderSourceLink'),
|
||||
|
|
Loading…
Reference in New Issue