Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Main course enrolment table. More...
Public Member Functions | |
__construct (course_enrolment_manager $manager) | |
Constructs the table. More... | |
get_bulk_user_enrolment_operations () | |
Returns an array of bulk operations. More... | |
get_combined_url_params () | |
Returns an array of URL params for both the table and the manager. More... | |
get_field_sort_direction ($field) | |
Gets the sort direction for a given field. More... | |
get_manual_enrol_buttons () | |
Returns an array of enrol_user_buttons that are created by the different enrolment plugins available. More... | |
get_paging_bar () | |
Gets the paging bar instance for this table. More... | |
get_url_params () | |
Gets the params that will need to be added to the url in order to return to this page. More... | |
has_bulk_user_enrolment_operations () | |
Returns true fi the table is aware of any bulk operations that can be performed on users selected from the currently filtered enrolment plugins. More... | |
initialise_javascript () | |
set_bulk_user_enrolment_operations (array $bulkoperations) | |
Sets the bulk operations for this table. More... | |
set_fields ($fields, $output) | |
Sets the fields for this table. More... | |
set_total_users ($totalusers) | |
Sets the total number of users. More... | |
set_users (array $users) | |
Sets the users for this table. More... | |
Public Attributes | |
array | $align |
An array of column alignments. More... | |
array | $attributes = array() |
Attributes of HTML attributes for the. More... | |
string | $caption |
Caption for the table, typically a title. More... | |
bool | $captionhide = false |
Whether to hide the table's caption from sighted users. More... | |
int | $cellpadding = null |
int | $cellspacing = null |
Spacing between cells, in pixels. More... | |
array | $colclasses |
An array of classes to add to every cell in a particular column, space-separated string. More... | |
array | $data = [] |
Array of arrays or html_table_row objects containing the data. More... | |
array | $head |
An array of headings. More... | |
array | $headspan |
An array that can be used to make a heading span multiple columns. More... | |
string | $id = null |
Value to use for the id attribute of the table. | |
int | $page = 0 |
The current page, starting from 0. | |
int | $pages = 0 |
The total number of pages. | |
int | $perpage = 0 |
The number of items to display per page. | |
array | $rowclasses |
Array of classes to add to particular rows, space-separated string. More... | |
array | $size |
The value is used as CSS 'size' property. More... | |
string | $sort |
The sort field for this table, should be one of course_enrolment_table::$sortablefields. | |
string | $sortdirection |
The sort direction, either ASC or DESC. | |
string | $summary |
Description of the contents for screen readers. More... | |
string | $tablealign = null |
string | $width = null |
array | $wrap |
An array of wrapping information. More... | |
const | DEFAULTPERPAGE = 100 |
The default number of items per page. More... | |
const | DEFAULTSORT = 'lastname' |
The default sort, options are course_enrolment_table::$sortablefields Default: lastname. | |
const | DEFAULTSORTDIRECTION = 'ASC' |
The default direction Default: ASC. | |
const | PAGEVAR = 'page' |
The get/post variable that is used to identify the page. More... | |
const | PERPAGEVAR = 'perpage' |
The get/post variable to is used to identify the number of items to display per page. More... | |
const | SORTDIRECTIONVAR = 'dir' |
The get/post variable that is used to identify the sort direction for the table. More... | |
const | SORTVAR = 'sort' |
The get/post variable that is used to identify the sort field for the table. More... | |
Protected Member Functions | |
get_direction_icon ($output, $field) | |
Gets the direction icon for the sortable field within this table. More... | |
Protected Attributes | |
array | $bulkoperations = array() |
An array of bulk user enrolment operations. | |
array | $fields = array() |
The fields for this table. | |
course_enrolment_manager | $manager |
The course manager this table is displaying for. | |
paging_bar | $pagingbar = null |
The paging bar that controls the paging for this table. | |
int | $totalusers = null |
The total number of users enrolled in the course. | |
array | $users = null |
The users enrolled in this course. | |
Static Protected Attributes | |
static array | $sortablefields |
An array of sortable fields. More... | |
Main course enrolment table.
This table is used to display the enrolment information for a course. It requires that a course enrolment manager be provided during constuct with provides all of the information for the table. The control then produces the table, the paging, and the associated JS actions for the page.
@subpackage enrol
course_enrolment_table::__construct | ( | course_enrolment_manager | $manager | ) |
Constructs the table.
course_enrolment_manager | $manager |
Reimplemented in course_enrolment_other_users_table.
course_enrolment_table::get_bulk_user_enrolment_operations | ( | ) |
Returns an array of bulk operations.
array |
course_enrolment_table::get_combined_url_params | ( | ) |
Returns an array of URL params for both the table and the manager.
array |
|
protected |
Gets the direction icon for the sortable field within this table.
core_renderer | $output | |
string | $field |
string |
course_enrolment_table::get_field_sort_direction | ( | $field | ) |
Gets the sort direction for a given field.
string | $field |
string | ASC or DESC |
course_enrolment_table::get_manual_enrol_buttons | ( | ) |
Returns an array of enrol_user_buttons that are created by the different enrolment plugins available.
array |
course_enrolment_table::get_paging_bar | ( | ) |
Gets the paging bar instance for this table.
paging_bar |
course_enrolment_table::get_url_params | ( | ) |
Gets the params that will need to be added to the url in order to return to this page.
array |
course_enrolment_table::has_bulk_user_enrolment_operations | ( | ) |
Returns true fi the table is aware of any bulk operations that can be performed on users selected from the currently filtered enrolment plugins.
bool |
course_enrolment_table::set_bulk_user_enrolment_operations | ( | array | $bulkoperations | ) |
Sets the bulk operations for this table.
array | $bulkoperations |
course_enrolment_table::set_fields | ( | $fields, | |
$output | |||
) |
Sets the fields for this table.
These get added to the tables head as well.
You can also use a multi dimensional array for this to have multiple fields in a single column
array | $fields | An array of fields to set |
string | $output |
course_enrolment_table::set_total_users | ( | $totalusers | ) |
Sets the total number of users.
int | $totalusers |
course_enrolment_table::set_users | ( | array | $users | ) |
Sets the users for this table.
array | $users |
void |
|
inherited |
An array of column alignments.
The value is used as CSS 'text-align' property. Therefore, possible values are 'left', 'right', 'center' and 'justify'. Specify 'right' or 'left' from the perspective of a left-to-right (LTR) language. For RTL, the values are flipped automatically.
Examples of usage: $t->align = array(null, 'right'); or $t->align[1] = 'right';
|
inherited |
Attributes of HTML attributes for the.
|
inherited |
Caption for the table, typically a title.
Example of usage: $t->caption = "TV Guide";
|
inherited |
Whether to hide the table's caption from sighted users.
Example of usage: $t->caption = "TV Guide"; $t->captionhide = true;
|
inherited |
|
inherited |
Spacing between cells, in pixels.
|
inherited |
An array of classes to add to every cell in a particular column, space-separated string.
Class 'cell' is added automatically by the renderer. Classes 'c0' or 'c1' are added automatically for every odd or even column, respectively. Class 'lastcol' is added automatically for all last cells in a row.
Example of usage: $t->colclasses = array(null, 'grade');
|
inherited |
Array of arrays or html_table_row objects containing the data.
Alternatively, if you have $head specified, the string 'hr' (for horizontal ruler) can be used instead of an array of cells data resulting in a divider rendered.
Example of usage with array of arrays: $row1 = array('Harry Potter', '76 '); $row2 = array('Hermione Granger', '100 '); $t->data = array($row1, $row2);
Example with array of html_table_row objects: (used for more fine-grained control) $cell1 = new html_table_cell(); $cell1->text = 'Harry Potter'; $cell1->colspan = 2; $row1 = new html_table_row(); $row1->cells[] = $cell1; $cell2 = new html_table_cell(); $cell2->text = 'Hermione Granger'; $cell3 = new html_table_cell(); $cell3->text = '100 '; $row2 = new html_table_row(); $row2->cells = array($cell2, $cell3); $t->data = array($row1, $row2);
|
inherited |
An array of headings.
The n-th array item is used as a heading of the n-th column. For more control over the rendering of the headers, an array of html_table_cell objects can be passed instead of an array of strings.
Example of usage: $t->head = array('Student', 'Grade');
|
inherited |
An array that can be used to make a heading span multiple columns.
In this example, } is supposed to have three columns. For the first two columns, * the same heading is used. Therefore, html_table::$head should consist of two items.
Example of usage: $t->headspan = array(2,1);
|
inherited |
Array of classes to add to particular rows, space-separated string.
Class 'lastrow' is added automatically for the last row in the table.
Example of usage: $t->rowclasses[9] = 'tenth'
|
inherited |
The value is used as CSS 'size' property.
Examples of usage: $t->size = array('50', '50'); or $t->size[1] = '120px';
|
staticprotected |
An array of sortable fields.
|
inherited |
Description of the contents for screen readers.
The "summary" attribute on the "table" element is not supported in HTML5. Consider describing the structure of the table in a "caption" element or in a "figure" element containing the table; or, simplify the structure of the table so that no description is needed.
|
inherited |
|
inherited |
|
inherited |
An array of wrapping information.
The only possible value is 'nowrap' that sets the CSS property 'white-space' to the value 'nowrap' in the given column.
Example of usage: $t->wrap = array(null, 'nowrap');
const course_enrolment_table::DEFAULTPERPAGE = 100 |
The default number of items per page.
Default: 100
const course_enrolment_table::PAGEVAR = 'page' |
The get/post variable that is used to identify the page.
Default: page
const course_enrolment_table::PERPAGEVAR = 'perpage' |
The get/post variable to is used to identify the number of items to display per page.
Default: perpage
const course_enrolment_table::SORTDIRECTIONVAR = 'dir' |
The get/post variable that is used to identify the sort direction for the table.
Default: dir
const course_enrolment_table::SORTVAR = 'sort' |
The get/post variable that is used to identify the sort field for the table.
Default: sort