Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test 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 1050 to 1090

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 escape($name); ?>" title=" echo escape(str_replace('%cvn'$name$lang['plugins-configvar'])); ?>">
             echo escape($label); ?>
        </label>
    
         if ($autosave) { ?>
            <div class="AutoSaveStatus">
                <span id="AutoSaveStatus- echo escape($name); ?>" style="display:none;"></span>
            </div>
         ?>

        <select name=" echo escape($name); ?>"
            id=" echo escape($name); ?>"
            style="width: echo (int) $width?>px"
             if ($autosave) { ?> onChange="AutoSaveConfigOption(' echo escape($name); ?>');" ?>>
            <option value=""  echo $current == "" ' selected' '' ?>>
                 echo escape($lang["select"]); ?>
            </option>
             foreach ($fields as $field) { ?>
                <option value=" echo (int) $field['ref']; ?>"
                     echo $current == $field['ref'] ? ' selected' ''?>>
                     echo escape(lang_or_i18n_get_translated($field['title'],'fieldtitle-')); ?>
                </option>
             ?>
        </select>
        <div class="clearerleft"></div>
    </div>

    
}

This article was last updated 17th November 2024 15:05 Europe/London time based on the source file dated 13th November 2024 15:50 Europe/London time.