Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
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_dates_data (stdClass &$data, renderer_base $output)
 Add activity dates 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.
 
 add_groupmode_data (stdClass &$data, renderer_base $output)
 Add group mode information to the data structure.
 
 add_visibility_data (stdClass &$data, renderer_base $output)
 Add visibility 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 $completionclass
 the activity completion class name
 
string $controlmenuclass
 the activity control menu class name
 
array $displayoptions
 optional display options
 
course_format $format
 the course format
 
string $groupmodeclass
 the activity groupmode badge class name
 
cm_info $mod
 the course module instance
 
string $visibilityclass
 the activity visibility class name
 

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

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

Add activity dates 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

◆ add_groupmode_data()

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

Add group mode 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 group mode information

◆ add_visibility_data()

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

Add visibility information 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 visibility 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\local\dropdown\dialog, core\output\local\dropdown\status, core\output\sticky_footer, core_courseformat\output\local\content\cm\title, mod_quiz\output\list_of_attempts, 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: