]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6648
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 23 Jan 2024 12:54:08 +0000 (13:54 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 23 Jan 2024 12:54:08 +0000 (13:54 +0100)
app/Models/Traits/PublicationSettings.php

index beb93e9667e6574c380b99611a77c014faca0ffc..05acef16a20c7b1668f379d0dff36cec48e26e80 100644 (file)
@@ -912,7 +912,12 @@ trait PublicationSettings
 
     protected function _sound()
     {
-        $this->addSettingField('section_sound', FormSection::class, $this->__('Effets sonores'));
+        $this->addSettingField('section_sound', FormSection::class, $this->__('Ambiance et effets sonores'));
+        $this->addSettingField('soundOn', Checkbox::class, $this->__('Activer les effets sonores à l\'ouverture'), [
+            'v2' => '{"type":"boolean","default":true,"editable":true,"label":"\\u00a7!\\u00a7Activer les effets sonores \\u00e0 l\'ouverture!\\u00a7!"}',
+            'default' => true,
+        ]);
+        $this->addSettingField('sep_ambientSound1', FormSeparator::class);
         $this->addSettingField('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!":"none","\\u00a7!\\u00a7Classique!\\u00a7!":"classic","\\u00a7!\\u00a7Papier \\u00e9pais!\\u00a7!":"heavy","\\u00a7!\\u00a7Papier fin!\\u00a7!":"light","\\u00a7!\\u00a7Silencieux!\\u00a7!":"silent","\\u00a7!\\u00a7Woosh!\\u00a7!":"woosh"}}',
             'options' => [
@@ -925,14 +930,10 @@ trait PublicationSettings
             ],
             'default' => 'classic',
         ]);
-        $this->addSettingField('soundOn', Checkbox::class, $this->__('Activer les effets sonores à l\'ouverture'), [
-            'v2' => '{"type":"boolean","default":true,"editable":true,"label":"\\u00a7!\\u00a7Activer les effets sonores \\u00e0 l\'ouverture!\\u00a7!"}',
-            'default' => true,
-        ]);
-        $this->addSettingField('soundVolume', Percent::class, $this->__('Volume des effets sonores'), ['default' => 100]);
+        $this->addSettingField('soundVolume', Percent::class, $this->__('Volume des effets sonores'), ['default' => 100, 'when' => ['soundTheme' => ['operator' => '!=', 'value' => 'none']]]);
         $this->addSettingField('sep_ambientSound', FormSeparator::class);
         $this->addSettingField('ambientSound', FilesOrURL::class, $this->__('Ambiance sonore'));
-        $this->addSettingField('ambientSoundVolume', Percent::class, $this->__('Volume de l\'ambiance sonore'), ['default' => 50]);
+        $this->addSettingField('ambientSoundVolume', Percent::class, $this->__('Volume de l\'ambiance sonore'), ['default' => 50, 'when' => ['ambientSound' => ['operator' => ['operator' => 'not_empty']]]]);
     }
 
     protected function _downloadpdf()