Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

render_bool_option()

Description

Render a yes/no field with the given fieldname.

This function will use $lang['cfg-<fieldname>'] as the text label for the
element.

Parameters

ColumnTypeDefaultDescription
$fieldname string Name of field.
$value bool Current field value

Return

string HTML Output

Location

include/config_functions.php lines 64 to 78

Definition

 
function render_bool_option($fieldname$value){
    global 
$errorfields$lang;
    
$output '';
    
$output .= "<tr><th><label for=\"$fieldname\">".$lang['cfg-'.$fieldname]."</label></th>";
    
$output .= "<td><select name=\"$fieldname\">";
    
$output .= "<option value='true' ";
    
$output .= $value?'selected':'';
    
$output .= ">Yes</option>";
    
$output .= "<option value='false' ";
    
$output .= !$value?'selected':'';
    
$output .= ">No</option></select>";
    
$output .= isset($errorfields[$fieldname])?'<span class="error">* '.$errorfields[$fieldname].'</span>':'';
    
$output .= "</td></tr>";
    return 
$output;
}

This article was last updated 10th July 2020 01:05 Europe/London time based on the source file dated 8th July 2020 11:40 Europe/London time.