Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test 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 1609 to 1633

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 for=" echo escape($input); ?>_input"> echo $label?></label>
        
        printf
('<input name="%s" id="%s_input" type="%s" value="%s"%s/>',
            
escape($input),
            
escape($input),
            
$numeric "number" "text",
            
escape((string) $current),
            
$extra
        
);
            
        echo 
$additionaltext;
        
?>
        <div class="clearerleft"> </div>
    </div>
    
    
}

This article was last updated 14th December 2024 17:35 Europe/London time based on the source file dated 13th December 2024 14:05 Europe/London time.