MIDDAG for Moodle

users extends table_sql

Class for the displaying the participants table.

Tags
copyright

2017 Mark Nelson markn@moodle.com

license

http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Table of Contents

Properties

$baseurl  : moodle_url
$extrafields  : mixed
$rawdata  : array<string|int, mixed>|array<string|int, never>
$context  : context
$filterset  : filterset
$url  : moodle_url
$users  : array<string|int, mixed>

Methods

col_email()  : string
Generate the email column.
col_fullname()  : string
Generate the fullname column.
get_context()  : context
Get the context of the current table.
guess_base_url()  : void
Guess the base url for the participants table.
other_cols()  : string
This function is used for the extra user fields.
out()  : void
Render the participants table.
query_db()  : void
Query the database for results to display in the table.
set_context()  : mixed
set_filterset()  : void
Set filters and build table structure.
set_url()  : mixed
set_users()  : mixed
show_hide_link()  : string
Override the table show_hide_link to not show for select column.

Properties

$baseurl

public moodle_url $baseurl

The base URL for the report.

$extrafields

public mixed $extrafields

$rawdata

public array<string|int, mixed>|array<string|int, never> $rawdata

$context

protected context $context

the course context

$filterset

protected filterset $filterset

filterset describing which participants to include

$url

protected moodle_url $url

User ids

$users

protected array<string|int, mixed> $users

User ids

Methods

col_email()

Generate the email column.

public col_email(stdClass $data) : string
Parameters
$data : stdClass
Return values
string

col_fullname()

Generate the fullname column.

public col_fullname(stdClass $data) : string
Parameters
$data : stdClass
Return values
string

get_context()

Get the context of the current table.

public get_context() : context

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

Return values
context

guess_base_url()

Guess the base url for the participants table.

public guess_base_url() : void

other_cols()

This function is used for the extra user fields.

public other_cols(string $colname, stdClass $data) : string

These are being dynamically added to the table so there are no functions 'col_' 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.

Parameters
$colname : string

The column name

$data : stdClass
Return values
string

out()

Render the participants table.

public out(int $pagesize, bool $useinitialsbar[, string $downloadhelpbutton = '' ]) : void
Parameters
$pagesize : int

size of page for paginated displayed table

$useinitialsbar : bool

whether to use the initials bar which will only be used if there is a fullname column defined

$downloadhelpbutton : string = ''

query_db()

Query the database for results to display in the table.

public query_db(int $pagesize[, bool $useinitialsbar = true ]) : void
Parameters
$pagesize : int

size of page for paginated displayed table

$useinitialsbar : bool = true

do you want to use the initials bar

set_context()

public set_context(mixed $context) : mixed
Parameters
$context : mixed

set_filterset()

Set filters and build table structure.

public set_filterset(filterset $filterset) : void
Parameters
$filterset : filterset

the filterset object to get the filters from

set_url()

public set_url(mixed $url) : mixed
Parameters
$url : mixed

set_users()

public set_users(mixed $users) : mixed
Parameters
$users : mixed

Override the table show_hide_link to not show for select column.

protected show_hide_link(string $column, int $index) : string
Parameters
$column : string

the column name, index into various names

$index : int

numerical index of the column

Return values
string

HTML fragment


        
On this page

Search results