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

config_single_rtype_select()

Description

Generate an html single-select + options block for selecting one of the RS resource types. The
selected field type is posted as the value of the "ref" column of the selected resource type.

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

Location

include/plugin_functions.php lines 961 to 979

Definition

 
function config_single_rtype_select($name$label$current$width=300)
    {
    global 
$lang;
    
$rtypes=get_resource_types("",true,false,true);
?>
  <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?>" style="width: echo $width ?>px">

    
foreach($rtypes as $rtype)
        {
        echo 
'    <option value="'$rtype['ref'] . '"' . (($current==$rtype['ref'])?' selected':'') . '>' lang_or_i18n_get_translated($rtype['name'],'resourcetype-') . '</option>';
        }
?>
    </select>
    <div class="clearerleft"></div>
  </div>

}

This article was last updated 29th March 2024 10:05 Europe/London time based on the source file dated 28th March 2024 11:25 Europe/London time.