Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.
/user/ -> renderer.php (source)

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

Provides user rendering functionality such as printing private files tree and displaying a search utility

Copyright: 2010 Dongsheng Cai <dongsheng@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 363 lines (17 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class

core_user_renderer:: (6 methods):
  user_search()
  user_list()
  unified_filter()
  participants_filter()
  format_filter_option()
  handle_missing_applied_filters()


Class: core_user_renderer  - X-Ref

Provides user rendering functionality such as printing private files tree and displaying a search utility

user_search($url, $firstinitial, $lastinitial, $usercount, $totalcount, $heading = null)   X-Ref
Prints user search utility that can search user by first initial of firstname and/or first initial of lastname
Prints a header with a title and the number of users found within that subset

return: string html output
param: string $url the url to return to, complete with any parameters needed for the return
param: string $firstinitial the first initial of the firstname
param: string $lastinitial the first initial of the lastname
param: int $usercount the amount of users meeting the search criteria
param: int $totalcount the amount of users of the set/subset being searched
param: string $heading heading of the subset being searched, default is All Participants

user_list($userlist, $exclusivemode)   X-Ref
Displays the list of tagged users

return: string
param: array $userlist
param: bool $exclusivemode if set to true it means that no other entities tagged with this tag

unified_filter($course, $context, $filtersapplied, $baseurl = null)   X-Ref
Renders the unified filter element for the course participants page.

return: bool|string
param: stdClass $course The course object.
param: context $context The context object.
param: array $filtersapplied Array of currently applied filters.
param: string|moodle_url $baseurl The url with params needed to call up this page.

participants_filter(context $context, string $tableregionid)   X-Ref
Render the data required for the participants filter on the course participants page.

return: string
param: context $context The context of the course being displayed
param: string $tableregionid The table to be updated by this filter

format_filter_option($filtertype, $criteria, $value, $label)   X-Ref
Returns a formatted filter option.

return: array The formatted option with the ['filtertype:value' => 'criteria: label'] format.
param: int $filtertype The filter type (e.g. status, role, group, enrolment, last access).
param: string $criteria The string label of the filter type.
param: int $value The value for the filter option.
param: string $label The string representation of the filter option's value.

handle_missing_applied_filters($filtersapplied, $filteroptions)   X-Ref
Handles cases when after reloading the applied filters are missing in the filter options.

return: array The formatted options with the ['filtertype:value' => 'criteria: label'] format.
param: array $filtersapplied The applied filters.
param: array $filteroptions The filter options.