Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

render_text_option()

Description

Renders a text field for a given field name.

Uses $lang['cfg-<fieldname>'] as the field label.

Parameters

ColumnTypeDefaultDescription
$fieldname string Name of field
$value string Current field value
$size int 20 Size of text field, optional, defaults to 20
$units string '' Optional units parameter. Displays to right of text field.

Return

string HTML Output

Location

include/config_functions.php lines 91 to 101

Definition

 
function render_text_option($fieldname$value$size=20$units=''){
    global 
$errorfields$lang;
    if (isset(
$errorfields[$fieldname]) && isset($_POST[$fieldname]))
        
$value $_POST[$fieldname];
    
$output '';
    
$output .= "<tr><th><label for=\"$fieldname\">".$lang['cfg-'.$fieldname]."</label></th>";
    
$output .= "<td><input type=\"text\" value=\"$value\" size=\"$size\" name=\"$fieldname\"/> $units ";
    
$output .= isset($errorfields[$fieldname])?'<span class="error">* '.$errorfields[$fieldname].'</span>':'';
    
$output .= "</td></tr>";
    return 
$output;
}

This article was last updated 2nd December 2020 00:35 Europe/London time based on the source file dated 6th October 2020 10:25 Europe/London time.