]> _ Git - fluidbook-toolbox.git/commitdiff
wait #7591 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 18 Jun 2025 16:09:05 +0000 (18:09 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 18 Jun 2025 16:09:05 +0000 (18:09 +0200)
app/Elearning/QuizCompiler.php
app/Models/QuizTheme.php

index e0d23100c889c800c16e1f75831ff7d414e5521a..60e86efed62f545ae1822e92128fddab81e40bf9 100644 (file)
@@ -192,6 +192,7 @@ class QuizCompiler extends Base
 
         $this->_addBackgrounds('background');
         $this->_addBackgrounds('intro');
+        $this->_addBackgrounds('outro');
         $this->_addBackgrounds('standard');
         $this->_addBackgrounds('draganddrop');
         $this->_addBackgrounds('match');
index 6bd30d2dc555b55912c4882b549b378cd51a4960..c84d2b8b02f76549b68b5560b473f8c5fa6f5346 100644 (file)
@@ -105,30 +105,34 @@ class QuizTheme extends ToolboxModel
         $this->addField('sectionBackground', FormSection::class, __('Fond'));
         $this->addField('sectionBackgroundDesc', FormSectionDescription::class, __('Par défaut, le fond utilisé est celui pour desktop.') . ' ' . __('Chargez un fichier dans la partie Mobile pour affecter un fond personnalisé pour Mobile.'));
         $this->addField('backgroundColor', Color::class, __('Couleur de fond'));
-        $this->addField('', FormSeparator::class);
-        $this->addField('backgroundCustom', Checkbox::class, __('Définir un fond personnalisé ou animé'));
-        $this->addField('backgroundImage', FluidbookThemeImage::class, __('Desktop'), ['hint' => __('Taille recommandée : :size', ['size' => self::DESKTOP_SIZE]), 'when' => ['backgroundCustom' => 1]]);
-        $this->addField('backgroundImageMobile', FluidbookThemeImage::class, __('Mobile'), ['hint' => __('Taille recommandée : :size', ['size' => self::MOBILE_SIZE]), 'when' => ['backgroundCustom' => 1]]);
+        $this->_customShape('background', true, __('Image ou animation de fond'));
+    }
+
+    protected function _customShape($name, $showSeparator = true, $label = null)
+    {
+        if ($showSeparator) {
+            $this->addField('', FormSeparator::class, '');
+        }
+        if (null === $label) {
+            $label = __('Définir une forme personnalisée');
+        }
+        $this->addField($name . 'Custom', Checkbox::class, $label);
+        $this->addField($name . 'Image', FluidbookThemeImage::class, __('Desktop'), ['hint' => __('Taille recommandée : :size', ['size' => self::DESKTOP_SIZE]), 'when' => [$name . 'Custom' => 1]]);
+        $this->addField($name . 'ImageMobile', FluidbookThemeImage::class, __('Mobile'), ['hint' => __('Taille recommandée : :size', ['size' => self::MOBILE_SIZE]), 'when' => [$name . 'Custom' => 1]]);
     }
 
     protected function _intro()
     {
         $this->addField('sectionIntro', FormSection::class, __('Écran d\'introduction'));
         $this->addField('introColor', Color::class, __('Couleur et transparence du bloc'), ['hint' => __('Par défaut, la couleur neutre du thème'), 'allows_empty' => true]);
-        $this->addField('', FormSeparator::class, '');
-        $this->addField('introCustom', Checkbox::class, __('Définir une forme personnalisée'));
-        $this->addField('introImage', FluidbookThemeImage::class, __('Desktop'), ['hint' => __('Taille recommandée : :size', ['size' => self::DESKTOP_SIZE]), 'when' => ['introCustom' => 1]]);
-        $this->addField('introImageMobile', FluidbookThemeImage::class, __('Mobile'), ['hint' => __('Taille recommandée : :size', ['size' => self::MOBILE_SIZE]), 'when' => ['introCustom' => 1]]);
+        $this->_customShape('intro');
     }
 
     protected function _question($name, $title)
     {
         $this->addField('sectionQuestion' . $name, FormSection::class, $title);
         $this->addField($name . 'Color', Color::class, __('Couleur et transparence du bloc'), ['hint' => __('Par défaut, la couleur neutre du thème'), 'allows_empty' => true]);
-        $this->addField('', FormSeparator::class, '');
-        $this->addField($name . 'Custom', Checkbox::class, __('Définir une forme personnalisée'));
-        $this->addField($name . 'Image', FluidbookThemeImage::class, __('Desktop'), ['hint' => __('Taille recommandée : :size', ['size' => self::DESKTOP_SIZE]), 'when' => [$name . 'Custom' => 1]]);
-        $this->addField($name . 'ImageMobile', FluidbookThemeImage::class, __('Mobile'), ['hint' => __('Taille recommandée : :size', ['size' => self::MOBILE_SIZE]), 'when' => [$name . 'Custom' => 1]]);
+        $this->_customShape($name);
     }
 
     protected function _standardQuestions()
@@ -151,16 +155,13 @@ class QuizTheme extends ToolboxModel
 
     protected function _outro()
     {
-        return;
         $this->addField('sectionOutro', FormSection::class, __('Conclusion'));
-        $this->addField('outroColor', Color::class, __('Couleur et transparence du bloc'), ['hint' => __('Par défaut, la couleur neutre du thème'), 'allows_empty' => true]);
-        $this->addField('', FormSeparator::class, '');
-        $this->addField('outroCustom', Checkbox::class, __('Définir une forme personnalisée'));
-        $this->addField('outroImage', FluidbookThemeImage::class, __('Desktop'), ['hint' => __('Taille recommandée : :size', ['size' => self::DESKTOP_SIZE]), 'when' => ['outroCustom' => 1]]);
-        $this->addField('outroImageMobile', FluidbookThemeImage::class, __('Mobile'), ['hint' => __('Taille recommandée : :size', ['size' => self::MOBILE_SIZE]), 'when' => ['outroCustom' => 1]]);
+        //$this->addField('outroColor', Color::class, __('Couleur et transparence du bloc'), ['hint' => __('Par défaut, la couleur neutre du thème'), 'allows_empty' => true]);
+        $this->addField('outroOverlayLeft', Checkbox::class, __('Afficher un overlay sur la partie gauche de l\'écran'), ['default' => true]);
+        $this->_customShape('outro', true);
         //$this->addField('', FormSeparator::class, '');
-        $this->addField('outroSuccessAnimation', Hidden::class, __('Animation de réussite'), ['hint' => __('390 x 390px')]);
-        $this->addField('outroFailAnimation', Hidden::class, __('Animation d\'échec'), ['hint' => __('390 x 390px')]);
+        //$this->addField('outroSuccessAnimation', Hidden::class, __('Animation de réussite'), ['hint' => __('390 x 390px')]);
+        //$this->addField('outroFailAnimation', Hidden::class, __('Animation d\'échec'), ['hint' => __('390 x 390px')]);
     }
 
     public function getTextsColor($opposite = false)