Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 39 and 402] [Versions 402 and 403]

Contains the class used for the displaying the tokens table.

Copyright: 2017 John Okely <john@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 319 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

token_table:: (9 methods):
  __construct()
  col_operation()
  col_validuntil()
  col_fullname()
  col_token()
  col_creatorlastname()
  col_servicename()
  other_cols()
  query_db()


Class: token_table  - X-Ref

Class for the displaying the participants table.

__construct($id, $filterdata = null)   X-Ref
Sets up the table.

param: int $id The id of the table
param: object $filterdata The data submitted by the {@see token_filter}.

col_operation($data)   X-Ref
Generate the operation column.

param: \stdClass $data Data for the current row
return: string Content for the column

col_validuntil($data)   X-Ref
Generate the validuntil column.

param: \stdClass $data Data for the current row
return: string Content for the column

col_fullname($data)   X-Ref
Generate the fullname column. Also includes capabilities the user is missing for the webservice (if any)

param: \stdClass $data Data for the current row
return: string Content for the column

col_token($data)   X-Ref
Generate the token column.

param: \stdClass $data Data for the current row
return: string Content for the column

col_creatorlastname($data)   X-Ref
Generate the creator column.

param: \stdClass $data
return: string

col_servicename($data)   X-Ref
Format the service name column.

param: \stdClass $data
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 = false)   X-Ref
Query the database for results to display in the table.

Note: Initial bars are not implemented for this table because it includes user details twice and the initial bars do not work
when the user table is included more than once.

param: int $pagesize size of page for paginated displayed table.
param: bool $useinitialsbar Not implemented. Please pass false.