Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions



Generate an html multi-select + options block

used as the values of the options, and the values are the choices the user sees. (But see
$usekeys, below.) Usually a $lang entry whose value is an array of strings.
If set to false the values from $choices will be used for both the values of the options
and the text the user sees. Defaulted to true.


$name string the name of the select block. Usually the name of the config variable being set.
$label string the user text displayed to label the select block. Usually a $lang string.
$usekeys boolean true tells whether to use the keys from $choices as the values of the options.
$width integer 300 the width of the input field in pixels. Default: 300.
array string $choices the array of choices -- the options in the select block. The keys are


include/plugin_functions.php lines 700 to 715


function config_multi_select($name$label$current$choices$usekeys=true$width=300)
    <div class="Question">
        <label for=" echo $name?>" title=" echo escape(str_replace('%cvn'$name$lang['plugins-configvar'])); ?>"> echo escape($label); ?></label>
        <select name=" echo $name?>[]" id=" echo $name?>" class="MultiSelect" multiple="multiple"  if(count($choices) > 7) {echo ' size="7"';} ?> style="width: echo $width ?>px">
             foreach($choices as $key => $choice) {
$value $usekeys $key $choice;
'    <option value="' $value '"' . ((in_array($value$current)) ? ' selected' '') . ">$choice</option>";
        <div class="clearerleft"></div>

This article was last updated 23rd July 2024 21:35 Europe/London time based on the source file dated 23rd July 2024 16:15 Europe/London time.