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

Public Member Functions

 get_cm ()
 Get the course object.
 
 get_course ()
 Get the course object.
 
 get_parent_section ()
 Get the parent section of the current delegated section.
 
 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 delegated component is enabled.
 
 preprocess_section_name (section_info $section, ?string $newname)
 Sync the section renaming with the activity 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 delegated_section_id (stdClass|cm_info $cm)
 Get the delegated section id controlled by a specific cm.
 
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.
 

Member Function Documentation

◆ delegated_section_id()

static core_courseformat\sectiondelegatemodule::delegated_section_id ( stdClass|cm_info $cm)
staticinherited

Get the delegated section id controlled by a specific cm.

This method is used when reverse search is needed bu we cannot access the database. This happens mostly on backup and restore. Do NOT use for normal operations.

Parameters
stdClass | cm_info$cma course module compatible data structure.
Return values
intthe section id.

◆ get_cm()

core_courseformat\sectiondelegatemodule::get_cm ( )
inherited

Get the course object.

Return values
cm_info

◆ get_course()

core_courseformat\sectiondelegatemodule::get_course ( )
inherited

Get the course object.

Return values
stdClass

◆ get_delegate_class_name()

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

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\sectiondelegatemodule::get_parent_section ( )
inherited

Get the parent section of the current delegated section.

Return values
section_info|null

Reimplemented from core_courseformat\sectiondelegate.

◆ get_section_action_menu()

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

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 from core_courseformat\sectiondelegate.

◆ has_delegate_class()

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

Check if a plugin has a delegate class.

Parameters
string$pluginname
Return values
bool

◆ instance()

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

Get the section info instance if available.

Parameters
section_info$sectioninfo
Return values
section_info|null

◆ is_enabled()

core_courseformat\sectiondelegatemodule::is_enabled ( )
inherited

Check if the delegated component is enabled.

Return values
bool

Reimplemented from core_courseformat\sectiondelegate.

◆ preprocess_section_name()

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

Sync the section renaming with the activity name.

Parameters
section_info$section
string | null$newname
Return values
string|null

Reimplemented from core_courseformat\sectiondelegate.

◆ put_section_state_extra_updates()

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

Add extra state updates when put or create a section.

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

Reimplemented from core_courseformat\sectiondelegate.

◆ section_updated()

core_courseformat\sectiondelegatemodule::section_updated ( stdClass $sectionrecord)
inherited

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 from core_courseformat\sectiondelegate.


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