|
| __construct (moodle_url $url, pix_icon $icon, array $attributes=[], bool $popup=false, ?lang_string $title=null) |
| Create an instance of an action to be added to a report.
|
|
| add_callback (callable $callback) |
| Adds callback to the action.
|
|
| get_action_link (stdClass $row) |
| Return action menu link suitable for output, or null if the action cannot be displayed (because one of its callbacks returned false, {.
|
|
|
array | $attributes |
| $attributes
|
|
callable[] | $callbacks = [] |
| $callbacks
|
|
pix_icon | $icon |
| $icon
|
|
bool | $popup |
| $popup
|
|
lang_string string | $title |
| $title
|
|
moodle_url | $url |
| $url
|
|
◆ __construct()
core_reportbuilder\local\report\action::__construct |
( |
moodle_url | $url, |
|
|
pix_icon | $icon, |
|
|
array | $attributes = [], |
|
|
bool | $popup = false, |
|
|
?lang_string | $title = null ) |
Create an instance of an action to be added to a report.
Both the parameters of the URL, and the attributes parameter support placeholders which will be replaced with appropriate row values, e.g.:
new action(new moodle_url('/', ['id' => ':id']), new pix_icon(...), ['data-id' => ':id'])
Note that all expected placeholders should be added as base fields to the report
- Parameters
-
moodle_url | $url | |
pix_icon | $icon | |
string[] | $attributes | Array of attributes to include in action, each will be cast to string prior to use |
bool | $popup | |
?lang_string | $title | |
◆ add_callback()
core_reportbuilder\local\report\action::add_callback |
( |
callable | $callback | ) |
|
Adds callback to the action.
Used to verify action is available to current user, or preprocess values used in placeholders
Multiple callbacks can be added. If at least one returns false then the action will not be displayed
- Parameters
-
- Return values
-
◆ get_action_link()
core_reportbuilder\local\report\action::get_action_link |
( |
stdClass | $row | ) |
|
Return action menu link suitable for output, or null if the action cannot be displayed (because one of its callbacks returned false, {.
- See also
- add_callback})
- Parameters
-
- Return values
-
The documentation for this class was generated from the following file:
- reportbuilder/classes/local/report/action.php