public $registerMediaConversionsUsingModelInstance = false;
+ const DESKTOP_SIZE = '1200 x 680px';
+ const MOBILE_SIZE = '390 x 844px';
+
+ const ICON_SIZE = '512 x 512px';
+
public function setFields()
{
parent::setFields();
protected function _logo()
{
$this->addField('sectionLogo', FormSection::class, __('Logo'));
- $this->addField('logo', FluidbookThemeImage::class, __('Logo'), ['accept' => '.svg,.png,.jpg', 'hint' => __('Hauteur 40px')]);
- $this->addField('favicon', FluidbookThemeImage::class, __('Icône pour favicon et apps'), ['hint' => 'Carré de 512x512px']);
+ $h = __('hauteur de 40px');
+ $this->addField('logo', FluidbookThemeImage::class, __('Logo'), ['accept' => '.svg,.png,.jpg', 'hint' => __('Taille recommandée : :size', ['size' => $h])]);
+ $this->addField('favicon', FluidbookThemeImage::class, __('Icône pour favicon et apps'), ['hint' => __('Taille recommandée : :size', ['size' => self::ICON_SIZE])]);
}
protected function _background()
$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, __('Image ou animation'), ['hint' => __('Taille recommandée : :size', ['size' => '1200 x 680px']), 'when' => ['backgroundCustom' => 1]]);
- $this->addField('', FormSeparator::class, '', ['when' => ['backgroundCustom' => 1]]);
- $this->addField('backgroundImageMobile', FluidbookThemeImage::class, __('Image ou animation'), ['hint' => __('Taille recommandée : :size', ['size' => '390 x 844px']), 'when' => ['backgroundCustom' => 1]]);
+ $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]]);
}
protected function _intro()
$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' => '1200 x 680px']), 'when' => ['introCustom' => 1]]);
- $this->addField('introImageMobile', FluidbookThemeImage::class, __('Mobile'), ['hint' => __('Taille recommandée : :size', ['size' => '390 x 844px']), 'when' => ['introCustom' => 1]]);
+ $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]]);
}
protected function _standardQuestions()
$this->addField('standardColor', 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('standardCustom', Checkbox::class, __('Définir une forme personnalisée'));
- $this->addField('standardImage', FluidbookThemeImage::class, __('Desktop'), ['hint' => __('Taille recommandée : :size', ['size' => '1200 x 160px']), 'when' => ['standardCustom' => 1]]);
- $this->addField('standardImageMobile', FluidbookThemeImage::class, __('Mobile'), ['hint' => __('Taille recommandée : :size', ['size' => '390 x 174px']), 'when' => ['standardCustom' => 1]]);
+ $this->addField('standardImage', FluidbookThemeImage::class, __('Desktop'), ['hint' => __('Taille recommandée : :size', ['size' => self::DESKTOP_SIZE]), 'when' => ['standardCustom' => 1]]);
+ $this->addField('standardImageMobile', FluidbookThemeImage::class, __('Mobile'), ['hint' => __('Taille recommandée : :size', ['size' => self::MOBILE_SIZE]), 'when' => ['standardCustom' => 1]]);
}
protected function _draganddropQuestions()
{
- $areas = [1 => 150, 2 => 210];
-
$this->addField('sectionDraganddrop', FormSection::class, __('Questions "drag & drop"'));
- foreach ($areas as $i => $h) {
- $this->addField('draganddropArea' . $i . 'Color', Color::class, __('Couleur et transparence du bloc de la zone :zone', ['zone' => $i]), ['hint' => __('Par défaut, la couleur neutre du thème'), 'allows_empty' => true]);
- }
+ $this->addField('draganddropColor', Color::class, __('Couleur et transparence des zones'), ['hint' => __('Par défaut, la couleur neutre du thème'), 'allows_empty' => true]);
$this->addField('', FormSeparator::class, '');
$this->addField('draganddropCustom', Checkbox::class, __('Définir une forme personnalisée'));
- foreach ($areas as $i => $h) {
- $this->addField('draganddropArea' . $i . 'Image', FluidbookThemeImage::class, __('Desktop Zone :zone', ['zone' => $i]), ['hint' => __('Taille recommandée : :size', ['size' => '260 x 680px']), 'when' => ['draganddropCustom' => 1]]);
- $this->addField('draganddropArea' . $i . 'ImageMobile', FluidbookThemeImage::class, __('Mobile Zone :zone', ['zone' => $i]), ['hint' => __('Taille recommandée : :size', ['size' => '390 x ' . $h . 'px']), 'when' => ['draganddropCustom' => 1]]);
- }
+ $this->addField('draganddropImage', FluidbookThemeImage::class, __('Desktop'), ['hint' => __('Taille recommandée : :size', ['size' => self::DESKTOP_SIZE]), 'when' => ['draganddropCustom' => 1]]);
+ $this->addField('draganddropImageMobile', FluidbookThemeImage::class, __('Mobile'), ['hint' => __('Taille recommandée : :size', ['size' => self::MOBILE_SIZE]), 'when' => ['draganddropCustom' => 1]]);
}
protected function _outro()
$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' => '1200 x 680px']), 'when' => ['outroCustom' => 1]]);
- $this->addField('outroImageMobile', FluidbookThemeImage::class, __('Mobile'), ['hint' => __('Taille recommandée : :size', ['size' => '390 x 844px']), 'when' => ['outroCustom' => 1]]);
+ $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('', 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')]);