Collections functions
General functions
Render functions
Theme permission functions
Resource functions

render_text_question()

Description

render_text_input_question - Used to display a question with simple text input

Parameters

ColumnTypeDefaultDescription
$label string Label of question
$input string Name of input field
$additionaltext string "" Text to to display after input
$numeric boolean false Set to true to force numeric input
$extra ""
$current ""
$ctx array array Rendering context. Should be used to inject different elements (e.g set the div class)

Return

void

Location

include/render_functions.php lines 1540 to 1564

Definition

 
function render_text_question($label$input$additionaltext=""$numeric=false$extra=""$current="", array $ctx = array())
    {
    
$div_class = array("Question");
    if(isset(
$ctx["div_class"]) && is_array($ctx["div_class"]) && !empty($ctx["div_class"]))
        {
        
$div_class array_merge($div_class$ctx["div_class"]);
        }
    
?>
    <div id="question_ echo $input?>" class=" echo implode(" "$div_class); ?>" >
        <label> echo $label?></label>
        
        printf
('<input name="%s" id="%s_input" type="%s" value="%s"%s/>',
            
escape_quoted_data($input),
            
escape_quoted_data($input),
            
$numeric "number" "text",
            
escape_quoted_data((string) $current),
            
$extra
        
);
            
        echo 
$additionaltext;
        
?>
        <div class="clearerleft"> </div>
    </div>
    
    
}

This article was last updated 2nd October 2022 16:05 Europe/London time based on the source file dated 22nd September 2022 16:20 Europe/London time.