Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource 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 903 to 969

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 $name?> if ($hidden){echo "style=\"display:none;\"";} ?> >
    <label for=" echo escape($name)?>" > echo escape($label)?></label>
        
        
if($autosave)
            {
            
?>
            <div class="AutoSaveStatus">
                <span id="AutoSaveStatus- echo $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 $name?>"
                       value=" echo $value?>"
                    
                    
if($autosave) { ?> onChange=" echo $on_change_js?>AutoSaveConfigOption(' echo $name?>');" }
                    if(
in_array($value$currentvalues))
                        {
                        
?>
                        checked
                        
                        
}?>
                    >
            </td>
            <td> echo escape(i18n_get_translated($choice)); ?>&nbsp;</td>
            
            
}
            
?>
            </tr>
        </table>
        <div class="clearerleft"></div>
  </div>
  

    
}

This article was last updated 24th May 2024 11:35 Europe/London time based on the source file dated 23rd May 2024 18:05 Europe/London time.