{# Custom options page of this theme. Activated by custom in config.xml: LimeSurvey then renders THIS file inside the "Simple options" tab of themeOptions/update (instead of the core options_core.php partial) and auto-registers options/options.js next to it. All options are rendered GENERICALLY from config.xml via aOptionAttributes (the same structure the core renderer uses, see TemplateManifest::getOptionAttributes()), grouped by category. Adding an per image group #} {% set imageOptions = '' %} {% set imgGroup = '' %} {% for image in templateConfiguration.imageFileList %} {% if image.group != imgGroup %} {% if imgGroup != '' %}{% set imageOptions = imageOptions ~ '' %}{% endif %} {% set imageOptions = imageOptions ~ '' %} {% set imgGroup = image.group %} {% endif %} {% set imageOptions = imageOptions ~ '' %} {% endfor %} {% if imgGroup != '' %}{% set imageOptions = imageOptions ~ '' %}{% endif %} {# Options-page-only styles, INLINE on purpose: this admin page does NOT load the theme's css/plain.css (that is registered for survey pages only), so anything styled from plain.css would be unstyled here. These rules cover the navbarfontcolor working example (row 115-118): the preset swatch chips under the dropdown (full column width, 10px gap, hex label BELOW each swatch) and the grayed-out look of "disable"-mode children (visible but dimmed). #} {# If this is a survey-specific (or survey-group) settings page, offer full inheritance of the parent template #} {% if bInherit %}

{% endif %} {# Every tab pane ends with the Respondage footer. The logo uses a dedicated file name (not logo.png) on purpose: variants may ship their own files/logo.png as client logo, and imageSrc() resolves './files/...' in the variant first — with this name it falls through to the mother theme, so the footer always shows the Respondage logo. #} {% set respondageLogo = imageSrc('./files/respondage-logo.png') %} {# Options that make up the TOP OF THE PAGE (everything in the header, plus the progress bar which sits in/just under the header): the menu (navbar text color), the left/center/right logos, the header background color, and the progress bar position + colors. These keys are pulled out of their original config.xml categories (Colors / Images / Progress) into a dedicated FIRST tab below. Values are stored per option key, so moving them here does not change any stored value. The order of this list is the order shown in the tab. #} {% set aTopOfPageKeys = [ 'headerfont', 'navbarfontcolor', 'navbarfontcolorcustom', 'headerbackgroundcolor', 'headerbackgroundcolorcustom', 'headersticky', 'headerstickycomputer', 'headerstickytablet', 'headerstickymobile', 'headerheight', 'brandlogofile', 'brandlogotopmargin', 'brandshowoncomputer', 'brandshowontablet', 'brandshowonmobile', 'centerlogofile', 'centerlogotopmargin', 'centershowoncomputer', 'centershowontablet', 'centershowonmobile', 'rightlogofile', 'rightlogotopmargin', 'rightshowoncomputer', 'rightshowontablet', 'rightshowonmobile', 'progressbarposition', 'progressbarfont', 'progressbarcolor', 'progressbarcolorcustom', 'progressbarbackgroundcolor', 'progressbarbackgroundcolorcustom', 'progressbarfontcolor', 'progressbarfontcolorcustom' ] %} {% set aLogoKeys = [ 'brandlogofile', 'brandlogotopmargin', 'brandshowoncomputer', 'brandshowontablet', 'brandshowonmobile', 'centerlogofile', 'centerlogotopmargin', 'centershowoncomputer', 'centershowontablet', 'centershowonmobile', 'rightlogofile', 'rightlogotopmargin', 'rightshowoncomputer', 'rightshowontablet', 'rightshowonmobile' ] %} {% set aLogoPositions = ['brand', 'center', 'right'] %} {% set aProgressKeys = ['progressbarposition', 'progressbarbackgroundcolor', 'progressbarcolor', 'progressbarfontcolor'] %} {% set aTopStickyKeys = ['headersticky', 'headerstickycomputer', 'headerstickytablet', 'headerstickymobile'] %} {% set aFontElements = ['questiontitle', 'answers', 'grouptitle', 'groupdescription', 'buttons'] %} {# row 180 / plan P2: the Questions "title" section keys joined the chooser scheme (questiontitletextcolor, questiontitlebackgroundcolor, questionbackgroundcolor); row 184 / plan P3: answerstextcolor as well; row 186 / plan P4: questionhelpbackgroundcolor as well. Must stay in sync with aColorChooserKeys in options/options.js. #} {% set aColorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor', 'questiontitletextcolor', 'questiontitlebackgroundcolor', 'questionbackgroundcolor', 'answerstextcolor', 'questionhelpbackgroundcolor', 'checkboxcolor', 'previousbuttonbackgroundcolor', 'previousbuttontextcolor', 'nextbuttonbackgroundcolor', 'nextbuttontextcolor', 'submitbuttonbackgroundcolor', 'submitbuttontextcolor'] %} {% set aShowIfValues = { 'questionborder': 'box|top', 'navbarfontcolor': 'other' } %} {% for el in aFontElements %}{% set aShowIfValues = aShowIfValues|merge({ (el ~ 'textcolor'): 'other' }) %}{% endfor %} {% for ck in aColorChooserKeys %}{% set aShowIfValues = aShowIfValues|merge({ (ck): 'other' }) %}{% endfor %} {# How a parented option behaves when the parent's value is NOT in the show-values: default 'hide' = wrapper gets d-none; 'disable' = wrapper STAYS VISIBLE but the child control is rendered disabled (grayed out) and carries data-keep-value so options.js keeps its stored value across saves. Working example: navbarfontcolor (row 115) — the custom color picker stays visible next to the mode dropdown. #} {% set aShowIfMode = { 'navbarfontcolor': 'disable' } %} {% for ck in aColorChooserKeys %}{% set aShowIfMode = aShowIfMode|merge({ (ck): 'disable' }) %}{% endfor %} {# row 174: the "Default font and colors" pane is ONE row with three col-md-4 columns: col 1 = font, fontsize, fontcolor; col 2 = defaultbackgroundcolor; col 3 = primarycolor, secondarycolor, tertiarycolor (slot mapping below) #} {% set aFontsCol1 = ['font', 'fontsize', 'fontcolor'] %} {% set aFontsCol2 = ['defaultbackgroundcolor'] %} {% set aFontsCol3 = ['primarycolor', 'secondarycolor', 'tertiarycolor'] %} {# row 186 / plan P4: the help keys moved into their own "Question help" section (aQSlots above) — legacy column 1 is empty now #} {% set aQuestionsCol1 = [] %} {# row 188 / plan P5: the border keys moved into their own "Question border" section (aQSlots above) — legacy column 2 is empty now #} {% set aQuestionsCol2 = [] %} {# row 195: checkboxcolor moved into the answers section (answers:1 below) — legacy column 3 is empty now #} {% set aQuestionsCol3 = [] %} {# row 178/179 plan: the Questions pane is built from SECTIONS — each section is an h3 + its own row of columns and ends with a full-width hr. aQSections lists the sections (id, h3, colClass); aQSlots maps each option key to "sectionId:colIndex". Keys not in aQSlots fall back to the legacy columns aQuestionsCol1/2/3 ("legacy:N") or the full-width rest ("rest"). P1 added "overall", P2 added "title"; P3-P5 add the remaining sections. #} {# row 183: the "Overall question" section is a THREE-column grid (colClass col-md-4), only the first column is used (the two distance options). Row 184 / plan P3: same for "Answer options and subquestions" (answers*) #} {% set aQSections = [ { 'id': 'overall', 'h3': 'Overall question', 'colClass': 'col-md-4' }, { 'id': 'title', 'h3': 'Question title and body', 'colClass': 'col-md-4' }, { 'id': 'answers', 'h3': 'Answer options and subquestions', 'colClass': 'col-md-4' }, { 'id': 'help', 'h3': 'Question help', 'colClass': 'col-md-4' }, { 'id': 'border', 'h3': 'Question border', 'colClass': 'col-md-4' } ] %} {% set aQSlots = { 'questiondistance': 'overall:0', 'questiondistancebottom': 'overall:0', 'questiontitlefont': 'title:0', 'questiontitletextcolor': 'title:0', 'questiontitletextcolorcustom': 'title:0', 'questiontitlefontsize': 'title:0', 'questiontitlefontoptions': 'title:0', 'questiontitlefontcolor': 'title:0', 'questiontitlebackgroundcolor': 'title:1', 'questiontitlebackgroundcolorcustom': 'title:1', 'questionbackgroundcolor': 'title:2', 'questionbackgroundcolorcustom': 'title:2', 'answersfont': 'answers:0', 'answerstextcolor': 'answers:0', 'answerstextcolorcustom': 'answers:0', 'checkboxcolor': 'answers:1', 'checkboxcolorcustom': 'answers:1', 'questionhelpfont': 'help:0', 'questionhelpfontcolor': 'help:0', 'questionhelpbackgroundcolor': 'help:1', 'questionhelpbackgroundcolorcustom': 'help:1', 'questionhelptextposition': 'help:2', 'questionborder': 'border:0', 'questionbordercolor': 'border:1', 'questionborderstyle': 'border:1', 'questiondropdown': 'border:1', 'questionborderradiusTL': 'border:2', 'questionborderradiusTR': 'border:2', 'questionborderradiusBL': 'border:2', 'questionborderradiusBR': 'border:2' } %} {# row 147: all group-related options of the "Questions" category — they are pulled out of the Questions tab into a dedicated "Groups" tab (aGroupsTab below). Values are stored per option key, so moving them does not change stored values. Row 157: the Groups pane is laid out in TWO columns (slots g1/g2 below): col 1 = group title options, col 2 = group description options. #} {% set aGroupKeys = [ 'grouptitlefont', 'grouptitletextcolor', 'grouptitletextcolorcustom', 'grouptitlefontsize', 'grouptitlefontoptions', 'groupdescriptionfont', 'groupdescriptiontextcolor', 'groupdescriptiontextcolorcustom', 'groupdescriptionfontsize', 'groupdescriptionfontoptions' ] %} {% set aGroupCol1 = ['grouptitlefont', 'grouptitletextcolor', 'grouptitletextcolorcustom', 'grouptitlefontsize', 'grouptitlefontoptions'] %} {% set aGroupCol2 = ['groupdescriptionfont', 'groupdescriptiontextcolor', 'groupdescriptiontextcolorcustom', 'groupdescriptionfontsize', 'groupdescriptionfontoptions'] %} {# row 191 / row 178 plan P6: the Buttons pane — a full-width font row at the top (buttonsfont), then ONE row with three col-md-4 columns: col 1 = Previous, col 2 = Next, col 3 = Submit (row-178 decision 1); each column holds that button's background color chooser (+custom) and text color chooser (+custom). #} {% set aButtonsCol1 = ['previousbuttonbackgroundcolor', 'previousbuttonbackgroundcolorcustom', 'previousbuttontextcolor', 'previousbuttontextcolorcustom'] %} {% set aButtonsCol2 = ['nextbuttonbackgroundcolor', 'nextbuttonbackgroundcolorcustom', 'nextbuttontextcolor', 'nextbuttontextcolorcustom'] %} {% set aButtonsCol3 = ['submitbuttonbackgroundcolor', 'submitbuttonbackgroundcolorcustom', 'submitbuttontextcolor', 'submitbuttontextcolorcustom'] %} {# Tab list: FIRST the "Default font and colors" tab (where the default/base font and the default colors are chosen), then the "Header" tab tab (keys = aTopOfPageKeys), then row 147: the "Page background" tab (the config.xml "Page background" category, id kept as 'category-images' so the stored tab preference stays valid), then the "Groups" tab (keys = aGroupKeys), then one tab per remaining category from config.xml like the core options page (keys = null: all options of that category). Row 159: config.xml category names equal these tab labels. #} {% set aTabs = [] %} {% if 'Default font and colors' in aOptionAttributes.categories %} {% set aTabs = [{ 'id': 'category-fonts', 'label': 'Default font and colors', 'category': 'Default font and colors', 'keys': null }] %} {% endif %} {% set aTabs = aTabs|merge([{ 'id': 'top-of-page', 'label': 'Header', 'category': 'Header', 'keys': aTopOfPageKeys }]) %} {# row 147/159: "Page background" category -> the Page background tab, directly after Header tab #} {% set aImagesKeys = [] %} {% for key, attr in aOptionAttributes.optionAttributes %} {% if key != 'ajaxmode' and attr.category == 'Page background' and key not in aTopOfPageKeys %} {% set aImagesKeys = aImagesKeys|merge([key]) %} {% endif %} {% endfor %} {# row 149/163: the Page background pane has an explicit key order (slot layout below): TWO columns (col-md-6 each) under the full-width intro — col 1 = overall background color (chooser + custom) + in-column hr + background image on/off; col 2 = the three image-detail options + the upload facility #} {% set aImagesPaneKeys = ['bodybackgroundcolor', 'bodybackgroundcolorcustom', 'backgroundimage', 'backgroundimagefile', 'backgroundimagefixed', 'backgroundimagedisplay'] %} {% if aImagesKeys is not empty %} {% set aTabs = aTabs|merge([{ 'id': 'category-images', 'label': 'Page background', 'category': 'Page background', 'keys': aImagesPaneKeys }]) %} {% endif %} {# row 147/157/159: dedicated "Groups" tab with all group-related options (category "Groups" in config.xml, listed in aGroupKeys) so the pane renders the slot layout below instead of the Questions 3-column grid. #} {% set aTabs = aTabs|merge([{ 'id': 'groups', 'label': 'Groups', 'category': 'Groups', 'keys': aGroupKeys }]) %} {% for category in aOptionAttributes.categories %} {% if category != 'Default font and colors' and category != 'Header' and category != 'Colors' and category != 'Page background' and category != 'Groups' and category != 'Other options' %} {# The "Colors" tab is removed on purpose. Its only remaining options are sliderhandlecolor and privacybackgroundcolor (the other Colors keys carry category "Header" now) — TODO: place these two options on another tab. #} {# Resolve this category's keys once and skip the tab entirely when none remain: e.g. "Progress" — its only option (progressbarposition) moved to the Top-of-page tab, so an empty tab must not be rendered. #} {% set catKeys = [] %} {% for key, attr in aOptionAttributes.optionAttributes %} {% if key != 'ajaxmode' and attr.category == category and key not in aTopOfPageKeys %} {% set catKeys = catKeys|merge([key]) %} {% endif %} {% endfor %} {% if catKeys is not empty %} {% set aTabs = aTabs|merge([{ 'id': 'category-' ~ category|lower|replace({' ': '-'}), 'label': category, 'category': category, 'keys': null }]) %} {% endif %} {% endif %} {% endfor %} {# row 148/159: the "Other options" category renders LAST in the tab row (id kept as 'category-simple-options' so the stored tab preference stays valid) #} {% set aSimpleKeys = [] %} {% for key, attr in aOptionAttributes.optionAttributes %} {% if key != 'ajaxmode' and attr.category == 'Other options' and key not in aTopOfPageKeys and key not in aGroupKeys %} {% set aSimpleKeys = aSimpleKeys|merge([key]) %} {% endif %} {% endfor %} {% if aSimpleKeys is not empty %} {% set aTabs = aTabs|merge([{ 'id': 'category-simple-options', 'label': 'Other options', 'category': 'Other options', 'keys': null }]) %} {% endif %}
{% for tab in aTabs %} {# Resolve which option keys this tab shows: the top-of-page tab uses the fixed order of aTopOfPageKeys; a category tab shows its config.xml options (in config.xml order) minus the top-of-page keys. #} {% set aTabKeys = tab.keys %} {% if aTabKeys is null %} {% set aTabKeys = [] %} {% for key, attr in aOptionAttributes.optionAttributes %} {# row 147: group keys are excluded here — they live in the "Groups" tab #} {% if key != 'ajaxmode' and attr.category == tab.category and key not in aTopOfPageKeys and key not in aGroupKeys %} {% set aTabKeys = aTabKeys|merge([key]) %} {% endif %} {% endfor %} {% else %} {# the top-of-page tab also picks up options that literally carry the category "Header" (so config.xml may use it after a reset) #} {% if tab.id == 'top-of-page' %} {% for key, attr in aOptionAttributes.optionAttributes %} {% if key != 'ajaxmode' and attr.category == 'Header' and key not in aTabKeys %} {% set aTabKeys = aTabKeys|merge([key]) %} {% endif %} {% endfor %} {% endif %} {% endif %} {# row 177: keys of the LAST checkbox of each consecutive checkbox run in this tab — its .form-check gets the extra class .checkbox-last (margin-bottom: 15px, see the style block), so there is 15px between a checkbox group and the following item #} {% set aLastCheckboxKeys = [] %} {% for ck in aTabKeys %} {% set cka = aOptionAttributes.optionAttributes[ck] ?? null %} {% if cka is not null and cka.type == 'checkbox' %} {% set nka = aOptionAttributes.optionAttributes[aTabKeys[loop.index] ?? ''] ?? null %} {% if nka is null or nka.type != 'checkbox' %}{% set aLastCheckboxKeys = aLastCheckboxKeys|merge([ck]) %}{% endif %} {% endif %} {% endfor %}
{% if tab.id == 'top-of-page' %}

{{ gT("Header") }}

{{ gT("The header is the top part of the page, possibly containing the name of the survey, logo's and a menu. In this part of the options you can make this header more or less distinguishable from the rest of the page and you can choose if the logo should stay on top of the page after scrolling (sticky) or not.") }}

{% endif %} {% if tab.id == 'category-fonts' %}

{{ gT("Default font and colors") }}

{{ gT("Here you choose the default font, the font that is used on most places in your version of the theme.") }}

{% endif %} {% if tab.category == 'Page background' %} {# row 149: full-width intro of the Page background tab; bgImgVal is the current value of the backgroundimage on/off switch (drives the col-2 visibility) #} {% set bgImgVal = bGeneralInherit ? 'inherit' : (aCurrentOptions['backgroundimage'] is defined ? aCurrentOptions['backgroundimage'] : (oParentOptions['backgroundimage'] is defined ? oParentOptions['backgroundimage'] : '')) %}

{{ gT("Page background (behind the body of the page)") }}

{{ gT("Set the page background here. Either just a solid color or an image.") }}

{% endif %} {% if tab.id == 'groups' %} {# row 157: full-width intro of the Groups tab, above the two columns #}

{{ gT("Groups") }}

{{ gT("Groups are more or less the same as pages. In the survey settings you can decide to show or hide the group title and the group description. Here you choose how they look when shown.") }}

{% endif %} {% if tab.category == 'Questions' %} {# row 179 / plan P1: h2 + intro of the Questions tab #}

{{ gT("Questions") }}

{{ gT("Questions are the core of a survey. Here you create your own design of how questions are displayed to your respondent.") }}

{% endif %} {% if tab.category == 'Buttons' %} {# row 191 / plan P6: h2 + intro of the Buttons tab #}

{{ gT("Buttons") }}

{{ gT("The buttons at the bottom of each page of the survey: Previous, Next and Submit. Here you choose the font and the colors of each of them.") }}

{% endif %}
{% set qLastSlot = '' %} {% set fLastSlot = 0 %} {% for key in aTabKeys %} {% set attr = aOptionAttributes.optionAttributes[key] ?? null %} {% if attr is not null %} {# Slot-based pane layouts: on a slot change the previous container is closed and the new one opened. Every slot is row+col (two divs), except 'logo' (self-contained block) and 'rest' (normal grid). Computed BEFORE the logo-block branch so the transition into the logo slot also fires. #} {% set bFontsPane = tab.category == 'Default font and colors' %} {% set bTopPane = tab.id == 'top-of-page' %} {% set bImagesPane = tab.category == 'Page background' %} {% set bGroupsPane = tab.id == 'groups' %} {% set bButtonsPane = tab.category == 'Buttons' %} {% set fSlot = 'rest' %} {% if bFontsPane %} {# row 174: one row, three col-md-4 columns — col 1 (fc1) = font/fontsize/fontcolor, col 2 (fc2) = defaultbackgroundcolor, col 3 (fc3) = the three colors #} {% if key in aFontsCol1 %}{% set fSlot = 'fc1' %} {% elseif key in aFontsCol2 %}{% set fSlot = 'fc2' %} {% elseif key in aFontsCol3 %}{% set fSlot = 'fc3' %} {% endif %} {% elseif bTopPane %} {% if key in aLogoKeys %}{% set fSlot = 'logo' %} {# row 136: header row layout — col 1 = font (headerfont) with the text color in header (navbarfontcolor + custom) stacked below it, col 2 = header background color (aligned with the color option via a measured padding-top, see alignHeaderColumns in options.js), col 3 = sticky. Slots: h1 opens the row + col 1 (further h1 keys stack in col 1), h2 = col 2, h3 = col 3. #} {% elseif key == 'headerfont' %}{% set fSlot = 'h1' %} {% elseif key == 'navbarfontcolor' %}{% set fSlot = 'h1' %} {% elseif key == 'navbarfontcolorcustom' %}{% set fSlot = 'h1' %} {% elseif key == 'headerbackgroundcolor' %}{% set fSlot = 'h2' %} {% elseif key == 'headerbackgroundcolorcustom' %}{% set fSlot = 'h2' %} {% elseif key == 'headerheight' %}{% set fSlot = 'h3' %} {% elseif key in aTopStickyKeys %}{% set fSlot = 'h3' %} {% elseif key == 'progressbarposition' %}{% set fSlot = 'ppos' %} {% elseif key == 'progressbarfont' %}{% set fSlot = 'pfont' %} {# row 135: progress bar colors row — col 1 = progress bar color, col 2 = progress background, col 3 = progress font color (custom children share their parent's column) #} {% elseif key == 'progressbarcolor' %}{% set fSlot = 'pcol1' %} {% elseif key == 'progressbarcolorcustom' %}{% set fSlot = 'pcol1' %} {% elseif key == 'progressbarbackgroundcolor' %}{% set fSlot = 'pcol2' %} {% elseif key == 'progressbarbackgroundcolorcustom' %}{% set fSlot = 'pcol2' %} {% elseif key == 'progressbarfontcolor' %}{% set fSlot = 'pcol3' %} {% elseif key == 'progressbarfontcolorcustom' %}{% set fSlot = 'pcol3' %} {% endif %} {% elseif bImagesPane %} {# row 149: Page background pane — col 1 = overall background color (chooser + custom child) + background image on/off; col 2 = the three image-detail options #} {% if key in ['bodybackgroundcolor', 'bodybackgroundcolorcustom', 'backgroundimage'] %}{% set fSlot = 'bg1' %} {% elseif key in ['backgroundimagefile', 'backgroundimagefixed', 'backgroundimagedisplay'] %}{% set fSlot = 'bg2' %} {% endif %} {% elseif bGroupsPane %} {# row 157: Groups pane — TWO columns: col 1 (g1) = group title options, col 2 (g2) = group description options #} {% if key in aGroupCol1 %}{% set fSlot = 'g1' %} {% elseif key in aGroupCol2 %}{% set fSlot = 'g2' %} {% endif %} {% elseif bButtonsPane %} {# row 191 / plan P6: Buttons pane — bfont = the full-width font row (buttonsfont), b1/b2/b3 = the Previous/Next/Submit columns #} {% if key == 'buttonsfont' %}{% set fSlot = 'bfont' %} {% elseif key in aButtonsCol1 %}{% set fSlot = 'b1' %} {% elseif key in aButtonsCol2 %}{% set fSlot = 'b2' %} {% elseif key in aButtonsCol3 %}{% set fSlot = 'b3' %} {% endif %} {% endif %} {% if fSlot != fLastSlot and (bFontsPane or bTopPane or bImagesPane or bGroupsPane or bButtonsPane) %} {% if bFontsPane %} {# row 174: column change inside the single fonts row — close the previous col-md-4, open the next one #} {% if fLastSlot == 'fc1' or fLastSlot == 'fc2' %}
{% endif %} {% if fSlot == 'fc1' %}
{% endif %} {% elseif bTopPane %} {# top-of-page transitions: close previous slot, open new slot. Header (row 136): col 1 = h1 slot (headerfont + navbarfontcolor stacked), col 2 = h2 slot (header background color), col 3 = h3 (sticky). Progress bar: first row = ppos in col 1, empty col 2, pfont in col 3; then the colors row (pcol1/pcol2/pcol3). #} {% if fLastSlot == 'h1' or fLastSlot == 'h2' %}
{% elseif fLastSlot == 'h3' %}

{{ gT("Logos") }}

{{ gT("In this theme there are three positions for separate logos, but it is up to you which positions you want to fill.") }}

{% elseif fLastSlot == 'logo' %}

{{ gT("Progress bar") }}

{{ gT("The progress bar can be switched on/off per survey in the survey settings. Here in this section you can choose how the progress bar looks when displayed.") }}

{% elseif fLastSlot == 'ppos' %}
{% elseif fLastSlot == 'pfont' %}
{% elseif fLastSlot == 'pcol1' or fLastSlot == 'pcol2' %}
{% endif %} {% if fSlot == 'h1' %}
{% elseif fSlot == 'ppos' %}
{% endif %} {% elseif bImagesPane %} {# row 149/163: Page background transitions — bg1 -> bg2 closes col 1 and opens col 2, both col-md-6 (the whole column carries option-visibility, so it is hidden when the background image is off); the first bg1 key opens col 1 #} {% if fLastSlot == 'bg1' %}
{% endif %} {% if fSlot == 'bg1' %}
{% endif %} {% elseif bGroupsPane %} {# row 157: Groups transitions — g1 -> g2 closes col 1 and opens col 2 (border-start); the first g1 key opens col 1 #} {% if fLastSlot == 'g1' %}
{% endif %} {% if fSlot == 'g1' %}
{% endif %} {% elseif bButtonsPane %} {# row 191 / plan P6: Buttons transitions — bfont -> b1 closes the font row (row+col) and opens the buttons row + col 1 (Previous); b1 -> b2 -> b3 move to the next col-md-4 with a border-start divider (row-178 decision 4 style, like the Groups columns) #} {% if fLastSlot == 'bfont' %}
{% endif %} {% if fLastSlot == 'b1' %}
{% endif %} {% if fLastSlot == 'b2' %}
{% endif %} {% if fSlot == 'bfont' %}
{% endif %} {% if fSlot == 'b1' %}
{% endif %} {% endif %} {% set fLastSlot = fSlot %} {% endif %} {% if tab.id == 'top-of-page' and key == 'brandlogofile' %}
{% for pos in aLogoPositions %} {% set fkey = pos ~ 'logofile' %} {% set mkey = pos ~ 'logotopmargin' %} {% set fattr = aOptionAttributes.optionAttributes[fkey] %} {% set mattr = aOptionAttributes.optionAttributes[mkey] %} {% set fcv = bGeneralInherit ? 'inherit' : (aCurrentOptions[fkey] is defined ? aCurrentOptions[fkey] : (oParentOptions[fkey] is defined ? oParentOptions[fkey] : '')) %} {% set mcv = bGeneralInherit ? 'inherit' : (aCurrentOptions[mkey] is defined ? aCurrentOptions[mkey] : (oParentOptions[mkey] is defined ? oParentOptions[mkey] : '')) %}
{# 1. logo file dropdown, "No logo" (value off) first #}
{# 2. margin between logo and top of screen, 0-100 px #}
{# 3. "Show logo on" per device #}
{{ gT("Show logo on") }} {% for dev in ['computer', 'tablet', 'mobile'] %} {% set ckey = pos ~ 'showon' ~ dev %} {% set cattr = aOptionAttributes.optionAttributes[ckey] %} {% set ccv = bGeneralInherit ? 'inherit' : (aCurrentOptions[ckey] is defined ? aCurrentOptions[ckey] : (oParentOptions[ckey] is defined ? oParentOptions[ckey] : '')) %}
{% endfor %}
{% endfor %}

{# row 139: a new row directly under the logos row, with just one element: the file-upload facility (same widget as in the Images tab, but with its own ids so both work — options.js binds a BindUpload per input/progress pair on the shared #upload_frontend form). The actual upload form is rendered by themeOptions/update.php #}
0%
{# row 140/141: translatable help text under the upload option, depending on where this page is shown: bInherit is true on survey / survey-group level, false on the global page #}
{% if bInherit %}{{ gT("Upload here the files for logos and background. You are in the settings for your specific survey now, so files that you upload here are available for this survey only. If you want a file to be available for all surveys, upload it at the global theme settings options page.") }}{% else %}{{ gT("Upload here the files for logos and background. You are in global settings now, so files that you upload here are available for all surveys. If you want a file to be available only for your specific survey, upload it at the theme settings options page for that specific survey.") }}{% endif %}
{% elseif key not in aLogoKeys %} {% set bQuestionsPane = tab.category == 'Questions' %} {% if bQuestionsPane %} {# row 178 plan: slot "section:colIndex" from aQSlots, legacy columns as "legacy:N", full-width rest as "rest". On a section change: close the column (+ section row), emit the full-width hr after the finished section, then the new h3 and section row. border-start only between columns of the same section/legacy grid #} {% set qSlot = aQSlots[key] ?? (key in aQuestionsCol1 ? 'legacy:1' : (key in aQuestionsCol2 ? 'legacy:2' : (key in aQuestionsCol3 ? 'legacy:3' : 'rest'))) %} {% if qSlot != qLastSlot %} {% set qSec = qSlot|split(':')[0] %}{% set qCi = qSlot|split(':')[1] %} {% set lSec = qLastSlot|split(':')[0] %}{% set lCi = qLastSlot|split(':')[1] %} {% if qLastSlot != '' and qLastSlot != 'rest' %}
{% endif %} {% if qSec != lSec %} {% if lSec != '' and lSec != 'rest' and lSec != 'legacy' %}
{% endif %} {% if lSec != '' and lSec != 'rest' and lSec != 'legacy' %}

{% endif %} {% if qSec != 'rest' and qSec != 'legacy' %} {% set qSecDef = null %}{% for s in aQSections %}{% if s.id == qSec %}{% set qSecDef = s %}{% endif %}{% endfor %}

{{ gT(qSecDef.h3) }}

{% endif %} {% endif %} {% if qSec != 'rest' %} {% if qSec == 'legacy' %}{% set qColClass = 'col-md-4' %}{% else %}{% set qSecDef = null %}{% for s in aQSections %}{% if s.id == qSec %}{% set qSecDef = s %}{% endif %}{% endfor %}{% set qColClass = qSecDef.colClass %}{% endif %}
{% endif %} {% set qLastSlot = qSlot %} {% endif %} {% endif %} {# row 163: inside a slot pane (Questions columns, Header, Page background, Groups, Fonts slots) every option wrapper is col-12 (full width of its slot column) — attr.width only applies to the plain grid panes. Without bImagesPane here the wrappers rendered col-12 col-md- INSIDE the col-md-6 slot column, i.e. only the left part of each column was used. #} {% if bQuestionsPane or bTopPane or bGroupsPane or bImagesPane or bButtonsPane or (bFontsPane and fSlot != 'rest') %}{% set wrapClass = 'col-12' %}{% else %}{% set wrapClass = 'col-12 col-md-' ~ attr.width|default(2) %}{% endif %} {# row 188 / plan P5: inside the "Question border" section's radius subcolumn the four radius options form two rows of two — their wrappers are half the column (col-md-6) instead of col-12. Row 195: the two radius subcolumns get a vertical divider — the right subcolumn (TR / BR) carries border-start #} {% if bQuestionsPane and key starts with 'questionborderradius' %}{% set wrapClass = 'col-12 col-md-6' %}{% if key == 'questionborderradiusTR' or key == 'questionborderradiusBR' %}{% set wrapClass = wrapClass ~ ' border-start' %}{% endif %}{% endif %} {# server-side current value for this option (checked/selected/value) #} {% set currentValue = bGeneralInherit ? 'inherit' : (aCurrentOptions[key] is defined ? aCurrentOptions[key] : (oParentOptions[key] is defined ? oParentOptions[key] : '')) %} {# parent != '': this field is only visible when the parent option's value is one of the show-values (default "on"; see aShowIfValues). options.js toggles .option-visibility via data-show-if-parent/data-show-if-value; the field itself is additionally disabled via data-parent/selector_radio_childfield #} {# server-side INITIAL visibility — when the parent is a buttons group or a dropdown (e.g. textcolorcustom with parent textcolor, show-value "other"), add d-none at render time unless the parent's current value is IN the show-value list. Same source of truth as currentValue (stored options JSON, fallback oParentOptions). options.js updateVisibilityByParent() toggles the same class on change (idempotent with this initial state). #} {% set bParentHidden = false %} {% set showIfValues = 'on' %} {% if attr.parent != '' and attr.parent != key %} {% set parentAttr = aOptionAttributes.optionAttributes[attr.parent] ?? null %} {% set showIfValues = aShowIfValues[attr.parent] ?? 'on' %} {% if parentAttr is not null and (parentAttr.type == 'buttons' or parentAttr.type == 'dropdown') %} {% set parentValue = bGeneralInherit ? 'inherit' : (aCurrentOptions[attr.parent] is defined ? aCurrentOptions[attr.parent] : (oParentOptions[attr.parent] is defined ? oParentOptions[attr.parent] : '')) %} {% if parentValue not in showIfValues|split('|') %}{% set bParentHidden = true %}{% endif %} {% endif %} {% endif %} {# 'disable' mode (aShowIfMode): the child stays visible but is rendered disabled server-side; options.js keeps toggling only disabled (never d-none) for these wrappers, and data-keep-value makes the serializer keep the stored child value instead of resetting it to inherit/false #} {% set bDisableMode = attr.parent != '' and (aShowIfMode[attr.parent] ?? 'hide') == 'disable' %} {% set bChildDisabled = bParentHidden and bDisableMode %} {# row 149: horizontal line inside column 1 of the Page background pane, between the overall background color and the background image switch #} {% if bImagesPane and key == 'backgroundimage' %}

{% endif %} {# row 188 / plan P5 (row-178 decision 4): horizontal line between the two radius rows inside the border section's radius subcolumn — emitted right before the bottom-left radius (full column width) #} {% if bQuestionsPane and key == 'questionborderradiusBL' %}

{% endif %}
{# row 176: checkbox options get NO mb-3 wrapper margin — the .form-check itself carries mb-1 (same as the "Show logo on" checkboxes in the Logos row), so checkbox groups are equally compact everywhere #} {# label ALWAYS above the control, for every option type EXCEPT checkbox (checkboxes carry their label to the RIGHT of the box, rendered in the checkbox branch below). d-block so the label gets its own line even next to an inline-flex control (btn-group buttons). #} {% if attr.type != 'checkbox' %} {% endif %} {% if key == 'headersticky' %} {% elseif attr.type == 'buttons' %} {# buttons type: one radio per value of options="a|b", labels from optionlabels="A|B" #} {% set optValues = attr.options|split('|') %} {% set optLabels = attr.optionlabels|split('|') %}
{% for optValue in optValues %} {# row 144: a newline in an option label ( in config.xml survives XML attribute normalization) renders as a
. Split the RAW label first: gT() html-escapes a newline to , which would make the split a no-op. Each part is then gT()'d (html-escaped) separately, so no raw HTML from translations #} {% endfor %} {% if bInherit %} {% endif %}
{% elseif attr.type == 'checkbox' %} {# checkbox: checked = "on", unchecked = "off". The box comes BEFORE its label (classic .form-check, label to the right of the box); the label keeps the same id (lbl_simple_edit_options_) so tests/JS anchors keep working. With survey-level inherit, an untouched box keeps the value "inherit" (options.js: data was-inherit). Children of a parent switch get selector_radio_childfield + data-parent. Row 176: mb-1 on the .form-check (exactly like the "Show logo on" boxes in the Logos row) — the distance between the checkbox rows is then the same in every row of the page. Row 177: the LAST checkbox of a run also gets .checkbox-last (margin-bottom 15px) for the gap to the following item. #}
{% elseif attr.type == 'dropdown' %} {% set ddClasses = 'form-select selector_option_value_field' %} {% if attr.parent != '' %}{% set ddClasses = ddClasses ~ ' selector_radio_childfield' %}{% endif %} {% if tab.category == 'Page background' %}{% set ddClasses = ddClasses ~ ' selector_image_selector' %}{% endif %} {% if key == 'font' %}{% set ddClasses = ddClasses ~ ' selector_fontselect' %}{% endif %} {% if key in aColorChooserKeys %}{% set ddClasses = ddClasses ~ ' selector_color_mode' %}{% endif %} {% elseif attr.type == 'fontselect' %} {# fontselect (per-element font override): the SAME font choices as the base "font" dropdown — the optgroups are shared, so bundled and variant-custom fonts appear here automatically — plus a first option "Same as base font" (value "base": the views then put no extra class on the element, it inherits the body font). options.js collects the packages of ALL .selector_fontselect selects into packages_to_load. #} {% set fontAttr = aOptionAttributes.optionAttributes['font'] ?? null %} {% elseif attr.type == 'imagefile' %} {% elseif attr.type == 'colorpicker' %}
{% if bInherit %}
{% endif %}
{% elseif attr.type == 'duration' %} {% elseif attr.type == 'text' %} {% endif %} {# row 135: extra tip underneath the whole "Progress bar font color" option (attached to its custom child, which renders last in the same column, so the tip sits at the bottom of the option) #} {% if key == 'progressbarfontcolorcustom' %}
{{ gT("Make this font color the same color as the color of the progress bar when you do not want to see the progress in %.") }}
{% endif %}
{% endif %} {% endif %} {% endfor %} {% if tab.category == 'Page background' %} {# row 149/150/163: close the open Page background column (two col-md-6 columns, no empty third). Row 150: INSIDE col 2, under the image options, the upload facility + help text — the column div carries option-visibility on backgroundimage, so the upload only shows when the image is on. The actual upload form (#upload_frontend) is rendered by themeOptions/update.php #} {% if fLastSlot == 'bg2' %}
0%
{# same translatable, scope-dependent help text as under the upload widget in the Header tab (rows 140/141) #}
{% if bInherit %}{{ gT("Upload here the files for logos and background. You are in the settings for your specific survey now, so files that you upload here are available for this survey only. If you want a file to be available for all surveys, upload it at the global theme settings options page.") }}{% else %}{{ gT("Upload here the files for logos and background. You are in global settings now, so files that you upload here are available for all surveys. If you want a file to be available only for your specific survey, upload it at the theme settings options page for that specific survey.") }}{% endif %}
{% elseif fLastSlot == 'bg1' %}
{% endif %} {% endif %} {% if tab.category == 'Questions' and qLastSlot != '' and qLastSlot != 'rest' %} {% set lSecEnd = qLastSlot|split(':')[0] %} {% if lSecEnd != 'legacy' %}
{% else %}
{% endif %} {% endif %} {# row 157: close the open Groups column (each groups slot opens exactly one div: the col-md-6) #} {% if tab.id == 'groups' and fLastSlot in ['g1', 'g2'] %}
{% endif %} {# row 191 / plan P6: close the open Buttons slot (bfont opened row+col-12, b1/b2/b3 opened one col inside the buttons row — both close two divs) #} {% if tab.category == 'Buttons' and fLastSlot in ['bfont', 'b1', 'b2', 'b3'] %}
{% endif %} {# close an open slot container at the end of a Fonts/Top-of-page pane (every non-logo, non-rest slot has exactly two open divs: row + col) #} {% if (tab.category == 'Default font and colors' or tab.id == 'top-of-page') and fLastSlot != 0 and fLastSlot != 'rest' and fLastSlot != 'logo' %}
{% endif %} {# row 150: the upload facility is NOT full-width at the bottom any more — it lives INSIDE column 2 of the Page background pane (see the end-of-loop closure above), so it shows/hides together with the image options #} {# Footer at the bottom of every tab: "Proudly developed by [Respondage logo]", linking to https://www.respondage.nl #} {% if respondageLogo %} {% endif %} {% endfor %} {# HOIST TABS: with optionspage=custom, core renders this whole page inside one outer "Simple options" tab (ul#theme-options-tabs > li > #simple). Move our tab buttons into the outer tab bar, our panes into the outer .tab-content and everything else (spinner, inherit row, hr) above the outer tab bar, then drop the #simple wrapper — so our category tabs sit at the SAME level as the outer bar. Inline (rendered into the page HTML, so it runs on every fresh page load even with a heuristically cached options.js; idempotent). Bootstrap 5 tabs use delegated click handlers on document, so the moved buttons keep working without re-init. #} {{ registerScript('respondage-hoist-tabs', "(function(){function hoist(){var outer=document.getElementById('theme-options-tabs');var simple=document.getElementById('simple');if(!outer||!simple){return;}var innerNav=null,innerContent=null,i;var kids=Array.prototype.slice.call(simple.children);for(i=0;i