Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
core_courseformat\sectiondelegate Class Reference

Public Member Functions

 __construct (protected section_info $sectioninfo)
 Constructor.
 
 get_section_action_menu (course_format $format, controlmenu $controlmenu, renderer_base $output,)
 Allow delegate plugin to modify the available section menu.
 
 preprocess_section_name (section_info $section, ?string $newname)
 Define the section final name.
 
 put_section_state_extra_updates (section_info $section, stateupdates $updates)
 Add extra state updates when put or create a section.
 

Static Public Member Functions

static has_delegate_class (string $pluginname)
 Check if a plugin has a delegate class.
 
static instance (section_info $sectioninfo)
 Get the section info instance if available.
 

Static Protected Member Functions

static get_delegate_class_name (string $pluginname)
 Return the delgate class name of a plugin, if any.
 

Constructor & Destructor Documentation

◆ __construct()

core_courseformat\sectiondelegate::__construct ( protected section_info $sectioninfo)

Constructor.

Parameters
section_info$sectioninfo

Member Function Documentation

◆ get_delegate_class_name()

static core_courseformat\sectiondelegate::get_delegate_class_name ( string $pluginname)
staticprotected

Return the delgate class name of a plugin, if any.

Parameters
string$pluginname
Return values
string|nullthe delegate class name or null if not found.

◆ get_section_action_menu()

core_courseformat\sectiondelegate::get_section_action_menu ( course_format $format,
controlmenu $controlmenu,
renderer_base $output )

Allow delegate plugin to modify the available section menu.

Parameters
course_format$formatThe course format instance.
controlmenu$controlmenuThe control menu instance.
renderer_base$outputThe renderer instance.
Return values
action_menu|nullThe new action menu with the list of edit control items or null if no action menu is available.

◆ has_delegate_class()

static core_courseformat\sectiondelegate::has_delegate_class ( string $pluginname)
static

Check if a plugin has a delegate class.

Parameters
string$pluginname
Return values
bool

◆ instance()

static core_courseformat\sectiondelegate::instance ( section_info $sectioninfo)
static

Get the section info instance if available.

Parameters
section_info$sectioninfo
Return values
section_info|null

◆ preprocess_section_name()

core_courseformat\sectiondelegate::preprocess_section_name ( section_info $section,
?string $newname )

Define the section final name.

This method can process the section name and return the validated new name.

Parameters
section_info$section
string | null$newnamethe new name value to store in the database
Return values
string|nullthe name value to store in the database

◆ put_section_state_extra_updates()

core_courseformat\sectiondelegate::put_section_state_extra_updates ( section_info $section,
stateupdates $updates )

Add extra state updates when put or create a section.

This method is called every time the backend sends a delegated section state update to the UI.

Parameters
section_info$sectionthe affected section.
stateupdates$updatesthe state updates object to notify the UI.

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