Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250530) (c39b7370636)
core_courseformat\sectiondelegate Class Reference
Inheritance diagram for core_courseformat\sectiondelegate:
core_courseformat\sectiondelegatemodule mod_subsection\courseformat\sectiondelegate

Public Member Functions

 __construct (protected section_info $sectioninfo)
 Constructor.
 
 get_parent_section ()
 Get the parent section of the current delegated section if any.
 
 get_section_action_menu (course_format $format, controlmenu $controlmenu, renderer_base $output,)
 Allow delegate plugin to modify the available section menu.
 
 is_enabled ()
 Check if the delegate is enabled.
 
 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.
 
 section_updated (stdClass $sectionrecord)
 Handler executed when a section has been updated.
 

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

Reimplemented in core_courseformat\sectiondelegatemodule.

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_parent_section()

core_courseformat\sectiondelegate::get_parent_section ( )

Get the parent section of the current delegated section if any.

Return values
section_info|null

Reimplemented in core_courseformat\sectiondelegatemodule.

◆ 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.

Reimplemented in core_courseformat\sectiondelegatemodule.

◆ 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

◆ is_enabled()

core_courseformat\sectiondelegate::is_enabled ( )

Check if the delegate is enabled.

Usually this happens when the delegate plugin is disabled.

Return values
bool

Reimplemented in core_courseformat\sectiondelegatemodule.

◆ 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

Reimplemented in core_courseformat\sectiondelegatemodule.

◆ 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.

Reimplemented in core_courseformat\sectiondelegatemodule.

◆ section_updated()

core_courseformat\sectiondelegate::section_updated ( stdClass $sectionrecord)

Handler executed when a section has been updated.

This method uses a record instead of a section_info object because section updates can be done in batch and the course_info may not be yet updated.

This method does not need to recalculate the section_info object.

Parameters
stdClass$sectionrecordthe new section data

Reimplemented in core_courseformat\sectiondelegatemodule.


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