]> _ Git - fluidbook-toolbox.git/commitdiff
wip #7347 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 28 Feb 2025 14:51:00 +0000 (15:51 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 28 Feb 2025 14:51:00 +0000 (15:51 +0100)
app/Models/Traits/PublicationSettings.php
app/SubForms/Link/Base.php
app/SubForms/Link/Object3D.php [new file with mode: 0644]

index d004923c8647bb8a5c54d576816e23eb0462739e..b7622e90c085a515a3c3b7f6daf71fe705022882 100644 (file)
@@ -388,20 +388,7 @@ trait PublicationSettings
         $this->addSettingField('vectorPages', Hidden::class, $this->__('Conserver les pages en vecteur'), [
             'hint' => '1-3,5 = 1,2,3,5',
         ]);
-//        $this->addSettingField('visualisationMode', SelectFromArray::class, $this->__('Mode de visualisation 3D'), [
-//
-//            'options' => [
-//                0 => $this->__('Mode 3D'),
-//                1 => $this->__('Mode 2D (caméra fixe et pages à plat)'),
-//                2 => $this->__('Laisser le choix à l\'utilisateur (mode 3D par défaut)'),
-//                3 => $this->__('Laisser le choix à l\'utilisateur (mode 2D par défaut)'),
-//            ],
-//            'default' => '3',
-//        ]);
-//        $this->addSettingField('antialiasReading', Checkbox::class, $this->__('Amélioration de la lisibilité en mode 2D'), [
-//
-//            'default' => true,
-//        ]);
+
         $this->addSettingField('correctCenter', Checkbox::class, $this->__('Corriger les lignes blanches entre les pages'), [
             'default' => true,
             'when' => ['mobileNavigationType' => ['book', 'landscape']],
index c60a5bba478055f1b07a914d18aa8940f30e62fd..337f8849e5ea0919664d8fcd84ad2a175aa6fdff 100644 (file)
@@ -61,7 +61,7 @@ class Base extends Form
     protected static $_acceptLottie = ['.zip', '.html', '.json', '.lottie'];
     protected static $_acceptSlideshow = ['.jpg', '.jpeg', '.png', '.svg', '.gif', '.zip'];
     protected static $_acceptPDF = ['.pdf'];
-
+    protected static $_accept3D = ['.3ds', '.fbx'];
 
     /**
      * @return array[]
@@ -113,10 +113,11 @@ class Base extends Form
             ['type' => \Fluidbook\Tools\Links\Link::COPY_TO_CLIPBOARD, 'label' => __('Copier un texte dans le presse-papiers'), 'color' => '#437ac7', 'class' => CopyToClipboard::class],
             ['type' => \Fluidbook\Tools\Links\Link::PAGE_BACKGROUND_COLOR, 'label' => __('Couleur de fond dynamique') . ' (Fluidbook Air)', 'color' => '#7502DB', 'class' => PageBackgroundColor::class],
             ['type' => \Fluidbook\Tools\Links\Link::FLUIDBOOK_TOOLBOX_ELEARNING_CONTENT, 'label' => __('Contenu e-learning'), 'color' => '#370f20', 'class' => ElearningContent::class],
+            ['type' => \Fluidbook\Tools\Links\Link::OBJECT3D, 'label' => __('Objet 3D'), 'color' => '#00ffff', 'class' => Object3D::class],
             //['type' => \Fluidbook\Tools\Links\Link::HTML5MULTIMEDIA, 'label' => __('Lien Multimédia (HTML)'), 'color' => '#34A853', 'disabled' => true, 'class' => Web::class],
             //['type' => \Fluidbook\Tools\Links\Link::BOOKMARK_CORNER, 'label' => __('Lien marque-page sur coin de page'), 'color' => '#000000', 'disabled' => true, 'class' => Web::class],
             //['type' => \Fluidbook\Tools\Links\Link::PAGE_CORNER, 'label' => __('Coin de page'), 'color' => '#f19043', 'disabled' => true, 'class' => Web::class],
-            //['type' => \Fluidbook\Tools\Links\Link::OBJECT3D, 'label' => __('Objet 3D'), 'color' => '#00ffff', 'disabled' => true, 'class' => Web::class],
+
         ];
 
         usort($res, function ($a, $b) {
diff --git a/app/SubForms/Link/Object3D.php b/app/SubForms/Link/Object3D.php
new file mode 100644 (file)
index 0000000..a85f0ca
--- /dev/null
@@ -0,0 +1,19 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use App\Fluidbook\Link\Link;
+use Cubist\Backpack\Magic\Fields\FilesOrURL;
+
+// __('!! Editeur de liens')
+class Object3D extends Base
+{
+    public $type = Link::OBJECT3D;
+    public $_integration = 'multimedia';
+    public $_multimedia = true;
+
+    public function addDestinationField()
+    {
+        $this->addField('to', FilesOrURL::class, __('Fichier 3D'), $this->getFilesOrURLEntry() + ['accept' => self::$_accept3D]);
+    }
+}