Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 400 and 403]

(no description)

File Size: 86 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

bulk_action_base:: (2 methods):
  get_bulk_action_capabilities()
  get_bulk_action_key()


Class: bulk_action_base  - X-Ref

Class bulk_action_base is the base class for bulk actions ui.

Every plugin wants to implement a bulk action, should extend this class, add appropriate values to the methods
and finally pass this object via plugin_feature class.

get_bulk_action_capabilities()   X-Ref
Get the capabilities for the bulk action.
The bulk actions might have some capabilities to action them as a user.
This method helps to get those caps which will be used by the base view before actioning the bulk action.
For ex: ['moodle/question:moveall', 'moodle/question:add']
At least one of the cap need to be true for the user to use this action.

return: array|null

get_bulk_action_key()   X-Ref
A unique key for the bulk action, this will be used in the api to identify the action data.
Every bulk must have a unique key to perform the action as a part of the form post in the base view.
When questions are selected, it will post according to the key its selected from the dropdown.

return: string