Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | List of all members
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. More...
 
 export_for_template (renderer_base $output)
 Export this data so it can be used as the context for a mustache template. More...
 
 format_layout_for_export ($layoutname)
 Format a layout into an object for export as a Context variable to template. More...
 
 get_customfield_values_for_export ()
 Get the list of values to add to the grouping dropdown. More...
 
 get_formatted_available_layouts_for_export ()
 Get the available layouts formatted for export. More...
 
 get_preferences_as_booleans ()
 Get the user preferences as an array to figure out what has been selected. More...
 
 set_available_layouts ()
 Set the available layouts based on the config table settings, if none are available, defaults to the cards view. More...
 

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.

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