Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
popup_action Class Reference

Component action for a popup window. More...

Inheritance diagram for popup_action:
component_action templatable

Public Member Functions

 __construct ($event, $url, $name='popup', $params=array())
 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 = array()
 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.
 

Detailed Description

Component action for a popup window.

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

Constructor & Destructor Documentation

◆ __construct()

popup_action::__construct ( $event,
$url,
$name = 'popup',
$params = array() )

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()

component_action::export_for_template ( renderer_base $output)
inherited

Export for template.

Parameters
renderer_base$outputThe renderer.
Return values
stdClass

Implements templatable.

◆ get_js_options()

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 popup_action::$params
Initial value:
= array(
'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: