class UserSelector (View source)

Properties

protected Application $app

The application container instance.

Methods

__construct(Application $app)

Initialize the instance.

string
selectUser(string $fieldName, int|false $uID = false)

Build the HTML to be placed in a page to choose a user using a popup dialog.

string
quickSelect(string $fieldName, int|false $uID = false, array $miscFields = [])

Build the HTML to be placed in a page to choose a user using a select with users pupulated dynamically with ajax requests.

string
selectMultipleUsers(string $fieldName, User[]|UserInfo[]|int[]|Traversable $users = [])

Build the HTML to be placed in a page to choose multiple users using a popup dialog.

Details

__construct(Application $app)

Initialize the instance.

Parameters

Application $app

string selectUser(string $fieldName, int|false $uID = false)

Build the HTML to be placed in a page to choose a user using a popup dialog.

Parameters

string $fieldName

the name of the field

int|false $uID

the ID of the user to be initially selected

Return Value

string

Examples

<code>
    $userSelector->selectUser('userID', USER_SUPER_ID); // prints out the admin user and makes it changeable.
</code>.

string quickSelect(string $fieldName, int|false $uID = false, array $miscFields = [])

Build the HTML to be placed in a page to choose a user using a select with users pupulated dynamically with ajax requests.

Parameters

string $fieldName

the name of the field

int|false $uID

the ID of the user to be initially selected

array $miscFields

additional fields appended to the hidden input element (a hash array of attributes name => value), possibly including 'class'

Return Value

string

Examples

<code>
    $userSelector->quickSelect('userID', USER_SUPER_ID); // prints out the admin user and makes it changeable.
</code>.

string selectMultipleUsers(string $fieldName, User[]|UserInfo[]|int[]|Traversable $users = [])

Build the HTML to be placed in a page to choose multiple users using a popup dialog.

Parameters

string $fieldName

the name of the field

User[]|UserInfo[]|int[]|Traversable $users

The users to be initially selected

Return Value

string