Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]

(no description)

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

Defines 1 class

bulk_action_base:: (3 methods):
  get_bulk_action_key()
  get_bulk_action_capabilities()
  get_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_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

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_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.

Note: This method is the first towards moving from get_bulk_action_key() to get_key().

return: string