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.

(no description)

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

Defines 1 class

status:: (4 methods):
  __construct()
  set_choice()
  export_for_template()
  get_template_name()


Class: status  - X-Ref

Class to render a dropdown dialog element.

A dropdown dialog allows to render any arbitrary HTML into a dropdown elements triggered
by a button.

__construct(string $buttoncontent, choicelist $choices, array $definition = [])   X-Ref
Constructor.

The definition object could contain the following keys:
- classes: component CSS classes.
- buttonclasses: the button CSS classes.
- dialogwidth: the dropdown width.
- extras: extra HTML attributes (attribute => value).
- buttonsync: if the button should be synced with the selected value.
- updatestatus: if component must update the status and trigger a change event when clicked.

param: string $buttoncontent the button content
param: choicelist $choices the choice object
param: array $definition an optional array of the element definition

set_choice(choicelist $choices)   X-Ref
Set the dialog contents.

param: choicelist $choices

export_for_template(\renderer_base $output)   X-Ref
Export this data so it can be used as the context for a mustache template (core/inplace_editable).

param: \renderer_base $output typically, the renderer that's calling this function
return: array data context for a mustache template

get_template_name(\renderer_base $renderer)   X-Ref
Get the name of the template to use for this templatable.

param: \renderer_base $renderer The renderer requesting the template name
return: string the template name