From b819cdf916697a818b8f7e16f3ec1da6f50944db Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 22 May 2023 12:20:16 +0200 Subject: [PATCH] wip #5934 @0.5 --- app/Fluidbook/Compiler/Compiler.php | 4 +--- app/Models/Traits/PublicationSettings.php | 13 ++++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/Fluidbook/Compiler/Compiler.php b/app/Fluidbook/Compiler/Compiler.php index 1c2cb8a13..4228c0101 100644 --- a/app/Fluidbook/Compiler/Compiler.php +++ b/app/Fluidbook/Compiler/Compiler.php @@ -741,8 +741,6 @@ class Compiler extends Base implements CompilerInterface } - - protected function _wdirOrAbsolute($path) { $e = explode('#', $path); @@ -907,7 +905,7 @@ class Compiler extends Base implements CompilerInterface */ protected function writeSounds() { - if ($this->fluidbookSettings->soundTheme == '') { + if (!$this->fluidbookSettings->soundTheme || $this->fluidbookSettings->soundTheme === 'none') { return; } $dir = resource_path('fluidbookpublication/sounds/' . $this->fluidbookSettings->soundTheme); diff --git a/app/Models/Traits/PublicationSettings.php b/app/Models/Traits/PublicationSettings.php index 57e2c4272..dbacaea95 100644 --- a/app/Models/Traits/PublicationSettings.php +++ b/app/Models/Traits/PublicationSettings.php @@ -1097,8 +1097,15 @@ trait PublicationSettings 'translatable' => false, ]); $this->addField('section_index', FormSection::class, $this->__('Vue d\'index (vignettes)')); + $this->addField('index', Checkbox::class, $this->__('Activer l\'index'), [ + 'v2' => '{"type":"boolean","default":true,"editable":true,"label":"\\u00a7!\\u00a7Activer l index!\\u00a7!"}', + 'default' => true, + 'fake' => true, + 'store_in' => 'settings', + 'translatable' => false, + ]); $this->addField('indexAutoScroll', Checkbox::class, $this->__('Activer le scroll automatique'), [ - 'v2' => '{"type":"boolean","default":false,"editable":false,"label":"\\u00a7!\\u00a7Activer le scroll automatique!\\u00a7!"}', + 'v2' => '{"type":"boolean","default":false,"editable":true,"label":"\\u00a7!\\u00a7Activer le scroll automatique!\\u00a7!"}', 'default' => false, 'fake' => true, 'store_in' => 'settings', @@ -1247,9 +1254,9 @@ trait PublicationSettings ]); $this->addField('section_sound', FormSection::class, $this->__('Effets sonores')); $this->addField('soundTheme', SelectFromArray::class, $this->__('Thème sonore'), [ - 'v2' => '{"type":"combo","default":"classic","editable":true,"label":"\\u00a7!\\u00a7Th\\u00e8me sonore!\\u00a7!","datas":{"\\u00a7!\\u00a7Pas de son!\\u00a7!":"","\\u00a7!\\u00a7Classique!\\u00a7!":"classic","\\u00a7!\\u00a7Papier \\u00e9pais!\\u00a7!":"heavy","\\u00a7!\\u00a7Papier fin!\\u00a7!":"light","\\u00a7!\\u00a7Silencieux!\\u00a7!":"silent","\\u00a7!\\u00a7Woosh!\\u00a7!":"woosh"}}', + 'v2' => '{"type":"combo","default":"classic","editable":true,"label":"\\u00a7!\\u00a7Th\\u00e8me sonore!\\u00a7!","datas":{"\\u00a7!\\u00a7Pas de son!\\u00a7!":"none","\\u00a7!\\u00a7Classique!\\u00a7!":"classic","\\u00a7!\\u00a7Papier \\u00e9pais!\\u00a7!":"heavy","\\u00a7!\\u00a7Papier fin!\\u00a7!":"light","\\u00a7!\\u00a7Silencieux!\\u00a7!":"silent","\\u00a7!\\u00a7Woosh!\\u00a7!":"woosh"}}', 'options' => [ - '' => $this->__('Pas de son'), + 'none' => $this->__('Pas de son'), 'classic' => $this->__('Classique'), 'heavy' => $this->__('Papier épais'), 'light' => $this->__('Papier fin'), -- 2.39.5