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_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 13th December 2024 17:35 Europe/London time based on the source file dated 11th December 2024 15:55 Europe/London time.