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

Public Member Functions

 get_info_icons (array $instances)
 get_instance_name ($instance)
 roles_protected ()
 allow_unenrol (stdClass $instance)
 allow_manage (stdClass $instance)
 show_enrolme_link (stdClass $instance)
 add_course_navigation ($instancesnode, stdClass $instance)
 get_action_icons (stdClass $instance)
 get_newinstance_link ($courseid)
 enrol_page_hook (stdClass $instance)
 add_default_instance ($course)
 cron ()
 get_user_enrolment_actions (course_enrolment_manager $manager, $ue)

Protected Member Functions

 email_welcome_message ($instance, $user)

Detailed Description

Self enrolment plugin implementation.

Author:
Petr Skoda http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Definition at line 32 of file lib.php.


Member Function Documentation

add_course_navigation ( instancesnode,
stdClass $  instance 
)

Sets up navigation entries.

Parameters:
object$instance
Returns:
void

Reimplemented from enrol_plugin.

Definition at line 113 of file lib.php.

Here is the call graph for this function:

add_default_instance ( course)

Add new instance of enrol plugin with default settings.

Parameters:
object$course
Returns:
int id of new instance

Reimplemented from enrol_plugin.

Definition at line 243 of file lib.php.

Here is the call graph for this function:

allow_manage ( stdClass $  instance)

Does this plugin allow manual changes in user_enrolments table?

All plugins allowing this must implement 'enrol/xxx:manage' capability

Parameters:
stdClass$instancecourse enrol instance
Returns:
bool - true means it is possible to change enrol period and status in user_enrolments table

Reimplemented from enrol_plugin.

Definition at line 98 of file lib.php.

Here is the caller graph for this function:

allow_unenrol ( stdClass $  instance)

Does this plugin allow manual unenrolment of all users? All plugins allowing this must implement 'enrol/xxx:unenrol' capability

Parameters:
stdClass$instancecourse enrol instance
Returns:
bool - true means user with 'enrol/xxx:unenrol' may unenrol others freely, false means nobody may touch user_enrolments

Reimplemented from enrol_plugin.

Definition at line 93 of file lib.php.

Here is the caller graph for this function:

cron ( )

Enrol self cron support

Returns:
void

Reimplemented from enrol_plugin.

Definition at line 305 of file lib.php.

Here is the call graph for this function:

email_welcome_message ( instance,
user 
) [protected]

Send welcome email to specified user

Parameters:
object$instance
object$useruser record
Returns:
void

Definition at line 266 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

enrol_page_hook ( stdClass $  instance)

Creates course enrol form, checks if form submitted and enrols user if necessary. It can also redirect.

Parameters:
stdClass$instance
Returns:
string html text, usually a form in a text box

Reimplemented from enrol_plugin.

Definition at line 170 of file lib.php.

Here is the call graph for this function:

get_action_icons ( stdClass $  instance)

Returns edit icons for the page with list of instances

Parameters:
stdClass$instance
Returns:
array

Reimplemented from enrol_plugin.

Definition at line 130 of file lib.php.

Here is the call graph for this function:

get_info_icons ( array instances)

Returns optional enrolment information icons.

This is used in course list for quick overview of enrolment options.

We are not using single instance parameter because sometimes we might want to prevent icon repetition when multiple instances of one type exist. One instance may also produce several icons.

Parameters:
array$instancesall enrol instances of this type in one course
Returns:
array of pix_icon

Reimplemented from enrol_plugin.

Definition at line 46 of file lib.php.

get_instance_name ( instance)

Returns localised name of enrol instance

Parameters:
object$instance(null is accepted too)
Returns:
string

Reimplemented from enrol_plugin.

Definition at line 72 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_newinstance_link ( courseid)

Returns link to page which may be used to add new instance of enrolment plugin in course.

Parameters:
int$courseid
Returns:
moodle_url page url

Reimplemented from enrol_plugin.

Definition at line 153 of file lib.php.

Here is the call graph for this function:

Gets an array of the user enrolment actions

Parameters:
course_enrolment_manager$manager
stdClass$ueA user enrolment object
Returns:
array An array of user_enrolment_actions

Reimplemented from enrol_plugin.

Definition at line 359 of file lib.php.

Here is the call graph for this function:

Does this plugin assign protected roles are can they be manually removed?

Returns:
bool - false means anybody may tweak roles, it does not use itemid and component when assigning roles

Reimplemented from enrol_plugin.

Definition at line 88 of file lib.php.

show_enrolme_link ( stdClass $  instance)

Does this plugin support some way to user to self enrol?

Parameters:
stdClass$instancecourse enrol instance
Returns:
bool - true means show "Enrol me in this course" link in course UI

Reimplemented from enrol_plugin.

Definition at line 103 of file lib.php.


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