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_add_db_single_select()

Description

Return a data structure that will instruct the configuration page generator functions to
add a single select configuration variable whose value is chosen from among the results of
a db query to the setup page.

Defaulted to 'ref'.
user. Defaulted to 'name'.
the user. Defaulted to '' indicating that only $dispcolA is to be displayed.
Defaulted to $lang['plugin_field_fmt']. $fmt is all literal except for %A and %B which are
replaced with values. In English $fmt is '%A(%B)' which results in the i-th choice
displaying as: $choices[i][$dispcolA] . '(' . $choices[i][$dispcolB] . ')'

Parameters

ColumnTypeDefaultDescription
$config_var string the name of the configuration variable to be added.
$label string the user text displayed to label the select block. Usually a $lang string.
$choices array the array of db rows that make up the choices.
$ixcol string 'ref' the key in $choices (i.e., the db column) for the value of the choice.
$dispcolA string 'name' the key in $choices (i.e., the db column) for the text to display to the
$dispcolB string '' the key in $choices (i.e., the db column) for secondary text to display to
$fmt string '' the formatting string for combining $dispcolA and B when both are specified.
$width integer 300 the width of the input field in pixels. Default: 300.

Location

include/plugin_functions.php lines 1268 to 1271

Definition

 
function config_add_db_single_select($config_var$label$choices$ixcol='ref'$dispcolA='name'$dispcolB=''$fmt=''$width=300)
    {
    return array(
'db_single_select'$config_var$label$choices$ixcol$dispcolA$dispcolB$fmt$width);
    }

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