Collections functions
General functions
Node functions
Render functions
Theme permission functions
User 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 19th March 2024 06:05 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.