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



Generate an html multi-select + options block for selecting multiple RS field types. The
selected field type is posted as an array of the values of the "ref" column of the selected
field types.


$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.
$current array Array holding the current field IDs of the config variable being set
$width integer 300 the width of the input field in pixels. Default: 300.
$size integer 7 - Number of visible options. Default 7
$rtype integer false - Limit to fields associated with a specific resource type


include/plugin_functions.php lines 908 to 948


function config_multi_ftype_select($name$label$current$width=300,$size=7,$rtype=false
$fields get_resource_type_fields("","order_by");
$fields get_resource_type_fields($rtype,"order_by");
$all_resource_types get_resource_types();
$resource_types array_column($all_resource_types,"name","ref");
    <div class="Question">
    <label for=" echo $name?>" title=" echo str_replace('%cvn'$name$lang['plugins-configvar'])?>"> echo $label?></label>
    <select name=" echo $name?>[]" id=" echo $name?>" class="MultiSelect" multiple="multiple" size=" echo $size?>" style="width: echo $width ?>px">
foreach($fields as $field)
$str_restypes "";
$fieldrestypes explode(",",(string)$field["resource_types"]);
$fieldrestypenames = [];
$field["global"] != 1)
$fieldrestypes as $fieldrestype)
$fieldrestypenames[] =i18n_get_translated($resource_types[$fieldrestype]);
count($fieldrestypes) < count($all_resource_types)-2)
// Don't show this if they are linked to all but one resource types
$str_restypes " (" .  implode(",",$fieldrestypenames) . ")";
'<option value="'$field['ref'] . '"' . (in_array($field['ref'],$current) ? ' selected':'') . '>' htmlspecialchars(lang_or_i18n_get_translated($field['title'],'fieldtitle-') .  $str_restypes) .  '</option>';
    <div class="clearerleft"></div>


This article was last updated 10th December 2023 15:35 Europe/London time based on the source file dated 7th September 2023 11:45 Europe/London time.