From 3dc29c30adb1242573ae24761e70c6afe9283006 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 26 Aug 2025 15:52:46 +0200 Subject: [PATCH] wip #7704 @0.5 --- app/Fluidbook/Compiler/Compiler.php | 6 ++++++ app/SubForms/Link/Base.php | 1 + app/SubForms/Link/LayerMask.php | 14 ++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 app/SubForms/Link/LayerMask.php diff --git a/app/Fluidbook/Compiler/Compiler.php b/app/Fluidbook/Compiler/Compiler.php index f50bf2b3d..bbe62a6cc 100644 --- a/app/Fluidbook/Compiler/Compiler.php +++ b/app/Fluidbook/Compiler/Compiler.php @@ -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; diff --git a/app/SubForms/Link/Base.php b/app/SubForms/Link/Base.php index bc2b090a4..1bd9c2a12 100644 --- a/app/SubForms/Link/Base.php +++ b/app/SubForms/Link/Base.php @@ -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 index 000000000..73ee0ee0f --- /dev/null +++ b/app/SubForms/Link/LayerMask.php @@ -0,0 +1,14 @@ +addField("to", SelectFromArray::class, __('Calque à masquer'), ['ajax' => false, 'options' => ['texts' => __('Textes')], 'default' => 'texts']); + parent::addDestinationField(); + } +} -- 2.39.5