vanilla_respondage/views/subviews/header/custom_header.twig
Tammo ter Hark d8ee93a1c0 fix(security): sanitize theme option values at emission (S1) and escape imagefile option HTML (S2)
S1 (HIGH, SECURITY_REVIEW_20261129.md): LimeSurvey renders theme twig with
autoescape OFF, so stored option values are untrusted on the public survey
pages. New views/subviews/security_macros.twig provides validators (color,
length, keyword, fontslug, pxnum, iconcode) applied at every emission point:
the <style> block in custom_header.twig (incl. the resolved values of the
cm()/cmbg() chooser macros), the inline style="color:..." and font-<slug>
class attributes in all survey subviews, and the <body> font class +
data-thememode in the newly overridden layout_global.twig and
layout_survey_list.twig. Crafted values fall back to the configured
defaults; legitimate picker/enum/slug values pass unchanged.

S2 (MEDIUM): options/options.twig escapes group/preview/filepath/filename
with |e('html_attr')/|e('html') when building the imagefile <option> HTML.

Verified: twig compile of all changed templates, malicious-value renders
neutralized + legit renders unchanged, live surveys 216664/282267 render
correct colors with no twig errors, jsdom custom_js tests pass (options_*
tests still need /tmp fixtures, pre-existing), export_public.sh exit 0.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-11-30 11:27:38 +01:00

420 lines
25 KiB
Twig

