Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
core\output\local\dropdown\status Class Reference
Inheritance diagram for core\output\local\dropdown\status:
core\output\local\dropdown\dialog core\output\named_templatable core\output\renderable core\output\templatable

Public Member Functions

 __construct (string $buttoncontent, choicelist $choices, array $definition=[])
 Constructor.
 
 add_button_id (string $value)
 Set the button element id.
 
 add_extra (string $attribute, string $value)
 Add extra extras to the sticky footer element.
 
 export_for_template (\renderer_base $output)
 Export this data so it can be used as the context for a mustache template (core/inplace_editable).
 
 export_for_template (renderer_base $output)
 Function to export the renderer data in a format that is suitable for a mustache template.
 
 get_template_name (\renderer_base $renderer)
 Get the name of the template to use for this templatable.
 
 get_template_name (renderer_base $renderer)
 Get the name of the template to use for this templatable.
 
 set_button (string $buttoncontent, ?string $buttonclasses=null)
 Set the button contents.
 
 set_button_classes (string $buttonclasses)
 Add extra classes to trigger butotn.
 
 set_choice (choicelist $choices)
 Set the dialog contents.
 
 set_classes (string $classes)
 Add extra classes to the component.
 
 set_content (string $dialogcontent)
 Set the dialog contents.
 
 set_dialog_width (string $width)
 Set the dialog width.
 
 set_disabled (bool $disabled)
 Set the dropdown disabled attribute.
 
 set_position (string $position)
 Set the dropdown position.
 

Public Attributes

const POSITION
 Dropdown dialog positions.
 
const WIDTH
 Dropdown dialog positions.
 

Protected Attributes

string $buttonclasses = ''
 trigger button CSS classes.
 
bool $buttoncontent = true
 if the footer should auto enable or not.
 
choicelist $choices = null
 content of dialog.
 
string $classes = ''
 component CSS classes.
 
string $dialogcontent = ''
 content of dialog.
 
bool $disabled = false
 if the element is disabled.
 
string $dropdownposition = self::POSITION['start']
 the dropdown position.
 
string $dropdownwidth = self::WIDTH['default']
 dropdown preferred width.
 
array $extras = []
 extra HTML attributes (attribute => value).
 

Detailed Description

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

core\output\local\dropdown\status::__construct ( string $buttoncontent,
choicelist $choices,
array $definition = [] )

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.
Parameters
string$buttoncontentthe button content
choicelist$choicesthe choice object
array$definitionan optional array of the element definition

Member Function Documentation

◆ add_button_id()

core\output\local\dropdown\dialog::add_button_id ( string $value)
inherited

Set the button element id.

Parameters
string$valuethe value

◆ add_extra()

core\output\local\dropdown\dialog::add_extra ( string $attribute,
string $value )
inherited

Add extra extras to the sticky footer element.

Parameters
string$attributethe extra attribute
string$valuethe value

◆ export_for_template() [1/2]

core\output\local\dropdown\status::export_for_template ( \renderer_base $output)

Export this data so it can be used as the context for a mustache template (core/inplace_editable).

Parameters
renderer_base$outputtypically, the renderer that's calling this function
Return values
arraydata context for a mustache template

Reimplemented from core\output\local\dropdown\dialog.

◆ export_for_template() [2/2]

core\output\templatable::export_for_template ( renderer_base $output)
inherited

Function to export the renderer data in a format that is suitable for a mustache template.

This means:

  1. No complex types - only stdClass, array, int, string, float, bool
  2. Any additional info that is required for the template is pre-calculated (e.g. capability checks).
Parameters
renderer_base$outputUsed to do a final render of any components that need to be rendered for export.
Return values
stdClass|array

