Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
block_myoverview\output\main Class Reference

Class containing data for my overview block. More...

Inheritance diagram for block_myoverview\output\main:
renderable templatable

Public Member Functions

 __construct ($grouping, $sort, $view, $paging, $customfieldvalue=null)
 main constructor.
 
 export_for_template (renderer_base $output)
 Export this data so it can be used as the context for a mustache template.
 
 export_for_zero_state_template (renderer_base $output)
 Export this data so it can be used as the context for a mustache template.
 
 format_layout_for_export ($layoutname)
 Format a layout into an object for export as a Context variable to template.
 
 get_customfield_values_for_export ()
 Get the list of values to add to the grouping dropdown.
 
 get_formatted_available_layouts_for_export ()
 Get the available layouts formatted for export.
 
 get_preferences_as_booleans ()
 Get the user preferences as an array to figure out what has been selected.
 
 set_available_layouts ()
 Set the available layouts based on the config table settings, if none are available, defaults to the cards view.
 

Protected Attributes

bool $displaygroupingselector
 true if grouping selector should be shown, otherwise false.
 

Detailed Description

Class containing data for my overview block.

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

Constructor & Destructor Documentation

◆ __construct()

block_myoverview\output\main::__construct ( $grouping,
$sort,
$view,
$paging,
$customfieldvalue = null )

main constructor.

Initialize the user preferences

Parameters
string$groupingGrouping user preference
string$sortSort user preference
string$viewDisplay user preference
int$paging
string$customfieldvalue
Exceptions
dml_exception

Member Function Documentation

◆ export_for_template()

block_myoverview\output\main::export_for_template ( renderer_base $output)

Export this data so it can be used as the context for a mustache template.

Parameters
renderer_base$output
Return values
arrayContext variables for the template
Exceptions
coding_exception

Implements templatable.

◆ export_for_zero_state_template()

block_myoverview\output\main::export_for_zero_state_template ( renderer_base $output)

Export this data so it can be used as the context for a mustache template.

Parameters
renderer_base$output
Return values
arrayContext variables for the template
Exceptions
coding_exception

◆ format_layout_for_export()

block_myoverview\output\main::format_layout_for_export ( $layoutname)

Format a layout into an object for export as a Context variable to template.

Parameters
string$layoutname
Return values
stdClass\$layoutan object representation of a layout
Exceptions
coding_exception

◆ get_customfield_values_for_export()

block_myoverview\output\main::get_customfield_values_for_export ( )

Get the list of values to add to the grouping dropdown.

Return values
object[]containing name, value and active fields

◆ get_formatted_available_layouts_for_export()

block_myoverview\output\main::get_formatted_available_layouts_for_export ( )

Get the available layouts formatted for export.

Return values
arrayan array of objects representing available layouts

◆ get_preferences_as_booleans()

block_myoverview\output\main::get_preferences_as_booleans ( )

Get the user preferences as an array to figure out what has been selected.

Return values
array\$preferencesArray with the pref as key and value set to true

◆ set_available_layouts()

block_myoverview\output\main::set_available_layouts ( )

Set the available layouts based on the config table settings, if none are available, defaults to the cards view.

Exceptions
dml_exception

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