$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()
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)