]> _ Git - fluidbook-toolbox.git/commitdiff
wip #7704 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 26 Aug 2025 13:52:46 +0000 (15:52 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 26 Aug 2025 13:52:46 +0000 (15:52 +0200)
app/Fluidbook/Compiler/Compiler.php
app/SubForms/Link/Base.php
app/SubForms/Link/LayerMask.php [new file with mode: 0644]

index f50bf2b3d25866756d094ecd25068759d20e4c19..bbe62a6cc3ee759d4bf70d16125e48ce142225ec 100644 (file)
@@ -541,6 +541,7 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
         $this->config->vectorPages = array_diff(ArrayUtil::parseRange($this->config->vectorPages), $this->config->rasterizePages);
         $this->numerotation = $this->config->numerotation = explode(',', $this->getFluidbook()->page_numbers);
         $this->config->dynamicBackgroundColor = [];
+        $this->config->masks = [];
 
         $this->initTabsConfig();
 
@@ -548,6 +549,11 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
         $this->config->hasContentLock = false;
     }
 
+    public function addMask($layer, $page, $area)
+    {
+        $this->config->push('masks', ['layer' => $layer, 'page' => $page, 'area' => $area]);
+    }
+
     public function populateConfig()
     {
         $this->config->id = $this->getFluidbook()->book_id;
index bc2b090a4539d1680250cb3c155a1cbbfd58d598..1bd9c2a122c1eceef3962fd2de942d5b2ce3d714 100644 (file)
@@ -118,6 +118,7 @@ class Base extends Form
             ['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::LAYER_MASK,'label'=>__('Masque'),'color'=>'#e34f7b','class'=>LayerMask::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],
diff --git a/app/SubForms/Link/LayerMask.php b/app/SubForms/Link/LayerMask.php
new file mode 100644 (file)
index 0000000..73ee0ee
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+
+namespace App\SubForms\Link;
+
+use Cubist\Backpack\Magic\Fields\SelectFromArray;
+
+class LayerMask extends Meta
+{
+    public function addDestinationField()
+    {
+        $this->addField("to", SelectFromArray::class, __('Calque à masquer'), ['ajax' => false, 'options' => ['texts' => __('Textes')], 'default' => 'texts']);
+        parent::addDestinationField();
+    }
+}