Moodle  2.2.1
http://www.collinsharper.com
group_non_members_selector Class Reference
Inheritance diagram for group_non_members_selector:
Collaboration diagram for group_non_members_selector:

Public Member Functions

 output_user ($user)
 get_js_module ()
 print_user_summaries ($courseid)
 find_users ($search)

Data Fields

const MAX_USERS_PER_PAGE = 100

Detailed Description

User selector subclass for the list of users who are not in a certain group. Used on the add group members page.

Definition at line 739 of file lib.php.


Member Function Documentation

find_users ( search)

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.

Parameters:
string$searchthe search string.
Returns:
array An array of arrays of users. The array keys of the outer array should be the string names of optgroups. The keys of the inner arrays should be userids, and the values should be user objects containing at least the list of fields returned by the method required_fields_sql(). If a user object has a ->disabled property that is true, then that option will be displayed greyed out, and will not be returned by get_selected_users.

Reimplemented from user_selector_base.

Definition at line 808 of file lib.php.

Here is the call graph for this function:

Returns the user selector JavaScript module

Returns:
array

Definition at line 755 of file lib.php.

output_user ( user)

Convert a user object to a string suitable for displaying as an option in the list box.

Parameters:
object$userthe user to display.
Returns:
string a string representation of the user.

Reimplemented from user_selector_base.

Definition at line 747 of file lib.php.

print_user_summaries ( courseid)

Creates a global JS variable (userSummaries) that is used by the group selector to print related information when the user clicks on a user in the groups UI.

Used by /group/clientlib.js

moodle_database $DB moodle_page $PAGE

Parameters:
int$courseid

Definition at line 769 of file lib.php.

Here is the call graph for this function:


Field Documentation

const MAX_USERS_PER_PAGE = 100

Definition at line 740 of file lib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations