Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403]

Class containing data for my overview block.

Copyright: 2017 Ryan Wyllie <ryan@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 474 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: main  - X-Ref

Class containing data for my overview block.

__construct($grouping, $sort, $view, $paging, $customfieldvalue = null)   X-Ref
main constructor.
Initialize the user preferences

param: string $grouping Grouping user preference
param: string $sort Sort user preference
param: string $view Display user preference
param: int $paging
param: string $customfieldvalue

get_fallback_grouping($config)   X-Ref
Determine the most sensible fallback grouping to use (in cases where the stored selection
is no longer available).

param: object $config
return: string

set_available_layouts()   X-Ref
Set the available layouts based on the config table settings,
if none are available, defaults to the cards view.


get_preferences_as_booleans()   X-Ref
Get the user preferences as an array to figure out what has been selected.

return: array $preferences Array with the pref as key and value set to true

format_layout_for_export($layoutname)   X-Ref
Format a layout into an object for export as a Context variable to template.

param: string $layoutname
return: \stdClass $layout an object representation of a layout

get_formatted_available_layouts_for_export()   X-Ref
Get the available layouts formatted for export.

return: array an array of objects representing available layouts

get_customfield_values_for_export()   X-Ref
Get the list of values to add to the grouping dropdown

return: object[] containing name, value and active fields

export_for_template(renderer_base $output)   X-Ref
Export this data so it can be used as the context for a mustache template.

param: \renderer_base $output
return: array Context variables for the template