Base class for user selectors.
In your theme, you must give each user-selector a defined width. If the user selector has name="myid", then the div myid_wrapper must have a width specified.
Located in /user/selector/lib.php (line 38)
| Class | Description |
|---|---|
| service_user_selector | Base class for user selectors. |
| role_assign_user_selector_base | Base class to avoid duplicating code. |
| admins_potential_selector | Base class for user selectors. |
| admins_existing_selector | Base class for user selectors. |
| mnetservice_enrol_existing_users_selector | Selector of our users enrolled into remote course via enrol_mnet plugin |
| mnetservice_enrol_potential_users_selector | Selector of our users who could be enrolled into a remote course via their enrol_mnet |
| forum_subscriber_selector_base | Abstract class used by forum subscriber selection controls |
| groups_user_selector_base | Base class to avoid duplicating code. |
| enrol_manual_potential_participant | Enrol candidates |
| enrol_manual_current_participant | Enroled users |
| cohort_candidate_selector | Cohort assignment candidates |
| cohort_existing_selector | Cohort assignment candidates |
Constructor. Each subclass must have a constructor with this signature.
Clear the list of excluded user ids.
Output this user_selector as HTML.
All to the list of user ids that this control will not select. For example, on the role assign page, we do not list the users who already have the role in question.
Search the database for users matching the $search string, and any other conditions that apply. The SQL for testing whether a user matches the search string should be obtained by calling the search_sql method.
This method is used both when getting the list of choices to display to the user, and also when validating a list of users that was selected.
When preparing a list of users to choose from ($this->is_validating() return false) you should probably have an maximum number of users you will return, and if more users than this match your search, you should instead return a message generated by the too_many_results() method. However, you should not do this when validating.
If you are writing a new user_selector subclass, I strongly recommend you look at some of the subclasses later in this file and in admin/roles/lib.php. They should help you see exactly what you have to do.
Note: this function must be implemented if you use the search ajax field
(e.g. set $options['file'] = '/admin/filecontainingyourclass.php';)
Convenience method for when multiselect is false (throws an exception if not).
If you update the database in such a way that it is likely to change the list of users that this component is allowed to select from, then you must call this method. For example, on the role assign page, after you have assigned some roles to some users, you should call this.
Get the list of users that were selected by doing optional_param then validating the result.
Output one particular optgroup. Used by the preceding function output_options.
Output the list of <optgroup>s and <options>s that go inside the select.
This method should do the same as the JavaScript method user_selector.prototype.handle_response.
Convert a user object to a string suitable for displaying as an option in the list box.
Set the user fields that are displayed in the selector in addition to the user's name.
Whether this control will allow selection of many, or just one user.
The height this control will be displayed, in rows.
Used to generate a nice message when there are too many users to show.
The message includes the number of users that currently match, and the text of the message depends on whether the search term is non-blank.
Documentation generated on Tue, 15 Nov 2011 00:19:32 +0800 by phpDocumentor 1.4.3