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

config_single_ftype_select()

Description

Generate an html single-select + options block for selecting one of the RS field types. The
selected field type is posted as the value of the "ref" column of the selected field 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.
$rtype false
$ftypes array
$autosave false

Location

include/config_functions.php lines 1020 to 1054

Definition

 
function config_single_ftype_select($name$label$current$width=300$rtype=false$ftypes=array(), $autosave false)
    {
    global 
$lang;

    if (
$rtype === false) { $rtype ''; }
    
$fields get_resource_type_fields($rtype'title, name''asc'''$ftypestrue);

?>
  <div class="Question">
    <label for=" echo $name?>" title=" echo str_replace('%cvn'$name$lang['plugins-configvar'])?>"> echo $label?></label>
    
     
    
if($autosave)
        {
        
?>
        <div class="AutoSaveStatus">
            <span id="AutoSaveStatus- echo $name?>" style="display:none;"></span>
        </div>
        
        
}
        
?>
    <select name=" echo $name?>" id=" echo $name?>" style="width: echo $width ?>px"
     if($autosave) { ?> onChange="AutoSaveConfigOption(' echo $name?>');" ?>>
    <option value=""  echo $current == "" ' selected' '' ?>> echo escape($lang["select"]); ?></option>

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

    
}

This article was last updated 18th April 2024 03:35 Europe/London time based on the source file dated 19th March 2024 14:25 Europe/London time.