render_fixed_text_question()

Description

Renders a 'fixed' text question - not an input but to display information or values that cannot be changed

Parameters

ColumnTypeDefaultDescription
$label string Question label
$text string Fixed text
$helptext string "" Optional div identifier
$divid string
"%label" > escape$label
"%text" > escape$text
"%helptextdiv"
escape$helptext
: $help_html
$matches; ''; foreach $matches[0] as $part
$replace
* $fixed_html; } /**
| ENT_QUOTES
$length: int
$html

Location

include/render_functions.php lines 6063 to 6086

Definition

 
function render_fixed_text_question(string $labelstring $textstring $helptext ""string $divid ""): void
{
    
$fixed_html '
        <div class="Question" %identifier>
            <label>%label</label>
            <div class="Fixed">%text</div>
            <div class="clearerleft"></div>
            %helptextdiv
        </div>'
;

    
$help_html '
        <div class="FormHelp" style="padding:0; clear:left;" >
            <div class="FormHelpInner">%helptext</div>
        </div>'
;

    
$replace = [
        
"%identifier" => (trim($divid) != '' ' id="' escape($divid) . '"' ''),
        
"%label" => escape($label),
        
"%text" => escape($text),
        
"%helptextdiv" => (trim($helptext) != "" str_replace("%helptext"escape($helptext), $help_html) : ""),
    ];

     echo 
str_replace(array_keys($replace),$replace,$fixed_html);
}

This article was last updated 14th June 2025 08:05 Europe/London time based on the source file dated 3rd June 2025 16:35 Europe/London time.