{#
LimeSurvey
Copyright (C) 2007-2017 The LimeSurvey Project Team / Louis Gac
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.
(¯`·._.·(¯`·._.· Custom Header ·._.·´¯)·._.·´¯)
If you extend a template, and want to add custom headers (js, css, scripts, meta etc), you'd rather do it here.
#}
{# Custom logo option #}
{# Custom backgroud option #}
{# Row 135/149: resolve a color-chooser MODE value to the effective color — used for
headerbackgroundcolor, the progress bar colors and bodybackgroundcolor below
(navbarfontcolor keeps its own inline expression further down). Modes: default|defaultbackgroundcolor|
color1|color2|color3|other, or a raw hex (legacy stored value) which passes
through directly. Row 180 / plan P2: legacy modes "primary"/"secondary" of the
old 4-way <el>textcolor dropdowns map to color1/color2 as well. #}
{% macro cm(mode, custom, opts) -%}
{%- set m = mode|default('') -%}
{%- set r = m matches '/^#[0-9a-fA-F]{3,8}$/' ? m : (m == 'color1' or m == 'primary' ? opts.primarycolor|default('') : (m == 'color2' or m == 'secondary' ? opts.secondarycolor|default('') : (m == 'color3' ? opts.tertiarycolor|default('') : (m == 'defaultbackgroundcolor' ? opts.defaultbackgroundcolor|default('') : (m == 'other' ? custom|default('') : opts.fontcolor|default('')))))) -%}
{#- S1 (SECURITY_REVIEW_20261129.md): validate the RESOLVED value as well — it can
come from another raw option (primarycolor, *custom, legacy stored value).
Hex or plain color keyword only; anything else resolves to '' (the CSS
declaration is then dropped and the stylesheet default applies). Same
validation as sec.color() in security_macros.twig (twig macros cannot call
imported macros, so it is inlined here). -#}
{{- (r matches '/^#[0-9a-fA-F]{3,8}$/' or r matches '/^[a-zA-Z]{3,20}$/') ? r : '' -}}
{%- endmacro %}
{# Row 191 / row 178 plan P6: like cm(), but for BACKGROUND choosers — mode
"default" means "no override" (empty string), so the Bootstrap button default
(btn-primary / btn-outline-secondary) stays; all other modes resolve the same
way as cm(). Used for the per-button background colors of the navigator. #}
{% macro cmbg(mode, custom, opts) -%}
{%- set m = mode|default('') -%}
{%- set r = m matches '/^#[0-9a-fA-F]{3,8}$/' ? m : (m == 'color1' or m == 'primary' ? opts.primarycolor|default('') : (m == 'color2' or m == 'secondary' ? opts.secondarycolor|default('') : (m == 'color3' ? opts.tertiarycolor|default('') : (m == 'defaultbackgroundcolor' ? opts.defaultbackgroundcolor|default('') : (m == 'other' ? custom|default('') : ''))))) -%}
{#- S1: same resolved-value validation as cm() above. -#}
{{- (r matches '/^#[0-9a-fA-F]{3,8}$/' or r matches '/^[a-zA-Z]{3,20}$/') ? r : '' -}}
{%- endmacro %}
{% import _self as cmm %}
{# S1 (SECURITY_REVIEW_20261129.md): sanitizers for option values emitted raw below
(autoescape is OFF in LimeSurvey theme twig). #}
{% import './subviews/security_macros.twig' as sec %}
<style>
html, body {
font-size: {{ sec.length(aSurveyInfo.options.fontsize|default('16px'), '16px') }} !important;
}
{% if (aSurveyInfo.options.backgroundimage == "on" and imageSrc(aSurveyInfo.options.backgroundimagefile )) %}
body {
background-image: url({{ imageSrc(aSurveyInfo.options.backgroundimagefile ) }});
background-attachment: {{ sec.keyword(aSurveyInfo.options.backgroundimagefixed|default('scroll'), 'scroll') }};
background-size: {{ sec.keyword(aSurveyInfo.options.backgroundimagedisplay|default('tile'), 'tile') }};
}
body .top-container {
background-color: rgba(236, 240, 241, 0.2);
}
{% endif %}
body {
padding-bottom: 10px;
/*padding-top: 60px;!* now is redefine in JS to fit any title length *!*/
background-color:{{ cmm.cm(aSurveyInfo.options.bodybackgroundcolor|default('defaultbackgroundcolor'), aSurveyInfo.options.bodybackgroundcolorcustom|default(''), aSurveyInfo.options) }} ;
color: {{ sec.color(aSurveyInfo.options.fontcolor|default('#444444'), '#444444') }};
}
{# Row 207: the theme footer "Proudly developed by [logo]" — text in the default
(body) font at the BASE font size, in Color 2 (secondarycolor); the logo
height 25px is static in css/custom.css. The footer itself is rendered by
views/subviews/footer/footer.twig on every page except the welcome page. #}
.respondage-theme-footer {
font-size: {{ sec.length(aSurveyInfo.options.fontsize|default('16px'), '16px') }};
color: {{ sec.color(aSurveyInfo.options.secondarycolor|default('#ef476f'), '#ef476f') }};
}
.table {
color: {{ sec.color(aSurveyInfo.options.fontcolor|default('#444444'), '#444444') }};
}
{# Row 180 / plan P2: the question title now uses the color-chooser scheme —
questiontitletextcolor + questiontitletextcolorcustom (text) and
questiontitlebackgroundcolor + questiontitlebackgroundcolorcustom
(background), resolved via cm() (default modes: text "other" per row 178,
background "color1"; legacy stored hex passes through). The CHOOSER wins
when the mode key exists in the stored options; a row from before P2 (no
questiontitletextcolor key) falls back to the legacy plain picker
questiontitlefontcolor. questiontitlefontoptions (normal|bold|italic|
bolditalic) replaces questiontitlefontweight (400|700) — a legacy stored
weight is mapped like the group title/description (row 157). #}
{% set sQTitleFontOptions = aSurveyInfo.options.questiontitlefontoptions|default(aSurveyInfo.options.questiontitlefontweight|default('700') == '700' ? 'bold' : 'normal') %}
{% set sQTitleBackgroundColor = cmm.cm(aSurveyInfo.options.questiontitlebackgroundcolor|default('color1'), aSurveyInfo.options.questiontitlebackgroundcolorcustom|default(''), aSurveyInfo.options) %}
{% set sQTitleTextColor = aSurveyInfo.options.questiontitletextcolor is defined ? cmm.cm(aSurveyInfo.options.questiontitletextcolor, aSurveyInfo.options.questiontitletextcolorcustom|default(''), aSurveyInfo.options) : aSurveyInfo.options.questiontitlefontcolor|default('') %}
.question-title-container {
font-size: {{ sec.length(aSurveyInfo.options.questiontitlefontsize|default('1.2rem'), '1.2rem') }};
font-weight: {{ sQTitleFontOptions == 'bold' or sQTitleFontOptions == 'bolditalic' ? '700' : '400' }};
font-style: {{ sQTitleFontOptions == 'italic' or sQTitleFontOptions == 'bolditalic' ? 'italic' : 'normal' }};
background: {{ sQTitleBackgroundColor }};
color: {{ sQTitleTextColor }};
}
{# Row 157: group title/description font OPTIONS (config.xml <el>fontoptions:
normal|bold|italic|bolditalic) mapped to font-weight + font-style. Until the
theme is reset, a legacy stored <el>fontweight ("400"/"700") is mapped onto
the new values; the defaults keep the old look (title bold, description normal). #}
{% set sGroupTitleFontOptions = aSurveyInfo.options.grouptitlefontoptions|default(aSurveyInfo.options.grouptitlefontweight|default('700') == '700' ? 'bold' : 'normal') %}
{% set sGroupDescFontOptions = aSurveyInfo.options.groupdescriptionfontoptions|default(aSurveyInfo.options.groupdescriptionfontweight|default('400') == '700' ? 'bold' : 'normal') %}
.group-title {
font-size: {{ sec.length(aSurveyInfo.options.grouptitlefontsize|default('2.0rem'), '2.0rem') }};
font-weight: {{ sGroupTitleFontOptions == 'bold' or sGroupTitleFontOptions == 'bolditalic' ? '700' : '400' }};
font-style: {{ sGroupTitleFontOptions == 'italic' or sGroupTitleFontOptions == 'bolditalic' ? 'italic' : 'normal' }};
}
.group-description {
font-size: {{ sec.length(aSurveyInfo.options.groupdescriptionfontsize|default('1.2rem'), '1.2rem') }};
font-weight: {{ sGroupDescFontOptions == 'bold' or sGroupDescFontOptions == 'bolditalic' ? '700' : '400' }};
font-style: {{ sGroupDescFontOptions == 'italic' or sGroupDescFontOptions == 'bolditalic' ? 'italic' : 'normal' }};
}
.privacy-block, .privacy .form-check {
background-color: {{ sec.color(aSurveyInfo.options.privacybackgroundcolor|default('lightyellow'), 'lightyellow') }};
}
{% if ( aSurveyInfo.options.brandlogofile|default('off') not in ['off', '', 'inherit'] and aSurveyInfo.options.brandlogo|default('on') != 'off' ) %}
body .top-container {
margin-top: 0;
}
{% endif %}
{# Row 179 / plan P1: distances in the Questions tab ("Overall question" section).
Free text in px or rem (default 30px); only emitted when the value matches
^<number>(px|rem)$ — anything else falls back to 30px. questiondistance is
the margin-bottom between two question containers (parent theme.css uses
2em), questiondistancebottom the margin-top of the bottom navigator with
the Previous/Next/Submit buttons. #}
{% set sQuestionDistance = aSurveyInfo.options.questiondistance|default('30px') %}
{% set sQuestionDistanceBottom = aSurveyInfo.options.questiondistancebottom|default('30px') %}
.question-container {
margin-bottom: {{ sQuestionDistance matches '/^\\d+(\\.\\d+)?(px|rem)$/' ? sQuestionDistance : '30px' }};
}
#navigator-container {
margin-top: {{ sQuestionDistanceBottom matches '/^\\d+(\\.\\d+)?(px|rem)$/' ? sQuestionDistanceBottom : '30px' }};
}
{% if (aSurveyInfo.options.questionborder == "box" ) %}
.question-container,
#welcome-container,
.save-form,
#surveys-list-container,
.privacy {
border: 1px {{ sec.keyword(aSurveyInfo.options.questionborderstyle|default('solid'), 'solid') }} {{ cmm.cm(aSurveyInfo.options.questionbordercolor|default('default'), aSurveyInfo.options.questionbordercolorcustom|default('#cccccc'), aSurveyInfo.options) }};
}
{% endif %}
{% if (aSurveyInfo.options.questionborder == "top" ) %}
.question-container,
#welcome-container,
.save-form,
#surveys-list-container,
.privacy {
border-top: 1px {{ sec.keyword(aSurveyInfo.options.questionborderstyle|default('solid'), 'solid') }} {{ cmm.cm(aSurveyInfo.options.questionbordercolor|default('default'), aSurveyInfo.options.questionbordercolorcustom|default('#cccccc'), aSurveyInfo.options) }};
}
{% endif %}
{% if (aSurveyInfo.options.questionborder == "none" ) %}
.question-container,
#welcome-container,
.save-form,
#surveys-list-container,
.privacy {
border: none;
}
{% endif %}
{# Row 201: the border radii are duration options — the stored value already
carries the unit ("5px", "0.5rem"), so emit it AS-IS. (Appending "px" here
rendered "5pxpx" — an invalid declaration the browser silently drops, so no
radius showed in the survey at all.) Values not matching <number>(px|rem)
fall back to 5px. The regex deliberately uses [0-9] and [.] instead of
backslash escapes to avoid twig-string/PCRE escaping pitfalls. #}
{% set sRadiusTL = aSurveyInfo.options.questionborderradiusTL|default('5px') %}
{% set sRadiusTR = aSurveyInfo.options.questionborderradiusTR|default('5px') %}
{% set sRadiusBR = aSurveyInfo.options.questionborderradiusBR|default('5px') %}
{% set sRadiusBL = aSurveyInfo.options.questionborderradiusBL|default('5px') %}
{% set sRadiusTL = sRadiusTL matches '/^[0-9]+([.][0-9]+)?(px|rem)$/' ? sRadiusTL : '5px' %}
{% set sRadiusTR = sRadiusTR matches '/^[0-9]+([.][0-9]+)?(px|rem)$/' ? sRadiusTR : '5px' %}
{% set sRadiusBR = sRadiusBR matches '/^[0-9]+([.][0-9]+)?(px|rem)$/' ? sRadiusBR : '5px' %}
{% set sRadiusBL = sRadiusBL matches '/^[0-9]+([.][0-9]+)?(px|rem)$/' ? sRadiusBL : '5px' %}
.question-container,
#welcome-container,
.save-form,
#surveys-list-container,
.privacy {
border-radius: {{ sRadiusTL }} {{ sRadiusTR }} {{ sRadiusBR }} {{ sRadiusBL }};
}
.question-title-container{
border-radius: {{ sRadiusTL }} {{ sRadiusTR }} 0 0;
}
{% if (aSurveyInfo.options.questiondropdown == "on" ) %}
.question-container,
#welcome-container,
.privacy-block,
.save-form,
#surveys-list-container {
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4);
}
.privacy{
margin-top:30px;
}
{% endif %}
{% if (aSurveyInfo.options.questiondropdown == "hover" ) %}
.question-container:hover,
#welcome-container:hover,
.save-form:hover,
#surveys-list-container:hover,
.privacy:hover {
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4);
}
.privacy{
margin-top:30px;
}
{% endif %}
{# Row 135: headerbackgroundcolor is a MODE dropdown now (see navbarfontcolor
below) — resolve the effective color via the shared partial. Default mode
"defaultbackgroundcolor"; a legacy stored hex passes through. #}
{% set sHeaderBackgroundColor = cmm.cm(aSurveyInfo.options.headerbackgroundcolor|default('defaultbackgroundcolor'), aSurveyInfo.options.headerbackgroundcolorcustom|default(''), aSurveyInfo.options) %}
.navbar-light{
background-color: {{ sHeaderBackgroundColor }};
}
{# THEME ADDITION: sticky header per screen size (options
headersticky{computer,tablet,mobile}; Prompt L — the master key
"headersticky" no longer gates this). Breakpoints are Bootstrap's
defaults: phone < md (768px), tablet = md..lg (768-991px),
computer >= lg (992px). The rules are the same as Bootstrap's
.fixed-top, but only inside the selected range(s). Only emitted when
the checkbox options exist (after a theme reset); before that nav_bar.twig
keeps the fixed-top class (old behaviour). Defaults when a checkbox is
undefined: computer on, tablet on, mobile off. #}
{% if aSurveyInfo.options.headerstickycomputer is defined %}
{% if aSurveyInfo.options.headerstickycomputer|default('on') == 'on' %}
@media (min-width: 992px) { #survey-nav { position: fixed; top: 0; right: 0; left: 0; z-index: 1030; } }
{% endif %}
{% if aSurveyInfo.options.headerstickytablet|default('on') == 'on' %}
@media (min-width: 768px) and (max-width: 991.98px) { #survey-nav { position: fixed; top: 0; right: 0; left: 0; z-index: 1030; } }
{% endif %}
{% if aSurveyInfo.options.headerstickymobile|default('off') == 'on' %}
@media (max-width: 767.98px) { #survey-nav { position: fixed; top: 0; right: 0; left: 0; z-index: 1030; } }
{% endif %}
{% endif %}
{# Prompt M: per-logo top margin (options <pos>logotopmargin hold a plain px
number 0-100; the "px" unit is added here. |replace({'px':''}) guards
against a legacy stored value that still carries the unit. Row 138
default: 30 px. Emitted as margin-top on the logo container: together with
the padding-top:0 on .logo-container / .logo-container > img and the
top-aligned header in css/plain.css (sass/plain.sass), the value is the
EXACT distance from the top of the header to the top of the logo —
0 px means the logo touches the top of the page. #}
#survey-nav .logo-left.logo-container {
margin-top: {{ sec.pxnum(aSurveyInfo.options.brandlogotopmargin|default('30')|replace({'px': ''}), '30') }}px;
}
#survey-nav .logo-center.logo-container {
margin-top: {{ sec.pxnum(aSurveyInfo.options.centerlogotopmargin|default('30')|replace({'px': ''}), '30') }}px;
}
#survey-nav .logo-right.logo-container {
margin-top: {{ sec.pxnum(aSurveyInfo.options.rightlogotopmargin|default('30')|replace({'px': ''}), '30') }}px;
}
{# Row 138: header bar height (option headerheight, plain px number; the "px"
unit is added here, |replace guards a legacy value with the unit). Applied
as min-height so taller logos can still grow the bar — the sticky body
padding in scripts/custom.js follows the real nav height. #}
#survey-nav {
min-height: {{ sec.pxnum(aSurveyInfo.options.headerheight|default('90')|replace({'px': ''}), '90') }}px;
}
{# Row 115 working example: navbarfontcolor is now a MODE dropdown
(default|color1|color2|color3|other). Resolve the effective color:
default -> fontcolor, color1/2/3 -> primarycolor/secondarycolor/tertiarycolor,
other -> navbarfontcolorcustom. A raw hex value (legacy stored value from
before the dropdown existed, or a hand-set one) is used directly. #}
{% set sNavbarFontColorMode = aSurveyInfo.options.navbarfontcolor|default('default') %}
{% set sNavbarFontColor = sec.color(sNavbarFontColorMode matches '/^#[0-9a-fA-F]{3,8}$/' ? sNavbarFontColorMode : (sNavbarFontColorMode == 'color1' ? aSurveyInfo.options.primarycolor|default('') : (sNavbarFontColorMode == 'color2' ? aSurveyInfo.options.secondarycolor|default('') : (sNavbarFontColorMode == 'color3' ? aSurveyInfo.options.tertiarycolor|default('') : (sNavbarFontColorMode == 'defaultbackgroundcolor' ? aSurveyInfo.options.defaultbackgroundcolor|default('') : (sNavbarFontColorMode == 'other' ? aSurveyInfo.options.navbarfontcolorcustom|default('') : aSurveyInfo.options.fontcolor|default('')))))), '#444444') %}
#survey-nav .navbar-nav > li > a,
#survey-nav .navbar-nav .nav-link {
color: {{ sNavbarFontColor }};
}
#survey-nav .navbar-nav > li > a:hover,
#survey-nav .navbar-nav > li > a:focus,
#survey-nav .navbar-nav .nav-link:hover,
#survey-nav .navbar-nav .nav-link:focus {
color: {{ sNavbarFontColor }};
opacity: 0.75;
}
{# Row 135: the progress bar colors are MODE dropdowns now — resolve via the
shared partial. Defaults: background = Default background color, bar = Color 1,
font = Default font color; legacy stored hex passes through. #}
{% set sProgressBarBackgroundColor = cmm.cm(aSurveyInfo.options.progressbarbackgroundcolor|default('defaultbackgroundcolor'), aSurveyInfo.options.progressbarbackgroundcolorcustom|default(''), aSurveyInfo.options) %}
{% set sProgressBarColor = cmm.cm(aSurveyInfo.options.progressbarcolor|default('color1'), aSurveyInfo.options.progressbarcolorcustom|default(''), aSurveyInfo.options) %}
{% set sProgressBarFontColor = cmm.cm(aSurveyInfo.options.progressbarfontcolor|default('default'), aSurveyInfo.options.progressbarfontcolorcustom|default(''), aSurveyInfo.options) %}
.progress {
background: {{ sProgressBarBackgroundColor }};
}
label::after,
.radio-item label::after{
background-color: {{ cmm.cm(aSurveyInfo.options.checkboxcolor|default('other'), aSurveyInfo.options.checkboxcolorcustom|default('#ff005f'), aSurveyInfo.options) }};
}
.progress-bar {
background: {{ sProgressBarColor }};
color: {{ sProgressBarFontColor }};
}
{# Row 180 / plan P2: the question body background is a color chooser now
(questionbackgroundcolor, default mode "defaultbackgroundcolor", +
questionbackgroundcolorcustom for "other"); a legacy stored hex passes
through cm() directly. #}
.question-container, #welcome-container {
background: {{ cmm.cm(aSurveyInfo.options.questionbackgroundcolor|default('defaultbackgroundcolor'), aSurveyInfo.options.questionbackgroundcolorcustom|default(''), aSurveyInfo.options) }};
}
{# Row 186 / plan P4, revised row 196/197: the question help background is a
color chooser (questionhelpbackgroundcolor, default mode "color3" since row
196; a legacy stored hex passes through cm()) AND the help font color is a
chooser too (questionhelpfontcolor, 6-way + questionhelpfontcolorcustom,
default mode "default" = the default font color; legacy hex passes through
cm() as well). #}
.question-help-container, .question-valid-container {
background: {{ cmm.cm(aSurveyInfo.options.questionhelpbackgroundcolor|default('color3'), aSurveyInfo.options.questionhelpbackgroundcolorcustom|default('#fff3cd'), aSurveyInfo.options) }};
color: {{ cmm.cm(aSurveyInfo.options.questionhelpfontcolor|default('default'), aSurveyInfo.options.questionhelpfontcolorcustom|default('#444444'), aSurveyInfo.options) }};
}
{# row 221: sliderhandlecolor is a 6-way color chooser (default "color2") with a
sliderhandlecolorcustom child — resolve via cm(); a legacy stored hex passes
through cm() directly. #}
.slider-handle {
background: {{ cmm.cm(aSurveyInfo.options.sliderhandlecolor|default('color2'), aSurveyInfo.options.sliderhandlecolorcustom|default('#5e1c64'), aSurveyInfo.options) }};
}
.btn-primary {
background: {{ sec.color(aSurveyInfo.options.primarycolor|default('#26547c'), '#26547c') }};
}
.bg-primary{
background-color: {{ sQTitleBackgroundColor }};
color: {{ sQTitleTextColor }};
}
.btn-primary:hover, .btn-primary:focus {
background: {{ sec.color(aSurveyInfo.options.primarycolor|default('#26547c'), '#26547c') }};
}
.btn-check:active+.btn-primary,
.btn-check:checked+.btn-primary,
.btn-primary.active,
.btn-primary:active,
.show>.btn-primary.dropdown-toggle,
.show > .btn-primary.dropdown-toggle,
.btn-primary:focus {
background: {{ sec.color(aSurveyInfo.options.primarycolor|default('#26547c'), '#26547c') }};
}
{# Row 191 / row 178 plan P6: per-button colors for the navigator buttons
(classes respondage-btn-prev/-next/-submit from navigator.twig).
Backgrounds resolve via cmbg() (mode "default" = no rule = Bootstrap
default button background), text colors via cm() (mode "default" = the
default font color). Row-178 decision 7 defaults: Next/Submit background =
Color 1, text = Other ... #ffffff; Previous background = Other ... #ffffff,
text = Default font color. Legacy stored hex values pass through both
macros. The :hover/:focus/:active variants keep the same specificity as
Bootstrap's .btn-primary:hover rules above and win because this style
block is emitted later. #}
{% set sPrevBtnBg = cmm.cmbg(aSurveyInfo.options.previousbuttonbackgroundcolor|default('other'), aSurveyInfo.options.previousbuttonbackgroundcolorcustom|default('#ffffff'), aSurveyInfo.options) %}
{% set sPrevBtnColor = cmm.cm(aSurveyInfo.options.previousbuttontextcolor|default('default'), aSurveyInfo.options.previousbuttontextcolorcustom|default(''), aSurveyInfo.options) %}
{% set sNextBtnBg = cmm.cmbg(aSurveyInfo.options.nextbuttonbackgroundcolor|default('color1'), aSurveyInfo.options.nextbuttonbackgroundcolorcustom|default('#ffffff'), aSurveyInfo.options) %}
{% set sNextBtnColor = cmm.cm(aSurveyInfo.options.nextbuttontextcolor|default('other'), aSurveyInfo.options.nextbuttontextcolorcustom|default('#ffffff'), aSurveyInfo.options) %}
{% set sSubmitBtnBg = cmm.cmbg(aSurveyInfo.options.submitbuttonbackgroundcolor|default('color1'), aSurveyInfo.options.submitbuttonbackgroundcolorcustom|default('#ffffff'), aSurveyInfo.options) %}
{% set sSubmitBtnColor = cmm.cm(aSurveyInfo.options.submitbuttontextcolor|default('other'), aSurveyInfo.options.submitbuttontextcolorcustom|default('#ffffff'), aSurveyInfo.options) %}
{% if sPrevBtnBg != '' or sPrevBtnColor != '' %}
.respondage-btn-prev, .respondage-btn-prev:hover, .respondage-btn-prev:focus, .respondage-btn-prev:active {
{% if sPrevBtnBg != '' %}background: {{ sPrevBtnBg }}; border-color: {{ sPrevBtnBg }};{% endif %}
{% if sPrevBtnColor != '' %}color: {{ sPrevBtnColor }};{% endif %}
}
{% endif %}
{% if sNextBtnBg != '' or sNextBtnColor != '' %}
.respondage-btn-next, .respondage-btn-next:hover, .respondage-btn-next:focus, .respondage-btn-next:active {
{% if sNextBtnBg != '' %}background: {{ sNextBtnBg }}; border-color: {{ sNextBtnBg }};{% endif %}
{% if sNextBtnColor != '' %}color: {{ sNextBtnColor }};{% endif %}
}
{% endif %}
{% if sSubmitBtnBg != '' or sSubmitBtnColor != '' %}
.respondage-btn-submit, .respondage-btn-submit:hover, .respondage-btn-submit:focus, .respondage-btn-submit:active {
{% if sSubmitBtnBg != '' %}background: {{ sSubmitBtnBg }}; border-color: {{ sSubmitBtnBg }};{% endif %}
{% if sSubmitBtnColor != '' %}color: {{ sSubmitBtnColor }};{% endif %}
}
{% endif %}
{% set checkicon = '"\\' ~ sec.iconcode(aSurveyInfo.options.checkicon|default('EB7A'), 'EB7A') ~ '"' %}
.checkbox-item input[type="checkbox"]:checked + label::after, .checkbox-item input[type="radio"]:checked + label::after {
content: {{ checkicon }};
}
</style>