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

Description

Generate an html single-select block for selecting one of the RS users.

The user key (i.e., the value from the "ref" column of the user table) of the selected user is the
value posted.

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 array 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 770 to 793

Definition

 
function config_single_user_select($name$label$current = array(), $width 300)
{
    global 
$lang;
    
?>
    <div class="Question">
        <label for=" echo escape($name); ?>" title=" echo escape(str_replace('%cvn'$name$lang['plugins-configvar'])); ?>">
             echo escape($label); ?>
        </label>
        <select name=" echo escape($name); ?>"
            id=" echo escape($name); ?>"
            style="width: echo (int) $width?>px">
            
            $users 
get_users();
            foreach (
$users as $user) { ?>
                <option value=" echo (int) $user['ref']; ?>"
                     echo $user['ref'] == $current ' selected' ''?>>
                     echo escape($user['fullname'] . ' (' $user['email'] . ')'); ?>
                </option>
             ?>
        </select>
        <div class="clearerleft"></div>
    </div>
    
}

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.