Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250706) (a6b17d8f6bd)
enrol_user_button Class Reference

A button that is used to enrol users in a course. More...

Inheritance diagram for enrol_user_button:

Public Member Functions

 __construct (moodle_url $url, $label, $method='post')
 Initialises the new enrol_user_button.
 
 initialise_js (moodle_page $page)
 Initialises the JS that is required by this button.
 
 require_js_init_call ($function, ?array $extraarguments=null, $ondomready=false, ?array $module=null)
 Adds a JS initialisation call to the page when the button is used.
 
 require_yui_module ($modules, $function, ?array $arguments=null, $galleryversion=null, $ondomready=false)
 Adds a YUI module call that will be added to the page when the button is used.
 
 strings_for_js ($identifiers, $component='moodle', $a=null)
 Requires strings for JS that will be loaded when the button is used.
 

Protected Attributes

array $jsinitcalls = array()
 An array containing JS initialisation calls required by this button.
 
array $jsstrings = array()
 An array strings required by JS for this button.
 
array $jsyuimodules = array()
 An array containing JS YUI modules required by this button.
 

Detailed Description

A button that is used to enrol users in a course.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

enrol_user_button::__construct ( moodle_url $url,
$label,
$method = 'post' )

Initialises the new enrol_user_button.

@staticvar int $count The number of enrol user buttons already created

Parameters
moodle_url$url
string$labelThe text to display in the button
string$methodEither post or get

Member Function Documentation

◆ initialise_js()

enrol_user_button::initialise_js ( moodle_page $page)

Initialises the JS that is required by this button.

Parameters
moodle_page$page

◆ require_js_init_call()

enrol_user_button::require_js_init_call ( $function,
?array $extraarguments = null,
$ondomready = false,
?array $module = null )

Adds a JS initialisation call to the page when the button is used.

Parameters
string$functionThe function to call
array$extraargumentsAn array of arguments to pass to the function
bool$ondomreadyIf true the call is postponed until the DOM is finished loading
array$moduleA module definition

◆ require_yui_module()

enrol_user_button::require_yui_module ( $modules,
$function,
?array $arguments = null,
$galleryversion = null,
$ondomready = false )

Adds a YUI module call that will be added to the page when the button is used.

Parameters
string | array$modulesOne or more modules to require
string$functionThe JS function to call
array$argumentsAn array of arguments to pass to the function
string$galleryversionDeprecated: The gallery version to use
bool$ondomreadyIf true the call is postponed until the DOM is finished loading

◆ strings_for_js()

enrol_user_button::strings_for_js ( $identifiers,
$component = 'moodle',
$a = null )

Requires strings for JS that will be loaded when the button is used.

Parameters
type$identifiers
string$component
mixed$a

The documentation for this class was generated from the following file: