From c6e41879d954c21ab831cc06efa095a265ce2598 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 23 Jan 2024 13:54:08 +0100 Subject: [PATCH] wait #6648 --- app/Models/Traits/PublicationSettings.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/Models/Traits/PublicationSettings.php b/app/Models/Traits/PublicationSettings.php index beb93e966..05acef16a 100644 --- a/app/Models/Traits/PublicationSettings.php +++ b/app/Models/Traits/PublicationSettings.php @@ -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() -- 2.39.5