Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 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.

Differences Between: [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 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: 260 lines (10 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 1 class

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


Class: token_table  - X-Ref

Class for the displaying the participants table.

__construct($id)   X-Ref
Sets up the table.

param: int $id The id of the table

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

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.