Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
core_courseformat\output\local\content\basecontrolmenu Class Reference
Inheritance diagram for core_courseformat\output\local\content\basecontrolmenu:
core\output\named_templatable core\output\renderable core\output\templatable core_courseformat\output\local\content\cm\controlmenu core_courseformat\output\local\content\cm\delegatedcontrolmenu core_courseformat\output\local\content\section\controlmenu

Public Member Functions

 __construct (course_format $format, section_info $section, ?cm_info $mod=null, string $menuid='')
 Constructor.
 
 export_for_template (renderer_base $output)
 Export this data so it can be used as the context for a mustache template.
 
 get_action_menu (renderer_base $output)
 Generate the action menu element.
 
 get_default_action_menu (renderer_base $output)
 Generate the default action menu.
 
 get_template_name (renderer_base $renderer)
 Get the name of the template to use for this templatable.
 
 section_control_items ()
 Generate the edit control items of a section.
 
 set_baseurl (url $baseurl)
 Change the default base URL to return after each action.
 

Protected Member Functions

 add_control_after (array $controls, string $aftername, string $newkey, mixed $newcontrol)
 Adds a new control item after a given control item.
 
 format_controls (array $controls)
 Format control array into an action_menu.
 

Protected Attributes

url url $baseurl
 The base URL for the course or the section.
 
stdClass stdClass $course
 the course instance
 
context_course $coursecontext
 the course context
 
course_format $format
 the course format class
 
action_menu $menu
 the action menu
 
string $menuid
 the menu ID
 
cm_info $mod
 the course module class
 
section_info $section
 the course section class
 

Constructor & Destructor Documentation

◆ __construct()

core_courseformat\output\local\content\basecontrolmenu::__construct ( course_format $format,
section_info $section,
?cm_info $mod = null,
string $menuid = '' )

Constructor.

Parameters
course_format$formatthe course format
section_info$sectionthe section info
cm_info | null$modthe module info
string$menuidthe ID value for the menu

Member Function Documentation

◆ add_control_after()

core_courseformat\output\local\content\basecontrolmenu::add_control_after ( array $controls,
string $aftername,
string $newkey,
mixed $newcontrol )
protected

Adds a new control item after a given control item.

If the control item is not found, the new control item is added at the beginning.

Parameters
array$controlsarray of edit control items
string$afternamename of the control item after which the new control item will be added
string$newkeykey of the new control item
mixed$newcontrolnew control item to be added (anything compatible with an action menu or null)

◆ export_for_template()

core_courseformat\output\local\content\basecontrolmenu::export_for_template ( renderer_base $output)

Export this data so it can be used as the context for a mustache template.

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

Implements core\output\templatable.

Reimplemented in core_courseformat\output\local\content\cm\controlmenu.

◆ format_controls()

core_courseformat\output\local\content\basecontrolmenu::format_controls ( array $controls)
protected

Format control array into an action_menu.

Parameters
renderer_base$outputtypically, the renderer that's calling this function
Return values
action_menu|nullthe action menu

◆ get_action_menu()

core_courseformat\output\local\content\basecontrolmenu::get_action_menu ( renderer_base $output)

Generate the action menu element.

Parameters
renderer_base$outputtypically, the renderer that's calling this function
Return values
action_menu|nullthe action menu or null if no action menu is available

Reimplemented in core_courseformat\output\local\content\cm\controlmenu, and core_courseformat\output\local\content\section\controlmenu.

◆ get_default_action_menu()

core_courseformat\output\local\content\basecontrolmenu::get_default_action_menu ( renderer_base $output)

Generate the default action menu.

This method is public in case some block needs to modify the menu before output it.

Parameters
renderer_base$outputtypically, the renderer that's calling this function
Return values
action_menu|nullthe action menu

Reimplemented in core_courseformat\output\local\content\cm\delegatedcontrolmenu, and core_courseformat\output\local\content\section\controlmenu.

◆ get_template_name()

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

◆ section_control_items()

core_courseformat\output\local\content\basecontrolmenu::section_control_items ( )

Generate the edit control items of a section.

This method must remain public until the final deprecation of section_edit_control_items.

Return values
arrayof edit control items

Reimplemented in core_courseformat\output\local\content\section\controlmenu.

◆ set_baseurl()

core_courseformat\output\local\content\basecontrolmenu::set_baseurl ( url $baseurl)

Change the default base URL to return after each action.

Parameters
url$baseurl

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