Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.
/user/ -> renderer.php (source)

Differences Between: [Versions 310 and 401] [Versions 310 and 402] [Versions 310 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

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
return: string html output

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

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

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

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.
return: bool|string

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

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

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

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.
return: array The formatted option with the ['filtertype:value' => 'criteria: label'] format.

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

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