$this->_intro();
$this->_standardQuestions();
$this->_draganddropQuestions();
+ $this->_matchQuestions();
$this->_outro();
}
$this->addField('introImageMobile', FluidbookThemeImage::class, __('Mobile'), ['hint' => __('Taille recommandée : :size', ['size' => self::MOBILE_SIZE]), 'when' => ['introCustom' => 1]]);
}
- protected function _standardQuestions()
+ protected function _question($name, $title)
{
- $this->addField('sectionStandard', FormSection::class, __('Questions standards'));
- $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('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('standardCustom', Checkbox::class, __('Définir une forme personnalisée'));
- $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]]);
+ $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]]);
+ }
+
+ protected function _standardQuestions()
+ {
+ $this->_question('standard', __('Questions standards'));
}
protected function _draganddropQuestions()
{
- $this->addField('sectionDraganddrop', FormSection::class, __('Questions "drag & drop"'));
- $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'));
- $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]]);
+ $this->_question('draganddrop', __('Questions "drag & drop"'));
+ }
+
+ protected function _matchQuestions()
+ {
+ $this->_question('match', __('Questions "faire correspondre les propositions"'));
}
protected function _outro()