Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

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

(no description)

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

Defines 1 class

presets:: (4 methods):
  __construct()
  export_for_template()
  get_presets()
  get_preset_action_menu()


Class: presets  - X-Ref

Renderable class for the presets table in the database activity.

__construct(manager $manager, array $presets, moodle_url $formactionurl, bool $manage = false)   X-Ref
The class constructor.

param: manager $manager The database manager
param: array $presets The array containing the existing presets
param: moodle_url $formactionurl The action url for the form
param: bool $manage Whether the manage preset options should be displayed

export_for_template(renderer_base $output)   X-Ref
Export the data for the mustache template.

param: renderer_base $output The renderer to be used to render the action bar elements.
return: array

get_presets(renderer_base $output)   X-Ref
Returns the presets list with the information required to display them.

param: renderer_base $output The renderer to be used to render the action bar elements.
return: array Presets list.

get_preset_action_menu(renderer_base $output, $preset, ?int $userid)   X-Ref
Return the preset action menu data.

param: renderer_base $output The renderer to be used to render the action bar elements.
param: preset|stdClass $preset the preset object
param: int|null $userid the user id (null for plugin presets)
return: stdClass the resulting action menu