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 310 and 311] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

Contains the class used for the displaying the participants table.

Copyright: 2017 Mark Nelson <markn@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 488 lines (17 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

participants:: (14 methods):
  out()
  col_select()
  col_fullname()
  col_roles()
  col_groups()
  col_country()
  col_lastaccess()
  col_status()
  other_cols()
  query_db()
  show_hide_link()
  set_filterset()
  guess_base_url()
  get_context()


Class: participants  - X-Ref

Class for the displaying the participants table.

out($pagesize, $useinitialsbar, $downloadhelpbutton = '')   X-Ref
Render the participants table.

param: int $pagesize Size of page for paginated displayed table.
param: bool $useinitialsbar Whether to use the initials bar which will only be used if there is a fullname column defined.
param: string $downloadhelpbutton

col_select($data)   X-Ref
Generate the select column.

param: \stdClass $data
return: string

col_fullname($data)   X-Ref
Generate the fullname column.

param: \stdClass $data
return: string

col_roles($data)   X-Ref
User roles column.

param: \stdClass $data
return: string

col_groups($data)   X-Ref
Generate the groups column.

param: \stdClass $data
return: string

col_country($data)   X-Ref
Generate the country column.

param: \stdClass $data
return: string

col_lastaccess($data)   X-Ref
Generate the last access column.

param: \stdClass $data
return: string

col_status($data)   X-Ref
Generate the status column.

param: \stdClass $data The data object.
return: string

other_cols($colname, $data)   X-Ref
This function is used for the extra user fields.

These are being dynamically added to the table so there are no functions 'col_<userfieldname>' as
the list has the potential to increase in the future and we don't want to have to remember to add
a new method to this class. We also don't want to pollute this class with unnecessary methods.

param: string $colname The column name
param: \stdClass $data
return: string

query_db($pagesize, $useinitialsbar = true)   X-Ref
Query the database for results to display in the table.

param: int $pagesize size of page for paginated displayed table.
param: bool $useinitialsbar do you want to use the initials bar.

show_hide_link($column, $index)   X-Ref
Override the table show_hide_link to not show for select column.

param: string $column the column name, index into various names.
param: int $index numerical index of the column.
return: string HTML fragment.

set_filterset(filterset $filterset)   X-Ref
Set filters and build table structure.

param: filterset $filterset The filterset object to get the filters from.

guess_base_url()   X-Ref
Guess the base url for the participants table.


get_context()   X-Ref
Get the context of the current table.

Note: This function should not be called until after the filterset has been provided.

return: context