Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
core_courseformat\output\local\content\cm Class Reference

Base class to render a course module inside a course format. More...

Inheritance diagram for core_courseformat\output\local\content\cm:
core\output\named_templatable renderable templatable

Public Member Functions

 __construct (course_format $format, section_info $section, cm_info $mod, array $displayoptions=[])
 Constructor.
 
 export_for_template (renderer_base $output)
 Export this data so it can be used as the context for a mustache template.
 
 get_link_classes ()
 Get the activity link classes.
 
 get_onclick_code ()
 Get the activity onclick code.
 
 get_template_name (\renderer_base $renderer)
 Get the name of the template to use for this templatable.
 
 get_text_classes ()
 Get the activity text/description classes.
 

Protected Member Functions

 add_alternative_content_data (stdClass &$data, renderer_base $output)
 Add the alternative content to the data structure.
 
 add_availability_data (stdClass &$data, renderer_base $output)
 Add the module availability to the data structure.
 
 add_cm_name_data (stdClass &$data, renderer_base $output)
 Add course module name attributes to the data structure.
 
 add_completion_data (stdClass &$data, renderer_base $output)
 Add activity completion information to the data structure.
 
 add_editor_data (stdClass &$data, renderer_base $output)
 Add course editor attributes to the data structure.
 
 add_format_data (stdClass &$data, array $haspartials, renderer_base $output)
 Add activity information to the data structure.
 
 load_classes ()
 Returns the CSS classes for the activity name/content.
 

Protected Attributes

string $availabilityclass
 the activity availability class name
 
string $cmnameclass
 the activity name output class name
 
string $controlmenuclass
 the activity control menu class name
 
array $displayoptions
 optional display options
 
course_format $format
 the course format
 
cm_info $mod
 the course module instance
 

Detailed Description

Base class to render a course module inside a course format.

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

Constructor & Destructor Documentation

◆ __construct()

core_courseformat\output\local\content\cm::__construct ( course_format $format,
section_info $section,
cm_info $mod,
array $displayoptions = [] )

Constructor.

Parameters
course_format$formatthe course format
section_info$sectionthe section info
cm_info$modthe course module ionfo
array$displayoptionsoptional extra display options

Member Function Documentation

◆ add_alternative_content_data()

core_courseformat\output\local\content\cm::add_alternative_content_data ( stdClass & $data,
renderer_base $output )
protected

Add the alternative content to the data structure.

Parameters
stdClass$datathe current cm data reference
renderer_base$outputtypically, the renderer that's calling this function
Return values
boolif the cm has alternative content

◆ add_availability_data()

core_courseformat\output\local\content\cm::add_availability_data ( stdClass & $data,
renderer_base $output )
protected

Add the module availability to the data structure.

Parameters
stdClass$datathe current cm data reference
renderer_base$outputtypically, the renderer that's calling this function
Return values
boolif the cm has mod availability

◆ add_cm_name_data()

core_courseformat\output\local\content\cm::add_cm_name_data ( stdClass & $data,
renderer_base $output )
protected

Add course module name attributes to the data structure.

Parameters
stdClass$datathe current cm data reference
renderer_base$outputtypically, the renderer that's calling this function
Return values
boolif the cm has name data

◆ add_completion_data()

core_courseformat\output\local\content\cm::add_completion_data ( stdClass & $data,
renderer_base $output )
protected

Add activity completion information to the data structure.

Parameters
stdClass$datathe current cm data reference
renderer_base$outputtypically, the renderer that's calling this function
Return values
boolthe module has completion information

◆ add_editor_data()

core_courseformat\output\local\content\cm::add_editor_data ( stdClass & $data,
renderer_base $output )
protected

Add course editor attributes to the data structure.

Parameters
stdClass$datathe current cm data reference
renderer_base$outputtypically, the renderer that's calling this function
Return values
boolif the cm has editor data

◆ add_format_data()

core_courseformat\output\local\content\cm::add_format_data ( stdClass & $data,
array $haspartials,
renderer_base $output )
protected

Add activity information to the data structure.

Parameters
stdClass$datathe current cm data reference
bool[]$haspartialsthe result of loading partial data elements
renderer_base$outputtypically, the renderer that's calling this function
Return values
boolif the cm has format data

◆ export_for_template()

core_courseformat\output\local\content\cm::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
stdClassdata context for a mustache template

Implements templatable.

◆ get_link_classes()

core_courseformat\output\local\content\cm::get_link_classes ( )

Get the activity link classes.

Return values
stringthe activity link classes.

◆ get_onclick_code()

core_courseformat\output\local\content\cm::get_onclick_code ( )

Get the activity onclick code.

Return values
stringthe activity onclick.

◆ get_template_name()

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

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

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

Implemented in core\output\sticky_footer, core_courseformat\output\local\content\cm\title, and qbank_viewquestionname\output\questionname.

◆ get_text_classes()

core_courseformat\output\local\content\cm::get_text_classes ( )

Get the activity text/description classes.

Return values
stringthe activity text classes.

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