feat(options): Questions tab 'Question title and body' section with 6-way color choosers (row 178 plan P2)

config.xml: new section keys questiontitlefont/textcolor(+custom)/fontsize/
fontoptions + legacy fontcolor (col 1), questiontitlebackgroundcolor(+custom)
(col 2), questionbackgroundcolor(+custom) (col 3); old width-12 Prompt-U keys
and plain colorpickers replaced; questiontitlefontweight -> questiontitlefontoptions.
options.twig: title section slots (were prepared in P1), 3 keys join
aColorChooserKeys, OPTIONS_JS_TOKEN 20261129.1. options.js: same 3 keys in its
aColorChooserKeys. Views: choosers resolved via cm() (chooser wins; legacy hex
and primary/secondary modes pass through; legacy picker used when the mode key
is absent); fontoptions mapped to weight/style with legacy fontweight fallback.
build.php: chooser migration list + questiontitle fontweight migration.
All 3 variants rebuilt (defensie legacy hex -> other+custom), example config synced.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-29 14:45:57 +01:00
commit 14eb1c2a99

View file

@ -271,13 +271,14 @@ foreach ($logoPositions as $pos) {
// --- Row 115/135/149/157 migration: the color-chooser options (navbarfontcolor,
// headerbackgroundcolor, progressbarcolor, progressbarbackgroundcolor,
// progressbarfontcolor, bodybackgroundcolor, grouptitletextcolor,
// groupdescriptiontextcolor) became mode dropdowns (default|defaultbackgroundcolor|
// color1|color2|color3|other) with a <key>custom colorpicker child. A legacy HEX
// value in the json means "custom color": map it to mode "other" and move the hex
// into the <key>custom child, so the variant default stays valid for the dropdown.
// A legacy mode "primary"/"secondary" (old 4-way group textcolor dropdown) maps to
// "color1"/"color2".
$colorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor'];
// groupdescriptiontextcolor; row 180 plan P2 adds questiontitletextcolor,
// questiontitlebackgroundcolor, questionbackgroundcolor) became mode dropdowns
// (default|defaultbackgroundcolor|color1|color2|color3|other) with a <key>custom
// colorpicker child. A legacy HEX value in the json means "custom color": map it
// to mode "other" and move the hex into the <key>custom child, so the variant
// default stays valid for the dropdown. A legacy mode "primary"/"secondary"
// (old 4-way textcolor dropdown) maps to "color1"/"color2".
$colorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor', 'questiontitletextcolor', 'questiontitlebackgroundcolor', 'questionbackgroundcolor'];
$colorChooserLegacyModes = ['primary' => 'color1', 'secondary' => 'color2'];
foreach ($colorChooserKeys as $ck) {
if (isset($definition['options'][$ck])
@ -295,8 +296,10 @@ foreach ($colorChooserKeys as $ck) {
// --- Row 157 migration: the old <el>fontweight json keys (400|700) became
// <el>fontoptions (normal|bold|italic|bolditalic); map the old values and remove
// the old keys so the unknown-key check below does not fail on them.
// Row 180 plan P2: questiontitle joined (questiontitlefontweight ->
// questiontitlefontoptions).
$fontWeightToOptions = ['400' => 'normal', '700' => 'bold'];
foreach (['grouptitle', 'groupdescription'] as $el) {
foreach (['grouptitle', 'groupdescription', 'questiontitle'] as $el) {
$oldKey = $el . 'fontweight';
if (isset($definition['options'][$oldKey])) {
$w = (string) $definition['options'][$oldKey];