Moodle PHP Documentation 5.0
Moodle 5.0.1+ (Build: 20250711) (61af040cd5f)
core\output\actions\popup_action Class Reference
Inheritance diagram for core\output\actions\popup_action:
core\output\actions\component_action core\output\templatable

Public Member Functions

 __construct ($event, $url, $name='popup', $params=[])
 Constructor.
 
 export_for_template (renderer_base $output)
 Export for template.
 
 get_js_options ()
 Returns a string of concatenated option->value pairs used by JS to call the popup window, based on this object's variables.
 

Public Attributes

string $event
 $event The DOM event that will trigger this action when caught
 
string $jsfunction = 'openpopup'
 The JS function to call for the popup.
 
array $jsfunctionargs = []
 An array of arguments to pass to the JS function.
 
array $params
 An array of parameters that will be passed to the openpopup JS function.
 

Constructor & Destructor Documentation

◆ __construct()

core\output\actions\popup_action::__construct ( $event,
$url,
$name = 'popup',
$params = [] )

Constructor.

Parameters
string$eventDOM event
moodle_url | string$urlA moodle_url object, required if no jsfunction is given
string$nameThe JS function to call for the popup (default 'popup')
array$paramsAn array of popup parameters

Member Function Documentation

◆ export_for_template()

core\output\actions\component_action::export_for_template ( renderer_base $output)
inherited

Export for template.

Parameters
renderer_base$outputThe renderer.
Return values
stdClass

Implements core\output\templatable.

◆ get_js_options()

core\output\actions\popup_action::get_js_options ( )

Returns a string of concatenated option->value pairs used by JS to call the popup window, based on this object's variables.

Return values
stringString of option->value pairs for JS popup function.

Member Data Documentation

◆ $params

array core\output\actions\popup_action::$params
Initial value:
= [
'height' => 400,
'width' => 500,
'top' => 0,
'left' => 0,
'menubar' => false,
'location' => false,
'scrollbars' => true,
'resizable' => true,
'toolbar' => true,
'status' => true,
'directories' => false,
'fullscreen' => false,
'dependent' => true,
]

An array of parameters that will be passed to the openpopup JS function.


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