Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.
/user/ -> renderer.php (source)

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401] [Versions 401 and 402] [Versions 401 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: 219 lines (10 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()   X-Ref
Renders the unified filter element for the course participants page.


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 Container of the table to be updated by this filter, is used to retrieve the table
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.