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.

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

(no description)

File Size: 323 lines (13 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

custom_report_table:: (9 methods):
  __construct()
  create()
  get_sort_columns()
  format_row()
  download_buttons()
  get_active_columns()
  print_headers()
  print_nothing_to_display()
  get_row_cells_html()


Class: custom_report_table  - X-Ref

Custom report dynamic table class

__construct(string $uniqueid, string $download = '')   X-Ref
Table constructor. Note that the passed unique ID value must match the pattern "custom-report-table-(\d+)" so that
dynamic updates continue to load the same report

param: string $uniqueid
param: string $download

create(int $reportid, string $download = '')   X-Ref
Return a new instance of the class for given report ID

return: static
param: int $reportid
param: string $download

get_sort_columns()   X-Ref
Get user preferred sort columns, overriding those of parent. If user has no preferences then use report defaults

return: array

format_row($row)   X-Ref
Format each row of returned data, executing defined callbacks for the row and each column

return: array
param: array|stdClass $row

download_buttons()   X-Ref
Download is disabled when editing the report

return: string

get_active_columns()   X-Ref
Get the columns of the custom report, returned instances being valid and available for the user

return: column[]

print_headers()   X-Ref
Override parent method for printing headers so we can render our custom controls in each cell


print_nothing_to_display()   X-Ref
Override print_nothing_to_display to ensure that column headers are always added.


get_row_cells_html(string $rowid, array $row, ?array $suppresslastrow)   X-Ref
Override get_row_cells_html to add an extra cell with the toggle button for card view.

return: string
param: string $rowid
param: array $row
param: array|null $suppresslastrow