Implemented in core\output\action_menu, core\output\actions\component_action, core\output\activity_header, core\output\checkbox_toggleall, core\output\choicelist, core\output\chooser, core\output\chooser_item, core\output\chooser_section, core\output\comboboxsearch, core\output\context_header, core\output\custom_menu_item, core\output\dynamic_tabs, core\output\help_icon, core\output\initials_bar, core\output\paging_bar, core\output\pix_icon, core\output\pix_icon_font, core\output\progress_bar, core\output\select_menu, core\output\single_select, core\output\tabobject, core\output\tabtree, core\output\task_indicator, core\output\url_select, core_calendar\output\humandate, core_calendar\output\humantimeperiod, core_course\output\actionbar\group_selector_button, core_course\output\actionbar\group_selector_dropdown_form, core_course\output\actionbar\initials_dropdown_form, core_course\output\actionbar\user_selector_button, core_course\output\activity_completion, core_course\output\activity_dates, core_course\output\activity_icon, core_course\output\activitychooserbutton, core_course\output\completion_action_bar, core_courseformat\output\local\content\basecontrolmenu, core_courseformat\output\local\content\cm\controlmenu, core_courseformat\output\local\content\cm, core_courseformat\output\local\content\section, core_courseformat\output\local\overview\activityname, core_courseformat\output\local\overview\overviewtable, core_grades\output\penalty_indicator, core_question\output\add_bank_list, core_question\output\qbank_action_menu, core_question\output\question_bank_filter_ui, core_question\output\question_bank_list, core_question\output\question_category_selector, core_question\output\question_version_info, core_question\output\question_version_selection, core_question\output\switch_question_bank, core_question\output\view_banks, core_reportbuilder\output\custom_report, core_reportbuilder\output\dynamictabs\access, core_reportbuilder\output\dynamictabs\audience, core_reportbuilder\output\dynamictabs\editor, core_reportbuilder\output\dynamictabs\schedules, core_reportbuilder\output\report_action, and core_reportbuilder\output\system_report.

◆ get_template_name() [1/2]

core\output\local\dropdown\status::get_template_name ( \renderer_base $renderer)

Get the name of the template to use for this templatable.

Parameters
renderer_base$rendererThe renderer requesting the template name
Return values
stringthe template name

Reimplemented from core\output\local\dropdown\dialog.

◆ get_template_name() [2/2]

core\output\named_templatable::get_template_name ( renderer_base $renderer)
inherited

◆ set_button()

core\output\local\dropdown\dialog::set_button ( string $buttoncontent,
?string $buttonclasses = null )
inherited

Set the button contents.

Parameters
string$buttoncontent
string | null$buttonclassesthe button classes

◆ set_button_classes()

core\output\local\dropdown\dialog::set_button_classes ( string $buttonclasses)
inherited

Add extra classes to trigger butotn.

Parameters
string$buttonclassesthe extra classes

◆ set_choice()

core\output\local\dropdown\status::set_choice ( choicelist $choices)

Set the dialog contents.

Parameters
choicelist$choices

◆ set_classes()

core\output\local\dropdown\dialog::set_classes ( string $classes)
inherited

Add extra classes to the component.

Parameters
string$classesthe extra classes

◆ set_content()

core\output\local\dropdown\dialog::set_content ( string $dialogcontent)
inherited

Set the dialog contents.

Parameters
string$dialogcontent

◆ set_dialog_width()

core\output\local\dropdown\dialog::set_dialog_width ( string $width)
inherited

Set the dialog width.

Parameters
string$width

◆ set_disabled()

core\output\local\dropdown\dialog::set_disabled ( bool $disabled)
inherited

Set the dropdown disabled attribute.

Parameters
bool$disabledthe disabled value

◆ set_position()

core\output\local\dropdown\dialog::set_position ( string $position)
inherited

Set the dropdown position.

Parameters
string$positionthe position

Member Data Documentation

◆ POSITION

const core\output\local\dropdown\dialog::POSITION
inherited
Initial value:
= [
'start' => 'dropdown-menu-start',
'end' => 'dropdown-menu-end',
]

Dropdown dialog positions.

◆ WIDTH

const core\output\local\dropdown\dialog::WIDTH
inherited
Initial value:
= [
'default' => '',
'big' => 'dialog-big',
'small' => 'dialog-small',
]

Dropdown dialog positions.


The documentation for this class was generated from the following file: