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

config_checkbox_select()

Parameters

ColumnTypeDefaultDescription
$name
$label
$current
$choices
$usekeys true
$width 300
$columns 1
$autosave false
$on_change_js null
$hidden false

Location

include/config_functions.php lines 941 to 998

Definition

 
function config_checkbox_select($name$label$current$choices$usekeys=true$width=300$columns=1$autosave false,$on_change_js=null$hidden=false)
{
    global 
$lang;
    if (
trim($current) != "") {
        
$currentvalues explode(","$current);
    } else {
        
$currentvalues = [];
    }
    
$wrap 0;
    
?>
    <div class="Question" id="question_ echo escape($name); ?> if ($hidden){echo "style=\"display:none;\"";} ?> >
        <label for="question echo escape($name); ?>" > echo escape($label)?></label>
         if ($autosave) { ?>
            <div class="AutoSaveStatus">
                <span id="AutoSaveStatus- echo escape($name); ?>" style="display:none;"></span>
            </div>
         ?>
     
        <table cellpadding=2 cellspacing=0>
            <tr>
            
            
foreach ($choices as $key => $choice) {
                
$value $usekeys $key $choice;
                
$wrap++;
                if (
$wrap $columns) {
                    
$wrap 1;
                    
?>
                    </tr>
                    <tr>
                    
                
}
                
?>
                <td width="1">
                    <input type="checkbox"
                        name=" echo escape($name); ?>"
                        value=" echo escape($value); ?>"
                        id=" echo escape($name '_' $value); ?>"
                         if ($autosave) { ?>
                            onChange=" echo $on_change_js?>AutoSaveConfigOption(' echo escape($name); ?>');"
                         }
                        if (
in_array($value$currentvalues)) { ?>
                            checked
                         ?>
                    >
                </td>
                <td>
                    <label for=" echo escape($name '_' $value); ?>"> echo escape(i18n_get_translated($choice)); ?>&nbsp;</label>
                </td>
                
            
}
            
?>
            </tr>
        </table>
        <div class="clearerleft"></div>
  </div>
  

    
}

This article was last updated 11th December 2024 10:35 Europe/London time based on the source file dated 13th November 2024 15:50 Europe/London time.