Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

config_multi_ftype_select()

Description

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

Parameters

ColumnTypeDefaultDescription
$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
$width integer 300 the width of the input field in pixels. Default: 300.
$size 7
$ftype false
array integer $current the current value of the config variable being set

Location

include/plugin_functions.php lines 1005 to 1028

Definition

 
function config_multi_ftype_select($name$label$current$width=300,$size=7,$ftype=false
    {
    global 
$lang;
    if(
$ftype===false){
        
$fields=sql_query('select f.ref, f.title, f.name, rt.name as rt_name from resource_type_field f left join resource_type rt on f.resource_type=rt.ref order by rt.ref, f.title, f.name'"schema");
    }
    else{
        
$fields=sql_query('select f.ref, f.title, f.name, rt.name as rt_name from resource_type_field f left join resource_type rt on f.resource_type=rt.ref where f.resource_type="$ftype" order by f.title, f.name'"schema");
    }
?>
  <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)
        {
        echo 
'    <option value="'$field['ref'] . '"' . (in_array($field['ref'],$current)?' selected':'') . '>' lang_or_i18n_get_translated($field['title'],'fieldtitle-') . (($field['rt_name']!='')?' (' lang_or_i18n_get_translated($field['rt_name'],'"resourcetype-') . ')':'') . '</option>';
        }
?>
    </select>
    <div class="clearerleft"></div>
  </div>

    
}

This article was last updated 1st March 2021 09:05 Europe/London time based on the source file dated 24th February 2021 14:50 Europe/London time.