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

Description

Generate an html multi-select block for selecting from among RS user groups.

An array consisting of the group keys (i.e., values from the "ref" column of the usergroup table) for the
selected groups 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 array
$width integer 420 the width of the input field in pixels. Default: 300.
array integer $current the current value of the config variable being set.

Location

include/plugin_functions.php lines 924 to 963

Definition

 
function config_multi_group_select($name$label$current=array(), $width=420)
{
    global 
$lang;
    
?>
    <div class="Question">
        <label for=" echo escape($name); ?>" title=" echo escape(str_replace('%cvn'$name$lang['plugins-configvar'])); ?>">
             echo escape($label); ?>
        </label>
        <fieldset 
            name=" echo escape($name); ?>"
            id=" echo escape($name); ?>"
            class="MultiRTypeSelect"
            style="width: echo (int) $width?>px"
        >
            <div class="MultiRtypeSelectContainer">
                
                $usergroups 
get_usergroups();
                foreach (
$usergroups as $usergroup) { ?>
                    <span id="usergroup echo (int) $usergroup['ref']; ?>">
                        <input
                            type="checkbox"
                            value=" echo (int) $usergroup['ref']; ?>"
                            name=" echo escape($name) . '[]'?>"
                            id=" echo escape($name $usergroup['ref']); ?>"
                             echo in_array($usergroup['ref'], $current) ? ' checked="checked"' ''?>
                        />
                        <label for=" echo escape($name $usergroup['ref']); ?>">
                             echo escape($usergroup['name']); ?>
                        </label>
                        <br />
                    </span>
                    
                
}
                
?>
            </div>
        </fieldset>
        <div class="clearerleft"></div>
    </div>
    
}

This article was last updated 4th December 2024 08:35 Europe/London time based on the source file dated 29th November 2024 10:35 Europe/London time.